:root {
  --bg-color: #090a0f;
  --card-bg: #12141d;
  --text-main: #ffffff;
  --text-muted: #a0a5b5;
  --accent-color: #3b82f6;
  --glass-bg: rgba(20, 24, 38, 0.65);
  --glass-border: rgba(255, 255, 255, 0.12);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); overflow-x: hidden; }

/* Navbar */
.navbar-container { position: fixed; top: 20px; left: 0; right: 0; display: flex; justify-content: center; z-index: 1000; padding: 0 20px; }
.navbar { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 40px; padding: 10px 24px; display: flex; align-items: center; gap: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.logo { font-size: 1.5rem; color: var(--accent-color); }
.nav-links { display: flex; gap: 8px; }
.nav-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 500; transition: all 0.3s; display: flex; align-items: center; gap: 6px; }
.nav-btn.active, .nav-btn:hover { background: rgba(255, 255, 255, 0.15); color: var(--text-main); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Dynamic Search Bar */
.search-box { position: relative; display: flex; align-items: center; background: rgba(0, 0, 0, 0.3); border-radius: 20px; padding: 4px 12px; border: 1px solid var(--glass-border); }
.search-box input { background: transparent; border: none; outline: none; color: #fff; width: 140px; transition: width 0.3s ease; }
.search-box input:focus { width: 200px; }
.search-box button { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; }

.search-results-dropdown { position: absolute; top: calc(100% + 12px); right: 0; width: 320px; max-height: 400px; overflow-y: auto; background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); backdrop-filter: blur(16px); z-index: 1100; padding: 8px; }
.search-results-dropdown::-webkit-scrollbar { width: 6px; }
.search-results-dropdown::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }

.search-result-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; cursor: pointer; transition: background 0.2s ease; }
.search-result-item:hover { background: rgba(255, 255, 255, 0.1); }
.search-result-item img { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.search-result-info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.search-result-title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Hero */
.hero-section { position: relative; height: 75vh; min-height: 480px; display: flex; align-items: flex-end; padding: 60px; }
.hero-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; transition: background-image 0.8s ease; z-index: 1; }
.hero-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(9,10,15,0.2) 0%, rgba(9,10,15,0.95) 100%), linear-gradient(90deg, rgba(9,10,15,0.9) 0%, rgba(9,10,15,0) 70%); z-index: 2; }
.hero-content { position: relative; z-index: 3; max-width: 600px; margin-bottom: 20px; }
.hero-content h1 { font-size: 3rem; margin-bottom: 12px; text-transform: uppercase; }
.hero-meta { display: flex; gap: 15px; align-items: center; margin-bottom: 16px; color: var(--text-muted); }
.hero-meta .rating { color: #f59e0b; }
.genre-badge { background: rgba(255,255,255,0.1); padding: 2px 10px; border-radius: 12px; font-size: 0.85rem; }
.hero-content p { color: var(--text-muted); line-height: 1.5; margin-bottom: 24px; }
.hero-buttons { display: flex; gap: 12px; }
.btn { padding: 12px 24px; border-radius: 24px; border: none; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.2s; }
.btn:hover { transform: scale(1.03); }
.btn-primary { background: #fff; color: #000; }
.btn-large { padding: 16px 32px; font-size: 1.1rem; }
.btn-secondary { background: rgba(255, 255, 255, 0.2); color: #fff; backdrop-filter: blur(10px); }
.hero-dots { position: absolute; right: 40px; bottom: 40px; z-index: 3; display: flex; gap: 8px; }
.dot { width: 8px; height: 8px; background: rgba(255,255,255,0.4); border-radius: 50%; cursor: pointer; }
.dot.active { background: #fff; width: 20px; border-radius: 10px; }

/* Providers */
.providers-section { padding: 20px 60px; }
.providers-section h3 { margin-bottom: 16px; font-size: 1.1rem; }
.providers-grid { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.providers-grid::-webkit-scrollbar { display: none; }
.provider-card { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 10px 18px; display: flex; align-items: center; gap: 12px; min-width: 160px; cursor: pointer; flex-shrink: 0; transition: all 0.3s; }
.provider-card:hover, .provider-card.active { border-color: var(--accent-color); transform: translateY(-4px); background: rgba(59, 130, 246, 0.15); }
.provider-card img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }

/* Main Rows */
.main-content { padding: 20px 60px; }
.content-row { margin-bottom: 40px; }
.row-header h2 { font-size: 1.4rem; margin-bottom: 16px; }
.row-container { position: relative; display: flex; align-items: center; }
.cards-row { display: flex; gap: 20px; overflow-x: auto; scroll-behavior: smooth; padding: 10px 0; width: 100%; }
.cards-row::-webkit-scrollbar { display: none; }
.media-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; position: relative; cursor: pointer; flex: 0 0 200px; transition: transform 0.3s, box-shadow 0.3s; }
.media-card:hover { transform: scale(1.05); box-shadow: 0 10px 25px rgba(0,0,0,0.6); z-index: 10; }
.media-card img { width: 100%; height: 300px; object-fit: cover; display: block; }
.media-info { padding: 12px; }
.media-info h4 { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Scroll Arrows */
.scroll-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, 0.7); border: 1px solid var(--glass-border); color: #fff; font-size: 1.2rem; cursor: pointer; z-index: 20; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.scroll-arrow:hover { background: rgba(59, 130, 246, 0.8); }
.left-arrow { left: -22px; }
.right-arrow { right: -22px; }

/* Details Page */
#details-view { position: relative; min-height: 100vh; padding-top: 100px; padding-bottom: 60px; }
.details-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; opacity: 0.25; filter: blur(20px); z-index: -2; }
.details-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(9,10,15,0.7) 0%, rgba(9,10,15,1) 100%); z-index: -1; }
.details-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.back-btn { margin-bottom: 24px; }
.details-header { display: flex; gap: 40px; align-items: flex-start; margin-bottom: 40px; }
.detail-poster-img { width: 280px; border-radius: var(--radius); box-shadow: 0 15px 30px rgba(0,0,0,0.8); border: 1px solid var(--glass-border); }
.detail-info-content { flex: 1; }
.detail-info-content h1 { font-size: 2.8rem; margin-bottom: 16px; }
.detail-synopsis { font-size: 1.05rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 24px; }

/* Series Selectors */
.series-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  background: var(--glass-bg);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  width: fit-content;
}

.select-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Style du menu déroulant */
.select-group select {
  background: #12141d; /* Fond sombre défini pour éviter les conflits */
  color: #ffffff;      /* Texte blanc pour l'élément sélectionné */
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
}

/* Correctif pour les options du menu déroulant */
.select-group select option {
  background-color: #12141d; /* Fond sombre pour la liste déroulante */
  color: #ffffff;            /* Texte blanc visible */
  padding: 10px;
}

/* Player Wrapper */
.player-wrapper { margin-top: 40px; background: var(--card-bg); padding: 24px; border-radius: var(--radius); border: 1px solid var(--glass-border); }
.player-wrapper h3 { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.iframe-container { position: relative; padding-bottom: 56.25%; height: 0; }
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 12px; }

/* Utility */
.hidden { display: none !important; }

/* Style pour la grille complète du catalogue (Films / Séries) */
.cards-row.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  overflow-x: visible;
  padding: 10px 0;
}