/* ═══════════════════════════════════════════════
   SPOILME — responsive.css
   Corrections globales pour telephones
═══════════════════════════════════════════════ */

/* ── BASE : eviter le scroll horizontal ── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, video, iframe {
  max-width: 100%;
}

/* ── TABLETTE ─────────────────────────────── */
@media (max-width: 992px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .app-sidebar-left,
  .app-sidebar-right {
    display: none;
  }
  .app-feed {
    max-width: 100%;
    padding: 20px;
  }
}

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

  /* Espace pour la bottom-nav fixe */
  body {
    padding-bottom: 72px;
  }

  /* ── Navbar fix ── */
  .navbar {
    padding: 0 8px;
    gap: 4px;
    height: 56px;
    overflow: visible;
    max-width: 100vw;
  }
  .navbar__search {
    display: none;
  }
  .navbar__actions {
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
  }
  .navbar__logo {
    font-size: 1.1rem;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .navbar__logo-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  /* Cacher la cloche notif et le bouton deconnexion navbar */
  .notif-wrapper {
    display: none !important;
  }
  .navbar__logout-btn {
    display: none !important;
  }
  #notifPanel {
    display: none !important;
  }

  /* Theme toggle plus petit */
  .navbar__theme-toggle {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  /* Avatar navbar plus petit */
  .navbar .avatar-sm {
    width: 28px;
    height: 28px;
  }

  /* Language switcher compact dans navbar */
  .lang-switcher {
    gap: 2px !important;
  }
  .lang-switcher .lang-btn {
    padding: 2px 6px !important;
    font-size: 9px !important;
    border-radius: 9999px;
  }

  /* ── FAB ── */
  .fab {
    bottom: 80px;
    right: var(--space-md);
  }

  /* ── Modal full-screen ── */
  .modal {
    padding: var(--space-lg);
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }
  .modal-overlay {
    align-items: flex-end;
  }

  /* ── Cards ── */
  .card__body {
    padding: var(--space-md);
  }
  .card {
    border-radius: var(--radius-lg);
  }

  /* ── Boutons ── */
  .btn-lg {
    padding: 12px var(--space-lg);
    font-size: var(--text-sm);
  }

  /* ── Filter tabs ── */
  .filter-tabs {
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
  }

  /* ── Action bar ── */
  .action-bar {
    gap: 2px;
  }
  .action-btn {
    padding: 6px 8px;
    font-size: var(--text-xs);
  }

  /* ── App feed ── */
  .app-feed {
    padding: 12px;
  }

  /* ── Feed layout global ── */
  .feed-layout {
    grid-template-columns: 1fr !important;
    padding: 8px 8px 80px !important;
    gap: 8px !important;
    max-width: 100vw !important;
    width: 100% !important;
    overflow: hidden;
  }
  .left-sidebar,
  .right-sidebar {
    display: none !important;
  }
  .feed-main {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  /* ── CineRooms ── */
  .rooms-layout {
    grid-template-columns: 1fr !important;
    padding: var(--space-sm) !important;
  }
  .rooms-hero {
    padding: var(--space-xl) var(--space-sm) !important;
  }
  .rooms-hero h1 {
    font-size: var(--text-2xl) !important;
  }
  .room-card__header {
    gap: var(--space-sm);
  }
  .room-card__cover {
    width: 48px;
    height: 48px;
  }
  .room-card__title {
    font-size: var(--text-sm);
  }
  .room-card__footer {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  .room-controls {
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding: var(--space-sm);
  }
  .ctrl-btn {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }
  .speakers-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: var(--space-sm);
  }
  .speaker-slot__avatar {
    width: 42px;
    height: 42px;
  }
  .room-chat__messages {
    height: 200px;
  }

  /* ── Mobile sidebar drawer ── */
  .mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 4, 7, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .mobile-sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
  }
  .mobile-sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    padding: var(--space-lg) var(--space-md);
  }
  .mobile-sidebar-overlay.open .mobile-sidebar-drawer {
    transform: translateX(0);
  }
  .mobile-sidebar-drawer .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-lg);
  }
  .mobile-sidebar-drawer .nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px var(--space-md);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    background: none;
    border: none;
    font-family: var(--font-sans);
    width: 100%;
    text-align: left;
  }
  .mobile-sidebar-drawer .nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }
  .mobile-sidebar-drawer .nav-item.active {
    background: rgba(122, 41, 66, 0.2);
    color: var(--color-creme);
    font-weight: 600;
  }

  /* ── Hamburger button ── */
  .navbar__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
  }
  .navbar__hamburger:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  /* ── Post page layout mobile ── */
  .layout {
    grid-template-columns: 1fr !important;
    padding: 12px !important;
    max-width: 100vw !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  .layout > div:first-child {
    min-width: 0 !important;
    overflow: hidden !important;
    width: 100% !important;
  }
  .layout > aside {
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
  .post-hero {
    max-width: 100vw !important;
    overflow: hidden !important;
  }
  .hero-body {
    padding: 40px 12px 20px !important;
    gap: 14px !important;
  }
  .post-action-bar-wrap {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .post-action-bar-right {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* ── Debat page layout mobile ── */
  .debat-layout {
    grid-template-columns: 1fr !important;
    padding: var(--space-md) !important;
    max-width: 100vw !important;
    width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .debat-layout > div {
    min-width: 0;
    overflow: hidden;
    width: 100%;
  }
  .debat-hero {
    max-width: 100vw;
    overflow: hidden;
  }
  .vote-arena {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ── Widget sidebar mobile ── */
  .widget {
    margin-bottom: var(--space-md);
  }

  /* ── Bottom nav ── */
  .bottom-nav__item {
    font-size: 10px;
    gap: 2px;
    padding: 6px 4px;
  }
  .bottom-nav__item span:first-child {
    font-size: 20px;
  }
}

/* ── TRES PETIT MOBILE (< 480px) ─────────── */
@media (max-width: 480px) {

  :root {
    --navbar-height: 50px;
  }

  .navbar {
    height: 50px;
    padding: 0 6px;
  }

  .navbar__logo {
    font-size: 1rem;
    gap: 3px;
  }
  .navbar__logo-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .navbar__logo span {
    /* Masquer "Me" sur tres petit ecran pour gagner de la place */
  }

  .navbar .avatar-sm {
    width: 26px;
    height: 26px;
  }

  .navbar__theme-toggle {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .navbar__hamburger {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  /* Lang switcher encore plus compact */
  .lang-switcher .lang-btn {
    padding: 2px 5px !important;
    font-size: 8px !important;
  }

  /* Bottom-nav labels plus petits */
  .bottom-nav__item {
    font-size: 9px;
    gap: 2px;
    padding: 4px 2px;
  }
  .bottom-nav__item span:first-child {
    font-size: 18px;
  }

  /* Cards */
  .card__title {
    font-size: var(--text-lg);
  }

  /* Feed specifics */
  .feed-layout {
    padding: 4px 4px 80px !important;
  }

  /* Post page - tres petit ecran */
  .layout {
    padding: 8px !important;
  }
  .hero-body {
    padding: 30px 8px 16px !important;
  }

  /* CineRooms specifics */
  .rooms-hero h1 {
    font-size: var(--text-xl) !important;
  }
  .room-active {
    padding: var(--space-sm);
  }
  .room-active__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .ctrl-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .room-controls {
    gap: 4px;
  }
}

/* ── Desktop: hide hamburger ── */
@media (min-width: 769px) {
  .navbar__hamburger {
    display: none !important;
  }
  .mobile-sidebar-overlay {
    display: none !important;
  }
}
