/* ========================================
   RESPONSIVE.CSS — Mobile & Tablette
   ======================================== */

/* ========================================
   TABLETTE (max-width: 1024px)
   ======================================== */
@media (max-width: 1024px) {
  .side-panel {
    width: 280px;
  }
}

/* ========================================
   MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {

  /* ===== PAGE D'ACCUEIL ===== */
  .home-layout {
    flex-direction: column-reverse;
  }
  .form-column, .info-column {
    width: 100%;
    max-width: 100%;
    padding: 2rem 1rem;
  }
  .info-column { text-align: center; }
  .info-column .feature-card {
    flex-direction: column;
    text-align: center;
  }
  .info-column .feature-icon {
    margin: 0 auto 1.5rem;
  }
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .hero-title { font-size: 2.2rem; }

  /* Navbar accueil compact */
  .navbar { padding: 0.75rem 1rem; }
  .brand-sub { display: none; }
  .nav-actions .connection-badge span:last-child { display: none; }

  /* ===== ROOM PAGE ===== */
  .room-page {
    height: 100dvh;
    overflow: hidden;
  }

  /* ===== HEADER — CORRECTION BOUTON NOTES =====
     Le problème : les boutons avaient du texte qui débordait.
     Solution : icône seule, hauteur fixe, espacement minimal. */
  .room-header {
    padding: 0.4rem 0.6rem;
    min-height: 50px;
    gap: 0.25rem;
  }

  .room-header-left {
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
  }

  .room-id { display: none; }

  .room-meta {
    font-size: 0.7rem;
    gap: 0.4rem;
  }

  .share-badge span { display: none; }

  .room-header-right {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }

  /* CORRECTION PRINCIPALE : tous les boutons header deviennent
     de petits carrés avec icône seule — plus de texte sur mobile */
  .btn-header-tab {
    padding: 0;
    width: 36px;
    height: 36px;
    font-size: 0;          /* masque tout texte résiduel */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 36px;
    flex-shrink: 0;
  }

  /* Texte explicitement masqué */
  .btn-header-tab span { display: none; }

  /* Icône visible et correctement dimensionnée */
  .btn-header-tab i {
    font-size: 0.9rem;
    display: block;
  }

  .btn-icon {
    padding: 6px;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  /* ===== ROOM LAYOUT ===== */
  .room-layout {
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    position: relative;
    flex: 1;
    min-height: 0;
  }

  .video-area {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 0.4rem;
  }

  /* ===== PANNEAU LATÉRAL — Glisse depuis le bas ===== */
  .side-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72%;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: none;
    border-top: 1px solid var(--border-light);
    border-radius: 16px 16px 0 0;
    z-index: 20;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
  }

  .dark-mode .side-panel {
    border-top-color: var(--border-dark);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  }

  /* Indicateur drag en haut du panneau */
  .side-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 8px auto 4px;
    flex-shrink: 0;
  }

  .dark-mode .side-panel::before {
    background: var(--border-dark);
  }

  .side-panel.open {
    transform: translateY(0);
  }

  .panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .participants-list,
  .chat-messages {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ===== FOOTER — Barre de contrôles ===== */
  .room-footer {
    padding: 0.4rem 0.25rem;
    flex-shrink: 0;
    background-color: var(--surface-light);
    border-top: 1px solid var(--border-light);
  }
  .dark-mode .room-footer {
    background-color: var(--surface-dark);
    border-top-color: var(--border-dark);
  }

  .controls-bar {
    flex-wrap: nowrap;
    justify-content: space-evenly;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .controls-bar::-webkit-scrollbar { display: none; }

  .ctrl-btn {
    width: 42px;
    height: 42px;
    font-size: 0.95rem;
    flex-shrink: 0;
  }

  .react-wrapper { flex-shrink: 0; }

  /* ===== ÉCRAN DE PARTAGE ===== */
  .screen-share-label {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
    gap: 0.4rem;
  }
  .screen-share-avatar { width: 22px; height: 22px; font-size: 0.7rem; }
  .live-badge { font-size: 0.62rem; }
  .expand-btn { width: 32px; height: 32px; top: 0.4rem; right: 0.4rem; }
  .screen-placeholder i { font-size: 2.5rem; margin-bottom: 0.75rem; }
  .screen-placeholder p { font-size: 0.82rem; }

  /* ===== CHAT ===== */
  .chat-input-container { padding: 0.5rem; gap: 0.35rem; }
  .attach-btn, .send-btn { width: 36px; height: 36px; flex-shrink: 0; }
  #chatInput { font-size: 0.875rem; padding: 0.45rem 0.55rem; }

  /* ===== PARTICIPANTS ===== */
  .participant-card { padding: 7px 9px; }

  /* Sur mobile (pas de hover disponible) : barre admin toujours visible */
  .admin-action-bar { display: flex !important; }

  .admin-btn span { display: none; }
  .admin-btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
  }

  /* ===== NOTES PANEL ===== */
  .notes-panel {
    width: 100vw;
    right: -100vw;
    border-radius: 0;
  }

  /* ===== MODALS ===== */
  .modal-content,
  .notification-content {
    width: 95%;
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }
  .modal-buttons,
  .notification-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  .modal-buttons button,
  .notification-buttons button {
    width: 100%;
    justify-content: center;
  }

  /* ===== NOTIFICATIONS FLOTTANTES ===== */
  .hand-raised-notif {
    bottom: 70px;
    left: 0.75rem;
    right: 0.75rem;
    transform: none;
    min-width: unset;
  }

  .mic-allowed-banner {
    left: 0.75rem;
    right: 0.75rem;
    transform: none;
    top: 58px;
  }

  .alert {
    left: 0.75rem;
    right: 0.75rem;
    transform: none;
    min-width: unset;
  }
  .alert.show { transform: none; }

  /* ===== RÉACTIONS ===== */
  .reactions-picker {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ========================================
   SAFE AREA — iPhone encoche / home bar
   ======================================== */
@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    .room-footer {
      padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    }
    .room-header {
      padding-top: max(0.4rem, env(safe-area-inset-top));
    }
    .side-panel {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}
