@use '../../variables' as *;
@use '../../mixins' as *;
@use 'sass:color';

.song-player-page {
  width: 100%;
  max-width: 100%;
  padding: 0;

  .song-player-container {
    margin-top: 25px;
    max-width: 100% !important;
    padding: 0 16px !important;

    .song-player-content {
      margin-top: 25px;
      background-color: transparent;
      border-radius: 8px;
      display: flex;
      flex-wrap: nowrap;
      height: 480px;
      gap: 20px;
      width: 100%;

      .song-title {
        color: $text-primary;
        font-weight: bold;
      }

      .error-alert-lrc {
        margin-top: 32px;
      }


      .queue-parent {
        width: 22%;
        padding-right: 16px;
        display: flex;
        flex-direction: column;
        width: 22%;
        align-items: center;
      }

      .grid-parent {
        display: flex;
        flex-direction: column;
        border-radius: 8px;
        background: $gradient;
        box-shadow: $box-shadow;
        justify-content: center;

        .lrc-offset-text {
          color: $text-primary;
        }

        .lrc-grid-parent {
          display: flex;
          justify-content: center;
          align-items: center;
          overflow: auto;
          margin-top: 2px;
          height: 100%;
        }

        .tabs-grid-parent {
          display: flex;
          flex-direction: column;
          width: 100%;
        }
      }

      .youtube-grid-parent {
        height: 100%;
        width: 33%;
        display: flex;
        flex-direction: column;
        border-radius: 8px;
        background: $gradient;
        box-shadow: $box-shadow;
        max-width: 100%;
        justify-content: center;

      }
    }

    .quiz-button {
      box-shadow: 3;
      padding: 10px 20px;
      background: $secondary-color;
    }

    // Keeping rgba since it's special case here
    @keyframes pulse {
      0% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
      }

      50% {
        transform: scale(1.01);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
      }

      100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
      }
    }

    .search-section,
    .playlist-section {
      padding: 20px;
      background: $gradient;
      border-radius: 8px;
      margin-bottom: 20px;
      width: 100%;
      margin-right: 20px;
      max-width: 100%;
      box-sizing: border-box;

      .skeleton-input {
        width: 100%;
        height: 56px;
        border-radius: 4px;

        &.MuiSkeleton-root {
          transform: scale(1);
          // Gradient for shimmer loading, OK to hardcode so using rgba
          background: linear-gradient(90deg,
              rgba(0, 0, 0, 0.08) 0%,
              rgba(0, 0, 0, 0.15) 50%,
              rgba(0, 0, 0, 0.08) 100%);
          background-size: 200% 100%;
          animation: shimmer 1.5s infinite;
        }
      }

      @keyframes shimmer {
        0% {
          background-position: 200% 0;
        }

        100% {
          background-position: -200% 0;
        }
      }

      .queue-button {
        background-color: $secondary-color;
        transition: all 0.2s ease;

        &:hover {
          background-color: color.scale($secondary-color, $lightness: 10%);
          transform: scale(1.1);
        }

        // Primary button (Add Next & Play)
        &.MuiIconButton-colorPrimary {
          color: $primary-color;
        }

        // Secondary button (Add to End)
        &.MuiIconButton-colorSecondary {
          color: $primary-color;
        }
      }

      .section-title {
        margin-bottom: 16px;
        color: $text-primary;
        font-weight: bold;
      }

      .section-subtitle {
        margin-bottom: 24px;
        color: $text-secondary;
      }

      .search-input {
        background-color: white;
        border-radius: 8px;

        .MuiFilledInput-root {
          background-color: white;
        }
      }

      .search-button {
        &.loading {
          background-color: transparent !important;
          opacity: 0.5;
          pointer-events: none;
        }

        background-color: $secondary-color;
        color: white;

        &:hover {
          background-color: color.scale($secondary-color, $lightness: -10%);
        }
      }
    }
  }
}

.bottom-grid {
  padding-top: 30px;
  padding-bottom: 30px;
  display: flex;
  height: 100%;

  .queue-grid {
    display: flex;
    height: 100%;
  }

}


.controls-grid {
  justify-content: center;
  height: 70px;
  padding-top: 25px;
  padding-left: 7px;
  .ktv-toggle {
    display: flex;
    align-items: center;
    margin: 0 auto;

    &.Mui-selected {
      background-color: rgba(27, 177, 32, 0.6);
      font-weight: bold;
      color: white;

      &:hover {
        background-color: rgba(87, 199, 90, 0.5);
      }
    }
  }
}

.slider-grid {
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 0px;
  height: 10px;
  padding-top: 5px;
  display: flex;
}
.slider-grid-parent {
  height: 10px;
}
.slider-label {
  color: $text-primary;
  font-weight: bold;
  padding-bottom: 5px;
}

.slider {
  padding-right: 0px;
}

.lyric-set-offset {
  display: flex;
  padding-left: 40px;
  .MuiTextField-root {
    .MuiInputLabel-root {
      font-size: 0.75rem;
    }
  }
}
