/* Variables CSS modernes */
:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --secondary: #06b6d4;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --text: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;

  --background: #0f172a;
  --background-secondary: #1e293b;
  --card-bg: #1e293b;
  --glass-bg: rgba(30, 41, 59, 0.8);

  --border: #334155;
  --border-light: #475569;

  --shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.4);

  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Reset et base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--background) 0%, #1a202c 100%);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  padding-top: 80px;
  overflow-x: hidden;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
}

/* Navigation */
.navbar {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text) !important;
  text-decoration: none;
  transition: var(--transition);
}

.navbar-brand:hover {
  transform: translateY(-2px);
}

.logo-container {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.logo-text {
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
}

.brand-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.navbar-toggler {
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar-toggler:hover {
  background: var(--glass-bg);
  transform: scale(1.05);
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: 2px solid var(--primary);
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 0.75rem 1rem !important;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary) !important;
  background: var(--glass-bg);
  transform: translateY(-2px);
}

.nav-link::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 80%;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.2rem;
}

.theme-toggle:hover {
  background: var(--primary);
  color: white;
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

/* Search */
.search-container {
  position: relative;
  min-width: 300px;
}

.search-input-wrapper {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 4px;
  transition: var(--transition);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.search-input {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.95rem;
  width: calc(100% - 50px);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  box-shadow: none !important;
  outline: none !important;
}

.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  border: none !important;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: var(--transition);
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-result-item:hover {
  background: var(--glass-bg);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item img {
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

/* Dropdown menus */
.dropdown-menu {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  padding: 0.5rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
  font-weight: 500;
}

.dropdown-item:hover {
  background: var(--primary);
  color: white;
  transform: translateX(5px);
}

.mega-menu {
  min-width: 600px;
  max-width: 800px;
}

.scrollable-container {
  max-height: 400px;
  overflow-y: auto;
}

.year-link,
.genre-link,
.company-link {
  display: block;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  text-align: center;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.year-link:hover,
.genre-link:hover,
.company-link:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* User menu */
.user-menu-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 0.75rem 1rem !important;
}

/* Hero Section */
.hero-section {
  height: 80vh;
  min-height: 600px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  margin: 2rem 1rem;
  box-shadow: var(--shadow-lg);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 3rem 2rem;
  z-index: 2;
}

.hero-text {
  max-width: 600px;
}

.hero-title {
  font-family: "Playfair Display", serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 25px;
  transition: var(--transition);
  border: none;
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Content Sections */
.content-section {
  margin: 4rem 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.title-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 70px;
  width: 100px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.view-all-btn {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--primary);
  border-radius: 25px;
}

.view-all-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Movie Carousel */
.movie-carousel-container {
  overflow-x: auto;
  padding: 1rem 0;
}

.movie-carousel {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1rem;
}

.movie-carousel::-webkit-scrollbar {
  height: 8px;
}

/* Movies Grid */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

/* Movie Cards */
.movie-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.movie-card .card-img-top {
  height: 300px;
  width: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.movie-card:hover .card-img-top {
  transform: scale(1.05);
}

.movie-card .card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.movie-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.movie-card .badge {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Conteneur principal des films filtrés */
#filtered-movies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

/* Styles des cartes de films filtrés */
#filtered-movies .movie-card {
  height: 100%;
}

#filtered-movies .movie-card .card-img-top {
  height: 300px;
}

.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  transition: var(--transition);
  z-index: 10;
}

.favorite-btn:hover,
.favorite-btn.active {
  background: var(--danger);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(245, 158, 11, 0.9);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  opacity: 0;
  transition: var(--transition);
  z-index: 10;
}

.movie-card:hover .play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* Rating colors */
.bg-success {
  background-color: var(--success) !important;
}
.bg-warning {
  background-color: var(--warning) !important;
}
.bg-danger {
  background-color: var(--danger) !important;
}

/* Filter tags */
.filter-tags {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-tag {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 25px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.filter-tag:hover {
  background: var(--primary);
  color: white;
}

.remove-filter {
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.remove-filter:hover {
  transform: scale(1.2);
}

/* Toast notifications */
.toast-container {
  z-index: 1050;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.toast-body {
  padding: 1rem;
  font-weight: 500;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.footer-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.footer-title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 1.2rem;
}

.social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.footer-divider {
  border-color: var(--border);
  margin: 2rem 0 1rem;
}

.footer-bottom {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Light Theme */
[data-theme="light"] {
  --text: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --background: #f9fafb;
  --background-secondary: #ffffff;
  --card-bg: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.8);

  --border: #e5e7eb;
  --border-light: #d1d5db;
}

[data-theme="light"] body {
  background: linear-gradient(135deg, var(--background) 0%, #f3f4f6 100%);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .dropdown-menu,
[data-theme="light"] .search-results {
  background: var(--card-bg);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .mega-menu {
    min-width: 500px;
    max-width: 600px;
  }
}

@media (max-width: 992px) {
  .search-container {
    min-width: 250px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .movies-grid,
  #filtered-movies {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .search-container {
    min-width: 200px;
  }

  .hero-section {
    height: 60vh;
    min-height: 400px;
    margin: 1rem 0.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-hero {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .section-title::after {
    left: 0;
    width: 60px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .movies-grid,
  #filtered-movies {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .movie-carousel {
    gap: 1rem;
  }

  .movie-card {
    min-width: 150px;
  }

  .mega-menu {
    min-width: 300px;
    max-width: 350px;
  }
}

@media (max-width: 576px) {
  body {
    padding-top: 70px;
  }

  .navbar {
    padding: 0.75rem 0;
  }

  .search-container {
    min-width: 180px;
  }

  .hero-content {
    padding: 2rem 1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .content-section {
    margin: 2rem 0.5rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .title-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .movies-grid,
  #filtered-movies {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .movie-card,
  #filtered-movies .movie-card {
    min-width: 140px;
  }

  .movie-card .card-img-top,
  #filtered-movies .movie-card .card-img-top {
    height: 200px;
  }

  .movie-card .card-body,
  #filtered-movies .movie-card .card-body {
    padding: 1rem;
  }

  .footer {
    padding: 2rem 0 1rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

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

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--glass-bg) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}