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

.home-page {
  background-color: $primary-color;
  color: black;
  padding: 32px;

  .resized-image {
    width: 175px;
    height: auto;
    display: block;
    margin: 0 auto;
    margin-bottom: 20px;
  }


  .info-alert {
    margin-bottom: 32px;
    background-color: rgba(255, 255, 255, 0.9);
    color: $text-primary;
  }

  .error-alert {
    margin-bottom: 32px;
  }

  .search-section,
  .playlist-section {
    padding: 20px;
    background: $gradient;
    border-radius: 8px;

    .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;
      }
    }

    .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%);
      }
    }
  }

  .or-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 32px 0;

    .or-paper {
      padding: 8px 16px;
      background-color: rgba(255, 255, 255, 0.9);
      border-radius: 20px;

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

  .playlist-url-input {
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;

    .MuiButton-root {
      margin-left: 16px;
      background-color: $secondary-color;
      height: 55px;
    }

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