/* All Topics Page Styles */

/* Hero Section Animation */
.all-topics-hero {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Topics Grid Animation */
.topic-card {
  animation: fadeInScale 0.6s ease-out;
  animation-fill-mode: both;
}

.topic-card:nth-child(1) { animation-delay: 0.1s; }
.topic-card:nth-child(2) { animation-delay: 0.2s; }
.topic-card:nth-child(3) { animation-delay: 0.3s; }
.topic-card:nth-child(4) { animation-delay: 0.4s; }
.topic-card:nth-child(5) { animation-delay: 0.5s; }
.topic-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Filter Section Enhancements */
.topics-filter {
  position: sticky;
  top: 80px;
  z-index: 100;
  margin-bottom: 40px;
}

.category-filter {
  position: relative;
  overflow: hidden;
}

.category-filter::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.category-filter:hover::before {
  width: 100px;
  height: 100px;
}

/* Search Input Enhancement */
#topics-search {
  position: relative;
}

#topics-search:focus {
  animation: inputGlow 0.3s ease;
}

@keyframes inputGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  }
}

/* Enhanced Topic Cards */
.topic-card {
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.topic-card:hover::before {
  left: 100%;
}

/* Featured Badge Animation */
.topic-card div[style*="position: absolute"][style*="top: -10px"] {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  }
}

/* Back to Top Button Enhancement */
#back-to-top {
  backdrop-filter: blur(10px);
}

#back-to-top:hover {
  transform: translateY(-3px) scale(1.1);
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .all-topics-hero {
    padding: 60px 0 40px !important;
  }
  
  .topics-filter {
    position: static;
    margin: 0 16px 24px;
  }
  
  .topic-card {
    animation-delay: 0s !important;
  }
  
  #topics-container {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .all-topics-hero h1 {
    font-size: 32px !important;
  }
  
  .all-topics-hero p {
    font-size: 16px !important;
  }
  
  .topics-filter > div {
    padding: 16px !important;
  }
  
  .topics-filter > div > div:first-child {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  #topics-search {
    width: 100%;
    min-width: auto !important;
  }
  
  .category-filter {
    font-size: 12px !important;
    padding: 6px 12px !important;
  }
}

/* Loading States */
.loading-state {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading-state::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border: 3px solid #E2E8F0;
  border-top: 3px solid #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

/* Smooth Transitions */
* {
  scroll-behavior: smooth;
}

/* Print Styles */
@media print {
  .topics-filter,
  #back-to-top,
  .slider-controls {
    display: none !important;
  }
  
  .topic-card {
    break-inside: avoid;
    margin-bottom: 20px;
  }
}