/**
 * 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.
 */

/* ==========================================================================
   0. Helpers
   ========================================================================== */

.a-visible--piano {
    opacity: 1 !important;
    width: auto !important;
}

/* ==========================================================================
   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;
  position: fixed;
  /* `inset: 0` anchors all four edges to the viewport so the overlay tracks
     iOS Safari's dynamic toolbar — `height: 100%` left a strip uncovered at
     the bottom on iPhone (WORD-5104). */
  inset: 0;
  z-index: 2147483646; /* Below Piano modal. Note value One less than the .tp-modal on this document which is the max. See WORD-4481 */
}

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

body.show-blur {
  overflow: hidden;
}

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

/* ==========================================================================
   6. Social Account Linking Modal
   ========================================================================== */

body.piano-social-linking-modal-open {
  overflow: hidden;
}

.piano-social-linking-modal {
  align-items: center;
  background-color: rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  padding: 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 2147483647; /* Same as Piano modals */
}

.piano-social-linking-modal__content {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  max-height: 90vh;
  max-width: 500px;
  overflow-y: auto;
  padding: 40px 30px;
  position: relative;
  width: 100%;
}

.piano-social-linking-modal__close {
  align-items: center;
  background: none;
  border-radius: 4px;
  border: none;
  color: rgba(102, 102, 102, 1);
  cursor: pointer;
  display: flex;
  font-size: 28px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 16px;
  top: 16px;
  transition: background-color 0.2s;
  width: 32px;
}

.piano-social-linking-modal__close:hover {
  background-color: rgba(240, 240, 240, 1);
  color: rgba(51, 51, 51, 1);
}

.piano-social-linking-modal__body {
  text-align: center;
}

.piano-social-linking-modal__title {
  color: rgba(0, 0, 0, 1);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  text-align: center;
}

.piano-social-linking-modal__description {
  color: rgba(0, 0, 0, 1);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 32px 0;
  text-align: center;
}

.piano-social-linking-form__field {
  margin-bottom: 24px;
}

.piano-social-linking-form__input-wrapper {
  align-items: center;
  display: flex;
  position: relative;
}

.piano-social-linking-form__input {
  border-radius: 4px;
  border: 1px solid rgba(221, 221, 221, 1);
  box-sizing: border-box;
  color: rgba(0, 0, 0, 1);
  font-size: 16px;
  padding: 12px;
  transition: border-color 0.2s;
  width: 100%;
}

.piano-social-linking-form__input::placeholder {
  color: rgba(153, 153, 153, 1);
}

.piano-social-linking-form__input:focus {
  border-color: rgba(0, 102, 204, 1);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  outline: none;
}

.piano-social-linking-form__input:disabled {
  background-color: rgba(245, 245, 245, 1);
  cursor: not-allowed;
}

.piano-social-linking-form__message {
  border-radius: 4px;
  display: none;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 12px;
}

.piano-social-linking-form__message--error {
  background-color: rgba(255, 238, 238, 1);
  border: 1px solid rgba(255, 204, 204, 1);
  color: rgba(204, 51, 51, 1);
}

.piano-social-linking-form__message--info {
  background-color: rgba(227, 242, 253, 1);
  border: 1px solid rgba(187, 222, 251, 1);
  color: rgba(25, 118, 210, 1);
}

.piano-social-linking-form__message--success {
  background-color: rgba(232, 245, 233, 1);
  border: 1px solid rgba(200, 230, 201, 1);
  color: rgba(46, 125, 50, 1);
}

.piano-social-linking-form__actions {
  display: flex;
  justify-content: center;
}

.piano-social-linking-form__submit {
  background-color: rgba(220, 38, 38, 1);
  border-radius: 4px;
  border: none;
  color: rgba(255, 255, 255, 1);
  cursor: pointer;
  font-family: var(--f-primary);
  font-size: 16px;
  font-weight: bold;
  padding: 14px 24px;
  text-align: center;
  transition: background-color 0.2s, opacity 0.2s;
  width: 100%;
}

.piano-social-linking-form__submit:hover:not(:disabled) {
  background-color: rgba(185, 28, 28, 1);
}

.piano-social-linking-form__submit:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

@media (max-width: 480px) {
  .piano-social-linking-modal {
    padding: 10px;
  }

  .piano-social-linking-modal__content {
    max-height: 95vh;
    padding: 32px 24px;
  }

  .piano-social-linking-modal__title {
    font-size: 20px;
  }

  .piano-social-linking-modal__description {
    font-size: 14px;
  }
}
