/**
 * Integration CSS
 *
 * This stylesheet contains the core styles for the Piano Composer Experiences,
 * including the Meter Experience. It ensures the Meter <div> (and any future
 * experiences) containers have the styles needed.
 *
 * Please do not remove this comment block. You may add your own notes below.
 */

/* ==========================================================================
   1. Animations
   ========================================================================== */

@keyframes slideUp {
  from {
    /* Start from a fixed position below the viewport. */
    transform: translateY(0);
    opacity: 1; /* Ensure it starts visible */
  }
  to {
    /* Settle into the final position. */
    transform: translateY(0);
    opacity: 1; /* Ensure it stays visible */
  }
}

/* ==========================================================================
   2. Meter Experience
   ========================================================================== */

.m-experience {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2147483647; /* Maximum z-index */

    /* Initially hide the container by moving it down. */
    transform: translateY(100%);
    visibility: hidden;

    /* Transition for a smooth slide-out. */
    transition: transform 0.5s ease-out, visibility 0s 0.5s;
}

/* Allow scrolling for landscape orientation. */
@media (max-width: 1024px) and (orientation: landscape) {
  .m-experience {
    max-height: 100vh;
    overflow-y: auto;
    padding-top: 60px;
  }
}

/* Mobile vertical orientation specific styles. */
@media (max-width: 480px) and (orientation: portrait) {
  .m-experience {
    bottom: auto;
    max-height: 100vh;
    overflow-y: auto;
    top: 0;
  }
}

.m-experience.is-visible {
    visibility: visible;
    transform: translateY(0); /* Move it back to the visible position */
    box-shadow: 0 0 28px 0 rgba(51, 51, 51, 0.1);

    /* Animation to slide up. */
    animation: slideUp 1.5s ease-out 0.12s both;
}

/* ==========================================================================
   3. Piano Modals
   ========================================================================== */

.tp-modal {
    z-index: 2147483647 !important; /* Maximum z-index - Important is needed */
}

/* ==========================================================================
   4. Screen Name Notice
   ========================================================================== */

#screen-name-message {
    display: none;
}

/* ==========================================================================
   5. Blur Overlay
   ========================================================================== */

#blur-overlay {
  -webkit-backdrop-filter: blur(8px); /* Safari */
  backdrop-filter: blur(8px);
  background-color: rgba(131, 119, 119, 0.3); /* A slightly more subtle background */
  opacity: 0;
  visibility: hidden;
  height: 100%;
  left: 0;
  position: fixed; /* adjust based on your layout */
  top: 0;
  width: 100%;
  z-index: 2147483640; /* Below Piano modal */
}

body.show-blur #blur-overlay {
  opacity: 1;
  visibility: visible;
}

body.show-blur {
  overflow: hidden;
}

body.is-incognito {
  overflow: hidden;
  height: 100vh;
}
