/* assets/css/genres.css */

:root {
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #8b5cf6 50%, #764ba2 100%);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 40px rgba(102,126,234,0.4);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: linear-gradient(180deg, rgba(102,126,234,0.03) 0%, rgba(118,75,162,0.03) 100%);
  min-height: 100vh;
  position: relative;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  animation: rotateBackground 35s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes rotateBackground {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.page-title-section {
  background: var(--gradient-primary);
  padding: 3.5rem 0;
  border-radius: 0 0 32px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.page-title-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -30%;
  width: 120%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  animation: floatGlow 18s ease-in-out infinite;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, 10%) scale(1.1); }
}

.page-title-section .page-title {
  color: white;
  font-weight: 800;
  font-size: 2.8rem;
  text-shadow: 0 4px 16px rgba(0,0,0,0.25);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  animation: titlePulse 4s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.page-title-section .page-description {
  color: rgba(255,255,255,0.95);
  font-size: 1.15rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.section-padding {
  padding: 2.5rem 0 5rem 0;
  position: relative;
  z-index: 1;
}

.genres-filter {
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 100%);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 32px rgba(102,126,234,0.15);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(102,126,234,0.1);
  position: relative;
  overflow: hidden;
}

.genres-filter::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.filter-title {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

#genres-counter {
  color: #6b7280;
  font-weight: 600;
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(118,75,162,0.1) 100%);
  border-radius: 12px;
  font-size: 0.9rem;
}

#genre-search {
  border-radius: 16px;
  border: 2px solid rgba(139,92,246,0.2);
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  transition: var(--transition);
  background: rgba(255,255,255,0.9);
}

#genre-search:focus {
  box-shadow: 0 0 0 4px rgba(139,92,246,0.15);
  border-color: #8b5cf6;
  background: white;
  outline: none;
}

#genre-search::placeholder {
  color: #94a3b8;
}

#genre-search-btn {
  border-radius: 16px;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #8b5cf6 0%, #764ba2 100%);
  border: none;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(139,92,246,0.3);
}

#genre-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139,92,246,0.4);
  background: linear-gradient(135deg, #764ba2 0%, #8b5cf6 100%);
}

#genre-search-btn i {
  font-size: 1.1rem;
}

#genres-grid {
  position: relative;
}

.genre-card {
  height: 280px;
  border-radius: 20px;
  background-size: cover !important;
  background-position: center !important;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
  border: 2px solid rgba(255,255,255,0.1);
}

.genre-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
  transition: var(--transition);
  z-index: 1;
}

.genre-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.3) 0%, rgba(118,75,162,0.3) 100%);
  opacity: 0;
  transition: var(--transition);
  z-index: 2;
}

.genre-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 20px 60px rgba(139,92,246,0.4);
  border-color: rgba(139,92,246,0.5);
}

.genre-card:hover::before {
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
}

.genre-card:hover::after {
  opacity: 1;
}

.genre-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem;
  z-index: 3;
  transform: translateY(0);
  transition: var(--transition);
}

.genre-card:hover .genre-card-body {
  transform: translateY(-8px);
}

.genre-card-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: var(--transition);
}

.genre-card:hover .genre-card-title {
  transform: scale(1.05);
  text-shadow: 0 6px 20px rgba(0,0,0,0.7);
}

.genre-card-count {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
}

.genre-card:hover .genre-card-count {
  background: rgba(255,255,255,0.25);
  transform: translateX(5px);
}

.genre-card-body::before {
  content: '🎵';
  position: absolute;
  top: -80px;
  right: 20px;
  font-size: 4rem;
  opacity: 0.2;
  transition: var(--transition);
  filter: blur(1px);
}

.genre-card:hover .genre-card-body::before {
  opacity: 0.4;
  transform: scale(1.2) rotate(15deg);
  filter: blur(0);
}

.empty-state {
  padding: 5rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.08) 0%, rgba(118,75,162,0.08) 100%);
  border: 2px dashed rgba(139,92,246,0.3);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 50%, rgba(139,92,246,0.12) 0%, transparent 60%);
  animation: moveGradient 10s ease-in-out infinite;
}

@keyframes moveGradient {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20%, 20%); }
}

.empty-state i {
  font-size: 5rem;
  color: #94a3b8;
  opacity: 0.5;
  animation: floatIcon 4s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

.empty-state h3 {
  font-weight: 700;
  color: #64748b;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
  position: relative;
  z-index: 1;
}

.empty-state p {
  color: #94a3b8;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.alert-danger {
  border-radius: 16px;
  border: 2px solid rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 226, 226, 0.85) 100%);
  backdrop-filter: blur(8px);
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.genre-card {
  animation: fadeInScale 0.6s ease-out backwards;
}

.col-6:nth-child(1) .genre-card { animation-delay: 0.05s; }
.col-6:nth-child(2) .genre-card { animation-delay: 0.1s; }
.col-6:nth-child(3) .genre-card { animation-delay: 0.15s; }
.col-6:nth-child(4) .genre-card { animation-delay: 0.2s; }
.col-6:nth-child(5) .genre-card { animation-delay: 0.25s; }
.col-6:nth-child(6) .genre-card { animation-delay: 0.3s; }
.col-6:nth-child(7) .genre-card { animation-delay: 0.35s; }
.col-6:nth-child(8) .genre-card { animation-delay: 0.4s; }
.col-6:nth-child(9) .genre-card { animation-delay: 0.45s; }
.col-6:nth-child(10) .genre-card { animation-delay: 0.5s; }
.col-6:nth-child(11) .genre-card { animation-delay: 0.55s; }
.col-6:nth-child(12) .genre-card { animation-delay: 0.6s; }
.col-6:nth-child(n+13) .genre-card { animation-delay: 0.65s; }

@media (max-width: 991px) {
  .page-title-section .page-title {
    font-size: 2.3rem;
  }
  
  .genres-filter {
    padding: 1.5rem;
  }
  
  .genre-card {
    height: 260px;
  }
}

@media (max-width: 768px) {
  body::before {
    animation: rotateBackground 50s linear infinite;
  }
  
  .page-title-section { 
    padding: 2.5rem 0;
    border-radius: 0 0 24px 24px;
  }
  
  .page-title-section .page-title {
    font-size: 2rem;
  }
  
  .page-title-section .page-description {
    font-size: 1rem;
  }
  
  .genres-filter {
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 2rem;
  }
  
  .filter-title {
    font-size: 1.25rem;
  }
  
  #genres-counter {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
  
  #genre-search {
    border-radius: 14px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  
  #genre-search-btn {
    border-radius: 14px;
    padding: 0.75rem 1.25rem;
  }
  
  .genre-card {
    height: 220px;
    border-radius: 16px;
  }
  
  .genre-card-body {
    padding: 1.25rem;
  }
  
  .genre-card-title {
    font-size: 1.25rem;
  }
  
  .genre-card-count {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
  }
  
  .genre-card-body::before {
    font-size: 3rem;
    top: -60px;
    right: 15px;
  }
  
  .empty-state {
    padding: 4rem 1.5rem;
    border-radius: 20px;
  }
  
  .empty-state i {
    font-size: 4rem;
  }
  
  .empty-state h3 {
    font-size: 1.5rem;
  }
  
  .empty-state p {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .page-title-section .page-title {
    font-size: 1.75rem;
  }
  
  .filter-title {
    font-size: 1.1rem;
    text-align: center;
  }
  
  #genres-counter {
    display: block;
    margin-top: 0.5rem;
    text-align: center;
  }
  
  .genre-card {
    height: 200px;
  }
  
  .genre-card-title {
    font-size: 1.1rem;
  }
  
  .genre-card-count {
    font-size: 0.85rem;
  }
}