/* Categories/Genres Page Styles */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("/assets/images/hero-pattern.svg") repeat;
  opacity: 0.1;
  z-index: 1;
}

.categories-section {
  padding: 2rem 0;
}

.section-header {
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.25rem;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 0;
}

.categories-count {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--accent);
  margin-top: 0.25rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 3rem 0;
  animation: fadeInUp 0.6s ease-out;
}

/* Resim tabanlı kartlar için özel stiller */
.categories-grid .category-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  
  /* Eski tarayıcılar için fallback - padding-bottom ile 2:3 oranı */
  height: 0;
  padding-bottom: 150%; /* 2:3 oranı için 150% (3/2 * 100) */
}

/* Modern tarayıcılar için aspect-ratio */
@supports (aspect-ratio: 2 / 3) {
  .categories-grid .category-card {
    height: auto;
    padding-bottom: 0;
    aspect-ratio: 2 / 3;
  }
}

.categories-grid .category-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.categories-grid .category-card img:not([src]),
.categories-grid .category-card img[src=""],
.categories-grid .category-card img[src*="placeholder"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  position: relative;
}

.categories-grid .category-card img:not([src])::after,
.categories-grid .category-card img[src=""]::after,
.categories-grid .category-card img[src*="placeholder"]::after {
  content: "🎬";
  font-size: 3rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.categories-grid .category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.categories-grid .category-card:hover img {
  transform: scale(1.05);
}

.categories-grid .category-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  padding: 1.5rem;
  color: white;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.categories-grid .category-card:hover .category-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.7) 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

.categories-grid .category-overlay h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: white;
}

.categories-grid .category-overlay span {
  font-size: 0.9rem;
  opacity: 0.9;
  color: white;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  animation: slideInUp 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
  animation-fill-mode: both;
}

.category-card:nth-child(1) {
  animation-delay: 0.1s;
}
.category-card:nth-child(2) {
  animation-delay: 0.2s;
}
.category-card:nth-child(3) {
  animation-delay: 0.3s;
}
.category-card:nth-child(4) {
  animation-delay: 0.4s;
}
.category-card:nth-child(5) {
  animation-delay: 0.5s;
}
.category-card:nth-child(6) {
  animation-delay: 0.6s;
}
.category-card:nth-child(7) {
  animation-delay: 0.7s;
}
.category-card:nth-child(8) {
  animation-delay: 0.8s;
}
.category-card:nth-child(9) {
  animation-delay: 0.9s;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  font-size: 2.5rem;
  min-width: 50px;
  text-align: center;
  filter: grayscale(0.3);
  transition: all 0.3s ease;
  z-index: 1;
  background: linear-gradient(135deg, #f8f9ff, #e8ecff);
  border-radius: 20px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card:hover .category-icon {
  filter: grayscale(0);
  transform: scale(1.1);
}

.category-info {
  flex: 1;
  z-index: 1;
  min-width: 0;
}

.category-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.category-card:hover .category-name {
  color: var(--accent);
}

.category-count {
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 1rem;
  font-weight: 500;
}

.popularity-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.popularity-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.8s ease;
}

.category-arrow {
  font-size: 1.5rem;
  color: #cbd5e0;
  transition: all 0.3s ease;
  z-index: 1;
  flex-shrink: 0;
}

.category-card:hover .category-arrow {
  color: var(--accent);
  transform: translateX(5px);
}

/* Special Card Types */
.genre-card {
  border-left: 3px solid var(--warning);
  background: linear-gradient(135deg, #fef5e7, #fed7aa);
}

.genre-card:hover .category-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.country-card {
  border-left: 3px solid var(--success);
}

/* No Categories */
.no-categories {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  color: #718096;
}

.no-categories-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
  opacity: 0.6;
}

.no-categories h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.no-categories p {
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  line-height: 1.6;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 3rem 0 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #4a5568;
  background: white;
  border: 1px solid #e2e8f0;
}

.pagination-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination-item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination-prev,
.pagination-next {
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
}

.pagination-icon {
  font-size: 1.1rem;
  font-size: 0.875rem;
}

.pagination-dots {
  color: var(--text-secondary);
  letter-spacing: 2px;
  color: #a0aec0;
  padding: 0 0.5rem;
}

.pagination-numbers {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  
  .categories-grid .category-overlay {
    padding: 1rem;
    transform: translateY(0);
  }
  
  .categories-grid .category-overlay h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .categories-grid .category-overlay {
    padding: 0.75rem;
    transform: translateY(0);
  }
  
  .categories-grid .category-overlay h3 {
    font-size: 1rem;
  }
  
  .categories-grid .category-overlay span {
    font-size: 0.8rem;
  }

  .category-card {
    padding: 1.25rem;
    gap: 1rem;
  }

  .category-icon {
    font-size: 2rem;
    min-width: 40px;
    width: 60px;
    height: 60px;
  }

  .category-name {
    font-size: 1.1rem;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination-numbers {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
  }

  .hero {
    padding: 60px 0 40px;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .categories-grid .category-overlay {
    padding: 1rem;
    transform: translateY(0);
  }
  
  .categories-grid .category-overlay h3 {
    font-size: 1.1rem;
  }
  
  .categories-grid .category-overlay span {
    font-size: 0.9rem;
  }

  .category-card {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .category-arrow {
    transform: rotate(90deg);
  }

  .category-card:hover .category-arrow {
    transform: rotate(90deg) translateX(5px);
  }
}

/* Loading Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus states for accessibility */
.category-card:focus,
.pagination-item:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .category-card {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .category-name {
    color: #e2e8f0;
  }

  .category-count {
    color: #a0aec0;
  }

  .category-card:hover .category-name {
    color: #90cdf4;
  }

  .no-categories h3 {
    color: #e2e8f0;
  }
}
