/* ═══════════════════════════════════════════════════════════════
   15.Barre de statut personnalisée (remplace la barre du navigateur)
   ═══════════════════════════════════════════════════════════════ */

@media (display-mode: fullscreen) {
  body {
    padding-top: env(safe-area-inset-top);
  }

  /* Cache les éléments système sur iOS */
  html {
    -webkit-tap-highlight-color: transparent;
  }
}

/* Pour Android */
@media (display-mode: standalone) {
  body {
    padding-top: 0;
  }
}


/* ==========================================
   1. VARIABLES CSS
   ========================================== */
:root {
  --primary-color: #ff5c8a;
  --secondary-color: #ff2e63;
  --tertiary-color: #b30047;
  --accent-color: #ff9ebf;
  --dark-bg: #121317;
  --home-bg: #ffb6c1;
  --neon-glow: 0 0 5px var(--primary-color), 0 0 15px var(--primary-color);
  --text-color: #ffffff;
  --bg-color: #0a0a12;
  --panel-bg: #12121f;
}


/* ==========================================
   2. RESET & BASE
   ========================================== */
   
/* Reset global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Style général de la page */
body {
  background-color: var(--home-bg);
  color: var(--text-color);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 5vh, 40px);
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: clamp(10px, 3vw, 20px);   
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
}

.header {
  padding-top: calc( env(safe-area-inset-top, 0px) + 8px );
}


/* ==========================================
   3. PANEL HEADER (Conteneur principal fixe)
   ========================================== */
   
.panel-header {
  background: rgba(23, 25, 35, 0.9);
  backdrop-filter: blur(10px);
  border-radius: clamp(15px, 4vw, 20px);
  padding: clamp(15px, 4vw, 20px) clamp(20px, 5vw, 30px);
  width: min(400px, 90vw);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(12px, 3vh, 15px);
  margin: 0 auto;
  position: fixed;
  padding-top: 20px;
  top: 30px;
}


/* ==========================================
   4. TITRE (h1 avec gradient animé)
   ========================================== */
   
.panel-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.0rem);
  font-weight: 600;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color),
    var(--tertiary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  text-align: center;
  width: 100%;
  background-size: 300%;
  animation: gradientShift 6s ease infinite;
}

/* QR Code dans le panel-header */
.qr-code-img {
  width: 150px;
  height: 150px;
  margin: 20px auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ==========================================
   5. SCENE TOGGLE (Conteneur des boutons)
   ========================================== */
   
.scene-toggle {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.5vh, 15px);
  width: 100%;
  align-items: stretch;
}


/* ==========================================
   6. BOUTONS (Log In, Create Account, etc.)
   ========================================== */
   
/* Styles communs pour tous les boutons d'action */
.scene-btn, .app-btn, .btn-primary {
  background: linear-gradient(145deg, #ff5c8a, #ff2e63);
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 0 #b30047,
              0 10px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
}

.scene-btn:hover, .app-btn:hover, .btn-primary:hover {
  box-shadow: 0 4px 0 #b30047,
              0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

.scene-btn:active, .app-btn:active, .btn-primary:active {
  box-shadow: 0 2px 0 #b30047,
              0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(4px);
}


/* ==========================================
   7. TOGGLE SETTINGS (Interrupteurs)
   ========================================== */
   
/* Conteneur du toggle */
.toggle-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(160px, 40vw);
  padding: clamp(10px, 2.5vw, 12px) clamp(12px, 3vw, 15px);
  margin-bottom: 15px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  transition: .3s;
  position: relative;
  overflow: hidden;
  font-family: 'Rajdhani', 'Orbitron', sans-serif;
  color: var(--text-color);
}

.toggle-setting:hover {
  background: rgba(0,0,0,0.5);
  box-shadow: 0 0 15px rgba(0,255,187,0.1);
}

/* Ligne néon au survol */
.toggle-setting::before {
  content: '';
  position: absolute;
  left: 0; 
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--primary-color);
  opacity: 0;
  transition: .3s;
}

.toggle-setting:hover::before {
  opacity: 1;
}

/* Textes du toggle */
.setting-title {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 600;
}

.setting-description {
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  opacity: .7;
  line-height: 1.3;
}

/* Switch container */
.toggle-switch {
  position: relative;
  width: min(60px, 15vw);
  height: min(30px, 7.5vw);
  margin-left: clamp(10px, 2.5vw, 15px);
}

/* Input masqué */
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  cursor: pointer;
}

/* Fond du switch */
.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  border-radius: 30px;
  transition: .4s cubic-bezier(0.68,-0.55,0.27,1.55);
  overflow: hidden;
}

/* Bouton rond du switch */
.toggle-slider:before {
  content: "";
  position: absolute;
  height: min(22px, 5.5vw);
  width: min(22px, 5.5vw);
  left: 4px; 
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: .4s cubic-bezier(0.68,-0.55,0.27,1.55);
  z-index: 2;
}

/* État ON */
input:checked + .toggle-slider {
  background-color: rgba(0,255,187,0.5);
}

input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

/* Effets circuits animés */
.circuit-lines { 
  opacity: 0; 
  transition: .3s; 
  pointer-events: none; 
}

.toggle-switch input:checked ~ .circuit-lines { 
  opacity: 1; 
}

/* Lignes animées */
.circuit-line {
  position: absolute;
  height: 1px;
  background: var(--primary-color);
  transform-origin: left center;
  box-shadow: var(--neon-glow);
  animation-duration: .5s;
  animation-fill-mode: both;
}

/* Positions des lignes */
.c-line-1 { 
  width: 10px; 
  top:10px; 
  left:4px; 
  transform:rotate(-45deg); 
  animation-name:circuit-animate-1; 
}

.c-line-2 { 
  width: 20px; 
  top:15px; 
  left:15px; 
  animation-name:circuit-animate-2; 
}

.c-line-3 { 
  width: 10px; 
  top:20px; 
  left:35px; 
  transform:rotate(45deg); 
  animation-name:circuit-animate-3; 
}

.c-line-4 { 
  width: 15px; 
  top:23px; 
  left:40px; 
  transform:rotate(-30deg); 
  animation-name:circuit-animate-4; 
}

/* Animations des circuits */
@keyframes circuit-animate-1 { 
  0%{transform:rotate(-45deg) scale(0);opacity:0;} 
  40%{transform:scale(1);opacity:1;} 
}

@keyframes circuit-animate-2 { 
  0%,40%{transform:scaleX(0);opacity:0;} 
  70%{transform:scaleX(1);opacity:1;} 
}

@keyframes circuit-animate-3 { 
  0%,60%{transform:rotate(45deg) scale(0);opacity:0;} 
  90%{transform:scale(1);opacity:1;} 
}

@keyframes circuit-animate-4 { 
  0%,70%{transform:rotate(-30deg) scale(0);opacity:0;} 
  100%{transform:scale(1);opacity:1;} 
}


/* ==========================================
   8. BOTTOM NAVIGATION (Nav fixe en bas)
   ========================================== */
   
.bottom-nav {
  position: fixed; 
  left: 0; 
  right: 0; 
  bottom: 0;
  height: 120px;
  background: #0d0d1c;
  display: flex; 
  justify-content: center; 
  align-items: center;
  padding-bottom: 5px;
  z-index: 999;
}

.nav-group { 
  display: flex; 
  gap: 46px; 
}

/* Items de navigation */
.nav-item {
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  color: #cdd2ff;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Boutons ronds de navigation (buzzers) */
.buzzer {
  width: 60px; 
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow:
    0 6px 0 #2a0038,
    0 8px 16px rgba(0,0,0,0.6),
    inset 0 4px 10px rgba(255,255,255,0.4);
  transition: 0.08s ease-in;
  border: 3px solid rgba(255,255,255,0.6);
}

.buzzer:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #2a0038,
    0 4px 10px rgba(0,0,0,0.6),
    inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Couleurs des buzzers par type */
.buzzer-home   { background: #ff5c8a; }
.buzzer-join   { background: #ffbe4d; }
.buzzer-create { background: #45d67f; }
.buzzer-prof   { background: #5e9bff; }

/* État actif (doré) */
.nav-item.active {
  color: #FFD700;
}

.nav-item.active .buzzer {
  border: 3px solid #FFD700;
  color: #FFD700;
  box-shadow:
    0 6px 0 #5c4200,
    0 8px 16px rgba(0,0,0,0.6),
    inset 0 4px 10px rgba(255,255,255,0.4);
}

/* État désactivé */
.nav-item.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
  user-select: none;
  color: rgba(205, 210, 255, 0.5);
}

.nav-item.disabled .buzzer {
  box-shadow: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(205, 210, 255, 0.5);
  border-color: rgba(205, 210, 255, 0.3);
}


/* ==========================================
   9. MODALS (Popups de Login/Create)
   ========================================== */
   
/* Overlay (fond sombre) */
.modal {
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Aligne le panneau en haut */
  padding-top: 30px;       /* Même hauteur que votre panel-header (top: 30px) */
  z-index: 1000;
  padding-left: clamp(10px, 3vw, 20px);
  padding-right: clamp(10px, 3vw, 20px);
  padding-bottom: clamp(10px, 3vw, 20px);
}

/* Boîte du modal */
.modal-box {
  background: rgba(23, 25, 35, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-radius: clamp(15px, 4vw, 20px);
  color: var(--text-color);
  width: min(400px, 90vw);
  padding: clamp(20px, 5vw, 25px) clamp(20px, 5vw, 30px);
  box-sizing: border-box;
  position: relative;
  animation: panelSlideIn 0.6s ease-out;
}

/* Titre des modals */
.modal-box h2 {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  margin-bottom: clamp(15px, 3vh, 20px);
  text-align: center;
  user-select: none;
}

/* Champs de saisie (inputs) */
.input {
  width: 100%;
  padding: clamp(10px, 2.5vw, 12px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: white;
  outline: none;
  box-sizing: border-box;
  margin-bottom: clamp(10px, 2.5vh, 15px);
  transition: border-color 0.25s, box-shadow 0.25s;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}

/* Bouton Cancel dans les modals */
.modal-box button.text-sm {
  color: #ffdb84 !important;
  background: transparent;
  border: none;
  font-size: clamp(0.8rem, 2.2vw, 0.9rem);
  width: 100%;
  cursor: pointer;
  margin-top: clamp(8px, 2vh, 10px);
  user-select: none;
}

.modal-box button.text-sm:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Popup Quick Play (si utilisé) */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: rgba(23,25,35,0.95);
  padding: clamp(20px, 5vw, 25px) clamp(20px, 5vw, 30px);
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  width: min(350px, 85vw);
  box-sizing: border-box;
}

.popup-content h2 {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: clamp(15px, 3vh, 20px);
  font-weight: 600;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  user-select: none;
}

/* Bouton close */
.close-btn {
  margin-top: clamp(8px, 2vh, 10px);
  color: #ffbdbd;
  font-size: clamp(0.8rem, 2.2vw, 0.9rem);
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
}

.close-btn:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Bouton Google (si activé) */
.btn-google {
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  padding: clamp(10px, 2.5vw, 12px) clamp(15px, 3.5vw, 20px);
  border-radius: 8px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Divider OR */
.divider {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.divider::before { left: 0; }
.divider::after { right: 0; }


/* ==========================================
   10. MEDIA QUERIES
   ========================================== */

/* Très petits mobiles (iPhone SE, etc.) */
@media (max-width: 320px) {
  .panel-header {
    width: 95vw;
    border-radius: 12px;
    padding: 12px 15px;
  }
  
  .panel-header h1 {
    font-size: 1.3rem;
  }
  
  .scene-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  
  .modal-box, .popup-content {
    width: 95vw;
    padding: 15px;
  }
}

/* Mobiles petits */
@media (max-width: 375px) {
  .panel-header {
    width: 92vw;
  }
  
  .nav-group {
    gap: 35px;
  }
  
  .buzzer {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
  
  .nav-item {
    font-size: 11px;
  }
}

/* Mobiles moyens */
@media (max-width: 428px) {
  .panel-header {
    width: 90vw;
  }
}

/* Tablettes */
@media (max-width: 768px) {
  .panel-header {
    width: 85vw;
    max-width: 350px;
  }
}

/* Écrans très hauts */
@media (max-height: 600px) {
  body {
    gap: 15px;
    padding: 8px;
  }
  
  .panel-header {
    gap: 10px;
    padding: 12px 20px;
  }
  
  .bottom-nav {
    height: 100px;
  }
}

/* Orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 5px;
    gap: 10px;
  }
  
  .panel-header {
    padding: 10px 15px;
    gap: 8px;
  }
  
  .scene-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  
  .bottom-nav {
    height: 80px;
  }
  
  .buzzer {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
}


/* ==========================================
   ⚠️ DOUBLONS / CODE À VÉRIFIER
   Ces styles sont répétés ou en conflit
   ========================================== */
