/* ========================================
   🎵 SONG FINDER TOOL - CSS
   Matches Index.html Theme
======================================== */

/* ========================================
   ⬅️ ENHANCED BACK BUTTON
======================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  margin: 4rem 2rem 2rem;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  width: fit-content;
}

.back-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}

.back-btn:hover::before {
  left: 100%;
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.back-btn:active {
  transform: translateX(-3px) scale(0.98);
}


/* ========================================
   📦 TOOL CONTAINER
======================================== */
.tool-container {
  max-width: 1000px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  animation: fadeInUp 0.6s ease;
}


/* ========================================
   🔄 PLATFORM TABS
======================================== */
.platform-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--card-bg);
  padding: 0.75rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  justify-content: center;
}

.platform-tab {
  flex: 1;
  min-width: 150px;
  padding: 1rem 1.5rem;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.platform-tab:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

.platform-tab.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.tab-icon {
  font-size: 1.2rem;
}

/* ========================================
   🎴 TOOL CARD
======================================== */
.tool-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  margin-bottom: 3rem;
}

/* ========================================
   📥 INPUT SECTION
======================================== */
.input-section {
  margin-bottom: 2rem;
}

.input-section label {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.link-input {
  width: 100%;
  padding: 1.25rem 3rem 1.25rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  transition: all 0.3s ease;
}

.link-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.link-input::placeholder {
  color: var(--text-light);
}

.clear-btn {
  position: absolute;
  right: 1rem;
  width: 30px;
  height: 30px;
  background: var(--text-light);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #ef4444;
  transform: rotate(90deg);
}

.clear-btn.visible {
  display: flex;
}

.input-hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hint-icon {
  font-size: 1rem;
}

/* ========================================
   🔘 ACTION BUTTON
======================================== */
.action-btn {
  width: 100%;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.action-btn:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.3rem;
}

/* ========================================
   ⏳ LOADING STATE
======================================== */
.loading-state {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid var(--bg-color);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state p {
  font-size: 1rem;
  color: var(--text-light);
  margin: 0;
}

/* ========================================
   ❌ ERROR MESSAGE
======================================== */
.error-message {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border: 2px solid #ef4444;
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  color: #dc2626;
  font-weight: 600;
  font-size: 1rem;
}

/* ========================================
   📊 RESULTS SECTION
======================================== */
.results-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.results-title {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.songs-list {
  display: grid;
  gap: 1.5rem;
}

/* Song Card */
.song-card {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.song-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.song-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.song-cover {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.song-info {
  flex: 1;
}

.song-title {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.song-artist {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.song-album {
  font-size: 0.9rem;
  color: var(--text-light);
}

.song-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.music-link {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spotify-link {
  background: #1DB954;
  color: white;
}

.spotify-link:hover {
  background: #1ed760;
  transform: translateY(-2px);
}

.youtube-link {
  background: #FF0000;
  color: white;
}

.youtube-link:hover {
  background: #ff1a1a;
  transform: translateY(-2px);
}

.apple-link {
  background: #FA243C;
  color: white;
}

.apple-link:hover {
  background: #ff3d55;
  transform: translateY(-2px);
}

/* ========================================
   📖 HOW TO USE SECTION
======================================== */
.how-to-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 2rem;
  font-weight: 700;
  text-align: center;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.step-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.step-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.step-number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.step-content h3 {
  font-size: 1.2rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.step-content p {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.8;
  margin: 0;
}

/* ========================================
   📝 BLOG CTA
======================================== */
.blog-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.blog-cta-content h3 {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 700;
}

.blog-cta-content p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.blog-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.blog-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   ✨ FEATURES SECTION
======================================== */
.features-section {
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.feature-card p {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.8;
  margin: 0;
}

/* ========================================
   ❓ FAQ SECTION
======================================== */
.faq-section {
  margin-bottom: 3rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.faq-item {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.faq-item h3 {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.faq-item p {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.8;
  margin: 0;
}

/* ========================================
   📱 RESPONSIVE - TABLETS (640px+)
======================================== */
@media (min-width: 640px) {
  .tool-header h1 {
    font-size: 3.5rem;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   💻 RESPONSIVE - DESKTOP (1024px+)
======================================== */
@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   📱 RESPONSIVE - MOBILE (<640px)
======================================== */
@media (max-width: 640px) {
  .tool-container {
    margin: 2rem auto;
    padding: 0 1rem;
  }

  .tool-header h1 {
    font-size: 2rem;
  }

  .tool-description {
    font-size: 1rem;
  }

  .tool-card {
    padding: 2rem 1.5rem;
  }

  .platform-tabs {
    flex-direction: column;
  }

  .platform-tab {
    min-width: 100%;
  }

  .step-card {
    flex-direction: column;
    text-align: center;
  }

  .song-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .song-links {
    justify-content: center;
  }

  .how-to-section {
    padding: 2rem 1.5rem;
  }

  .blog-cta {
    padding: 2rem 1.5rem;
  }
}

/* ========================================
   ✨ ANIMATIONS
======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   ♿ ACCESSIBILITY
======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}