/* Réinitialisation globale et blocage du scroll pour TV */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Supprime radicalement les barres de scroll */
  background-color: #121212; /* Évite l'apparition de fond blanc en cas de redimensionnement */
}

/* Ton conteneur existant ajusté */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background-color: #121212;
  color: #ffffff;
  font-family: sans-serif;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #121212;
  color: #ffffff;
  font-family: sans-serif;
}

.login-form {
  width: 400px;
  padding: 30px;
  background-color: #1e1e1e;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.login-title {
  text-align: center;
  margin-bottom: 20px;
}

.login-error {
  background-color: #cf6679;
  color: #000000;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
  font-weight: bold;
}

.input-group {
  margin-bottom: 15px;
}

.input-label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.login-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 4px;
  border: 2px solid #333;
  background-color: #2d2d2d;
  color: #fff;
  box-sizing: border-box;
  outline: none;
}

/* Essentiel pour la navigation à la télécommande */
.login-input:focus, .login-button:focus {
  border-color: #bb86fc;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.3);
}

.login-button {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  background-color: #bb86fc;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

.login-button:disabled {
  background-color: #555;
  cursor: not-allowed;
}/* src/components/Home.css */
.home-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  background-color: #09090b;
  color: #ffffff;
  display: flex;
  flex-direction: row;
  user-select: none;
  overflow: hidden;
  font-family: sans-serif;
}

/* --- OVERLAY MOBILE --- */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 40;
}

/* --- SIDEBAR --- */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  width: 288px;
  background-color: #18181b;
  border-right: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: transform 0.2s ease-out;
  transform: translateX(-100%);
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

@media (min-width: 768px) {
  .sidebar {
    position: static;
    transform: translateX(0);
  }
  .sidebar-overlay,
  .mobile-only {
    display: none !important;
  }
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #27272a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: #818cf8;
  margin: 0;
  display: flex;
  align-items: center;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Masquer les barres de scroll tout en gardant le défilement */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tab-button, .category-button {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 6px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Force l'alignement horizontal sur Chromium 63 */
  background: none;
  border: 1px solid transparent; /* Bordure transparente par défaut pour éviter les sauts de hauteur */
  color: #a1a1aa;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
  box-sizing: border-box;
  min-height: 44px; /* Hauteur fixe minimale pour garantir un centrage vertical parfait */
}

.tab-button:hover, .category-button:hover {
  background-color: #27272a;
  color: #ffffff;
}

.tab-button.active {
  background-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.category-button.active {
  background-color: #27272a;
  color: #ffffff;
  border-left: 4px solid #6366f1;
  padding-left: 13px; /* 16px - 3px (pour compenser l'épaisseur de la bordure gauche sans décaler le texte) */
}

.category-section-title {
  font-size: 11px;
  font-weight: bold;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 12px;
  margin: 16px 0 8px 0;
}

/* --- ZONE PRINCIPALE --- */
.main-content {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #09090b;
}

.main-header {
  height: 80px;
  border-bottom: 1px solid #18181b;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background-color: #09090b;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .main-header { padding: 0 32px; }
}

.header-left {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 100%;
}

.menu-toggle-btn {
  margin-right: 12px;
  padding: 10px;
  background-color: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
}

.search-container {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #71717a;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background-color: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 8px 32px 8px 38px;
  font-size: 14px;
  color: #ffffff;
  box-sizing: border-box;
  outline: none;
}

.search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  padding: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.user-badge {
  font-size: 14px;
  font-weight: 600;
  color: #a1a1aa;
  margin-right: 16px;
}

@media (max-width: 1023px) {
  .user-badge { display: none; }
}

.logout-btn {
  padding: 8px 14px;
  background-color: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: #f87171;
  cursor: pointer;
  transition: background-color 0.15s;
}

.logout-btn:hover {
  background-color: #27272a;
  color: #fca5a5;
}

/* --- GRILLE DU CATALOGUE --- */
.grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .grid-container { padding: 32px; }
}

.error-box {
  padding: 16px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  color: #f87171;
  font-size: 14px;
  margin-bottom: 24px;
}

.empty-state {
  height: 288px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #71717a;
  border: 1px dashed #27272a;
  border-radius: 24px;
}

/* Système Flexbox en pourcentages (0% CSS Grid pour compatibilité TV) */
.flex-grid {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.card-wrapper-vod {
  width: 48%;
  margin: 1%;
}
@media (min-width: 640px) { .card-wrapper-vod { width: 31.33%; margin: 1%; } }
@media (min-width: 768px) { .card-wrapper-vod { width: 23%; margin: 1%; } }
@media (min-width: 1024px) { .card-wrapper-vod { width: 18%; margin: 1%; } }
@media (min-width: 1280px) { .card-wrapper-vod { width: 14.66%; margin: 1%; } }

.card-wrapper-live {
  width: 98%;
  margin: 1%;
}
@media (min-width: 640px) { .card-wrapper-live { width: 48%; margin: 1%; } }
@media (min-width: 1024px) { .card-wrapper-live { width: 31.33%; margin: 1%; } }
@media (min-width: 1400px) { .card-wrapper-live { width: 23%; margin: 1%; } }

/* Hack Aspect-Ratio compatible Chromium 63 (avant Chrome 88) */
.card-item {
  position: relative;
  width: 100%;
  background-color: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  padding: 0;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s;
  will-change: transform;
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
}

.card-wrapper-vod .card-item {
  padding-bottom: 150%; /* Ratio 2:3 (VOD / Séries) */
}

.card-wrapper-live .card-item {
  padding-bottom: 56.25%; /* Ratio 16:9 (Live TV) */
}

/* Focus Télécommande et Hover */
.focusable:focus, .card-item:hover, .card-item:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4);
  transform: scale(1.02);
  z-index: 10;
}

.card-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-wrapper-live .card-image {
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
}

.card-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #52525b;
  font-size: 10px;
  font-weight: bold;
}

.card-rating {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  background-color: #000000;
  color: #facc15;
  border: 1px solid #27272a;
  z-index: 5;
}

.card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgb(9, 9, 11) 0%, rgba(9, 9, 11, 0.9) 60%, transparent 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 5;
  transition: opacity 0.15s;
}

.card-wrapper-vod .card-overlay {
  opacity: 0.9;
}

.card-item:hover .card-overlay, .card-item:focus .card-overlay {
  opacity: 1;
}

.card-title {
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* --- CHARGEMENT & SENTINEL --- */
.sentinel-container {
  width: 100%;
  padding: 32px 0;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-pill {
  display: flex;
  align-items: center;
  background-color: #18181b;
  padding: 10px 20px;
  border-radius: 9999px;
  border: 1px solid #27272a;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
}

.spinner {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  border: 2px solid #6366f1;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.end-catalog-text {
  font-size: 12px;
  color: #52525b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- PANNEAU LATÉRAL DROIT (DÉTAILS MÉDIA) --- */
.details-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 55;
  width: 340px;
  max-width: 85vw;
  background-color: #18181b;
  border-left: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px -10px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease-out;
  transform: translateX(100%);
}

.details-panel.open {
  transform: translateX(0);
}

.details-header {
  padding: 16px 20px;
  border-bottom: 1px solid #27272a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.details-close-btn {
  background: #27272a;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.details-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.details-image-container {
  width: 100%;
  max-height: 220px;
  background-color: #09090b;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.details-image {
  width: 100%;
  height: 220px;
  object-fit: contain;
}

.details-title {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.details-meta {
  font-size: 12px;
  color: #a1a1aa;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.details-synopsis {
  font-size: 13px;
  color: #d4d4d8;
  line-height: 1.6;
  margin-bottom: 24px;
  flex: 1;
}

/* Grille Flexbox sans "gap" pour les boutons d'action */
.details-actions {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #27272a;
}

.btn-action {
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  transition: transform 0.15s, background-color 0.15s;
  box-sizing: border-box;
}

.btn-play {
  width: 58%;
  margin-right: 4%;
  background-color: #4f46e5;
  color: #ffffff;
}

.btn-fav {
  width: 38%;
  margin-right: 0;
  background-color: #27272a;
  color: #ffffff;
  border-color: #3f3f46;
}

.btn-action:hover, .btn-action:focus, .details-close-btn:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4);
  transform: scale(1.03);
  z-index: 10;
}

/* --- LECTEUR VIDÉO OVERLAY --- */
.video-player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #000000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.video-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 32px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 101;
  pointer-events: auto;
}

.video-title {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
}

.video-close-btn {
  padding: 8px 16px;
  background-color: rgba(39, 39, 42, 0.8);
  border: 1px solid #52525b;
  border-radius: 8px;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.web-video-player, .tizen-avplayer {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #000000;
}