/* ============================================
   VOXWEN - CSS RESPONSIVE GLOBAL
   Gestion mobile, tablette, desktop
   ============================================ */

/* ── RESET & BASE ─────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

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

/* ── VARIABLES ────────────────────────────── */
:root {
  --primary: #2563eb;
  --accent: #7c3aed;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f8faff;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ── LAYOUT HELPERS ───────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── GRILLES RESPONSIVE ───────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* ── SECTIONS ─────────────────────────────── */
.section {
  padding: 80px 20px;
}

.section-sm {
  padding: 48px 20px;
}

/* ── BOUTONS ──────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.2s;
  padding: 12px 24px;
  font-size: 15px;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.2s;
  padding: 12px 24px;
  font-size: 15px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #fff;
}

/* ── CARDS ────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* ── SIDEBAR DASHBOARD ────────────────────── */
.dashboard-sidebar {
  width: 230px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  flex-shrink: 0;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.sidebar-link:hover {
  background: #eff6ff;
  color: var(--primary);
}

.sidebar-link.active {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 700;
}

/* ── NAVIGATION ───────────────────────────── */
.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
  background: none;
  padding: 6px 0;
  border: none;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary);
}

/* ── BADGES ───────────────────────────────── */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

.badge-blue { background: #dbeafe; color: var(--primary); }
.badge-purple { background: #ede9fe; color: var(--accent); }
.badge-green { background: #d1fae5; color: var(--success); }
.badge-orange { background: #fef3c7; color: #f59e0b; }

/* ── ANIMATIONS ───────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s ease forwards;
}

.hero-gradient {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 50%, #fdf4ff 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── MOBILE BOTTOM NAV ────────────────────── */
.mobile-bottom-nav { display: none; }

/* ============================================
   TABLETTE (769px - 1024px)
   ============================================ */
@media (max-width: 1024px) and (min-width: 769px) {
  .container { padding: 0 20px; }
  .container-sm { padding: 0 20px; }
  .section { padding: 60px 20px; }
  .section-sm { padding: 40px 20px; }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dashboard-sidebar {
    width: 180px !important;
  }

  nav {
    padding: 0 20px;
  }
}

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

  /* Layout */
  .container, .container-sm {
    padding: 0 16px !important;
    max-width: 100% !important;
  }

  .section { padding: 40px 16px !important; }
  .section-sm { padding: 28px 16px !important; }

  /* Grilles → 1 colonne */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Forcer 1 colonne sur tous les grids inline */
  [style*="grid-template-columns: repeat"] {
    grid-template-columns: 1fr !important;
  }

  [style*="gridTemplateColumns: \"repeat"] {
    grid-template-columns: 1fr !important;
  }

  [style*="gridTemplateColumns: \"1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  [style*="gridTemplateColumns: \"2fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Flex wrap */
  [style*="display: \"flex\""][style*="gap:"] {
    flex-wrap: wrap !important;
  }

  /* Cacher order sur mobile */
  [style*="order: 0"], [style*="order: 1"] {
    order: unset !important;
  }

  /* Réduire les paddings larges */
  [style*="padding: \"60px 40px\""] { padding: 32px 16px !important; }
  [style*="padding: \"80px 20px\""] { padding: 40px 16px !important; }
  [style*="padding: \"100px 20px\""] { padding: 48px 16px !important; }

  /* Réduire les gaps */
  [style*="gap: 60"] { gap: 24px !important; }
  [style*="gap: 40"] { gap: 20px !important; }

  /* Cards */
  .card { padding: 20px !important; }

  /* Boutons */
  .btn-primary, .btn-secondary, .btn-white {
    padding: 12px 20px !important;
    font-size: 14px !important;
    width: 100% !important;
    text-align: center !important;
  }

  /* Navigation desktop cachée */
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  /* Dashboard */
  .dashboard-sidebar { display: none !important; }
  .dashboard-content { padding: 16px !important; padding-bottom: 80px !important; }

  /* Mobile bottom nav */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-bottom-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 4px;
    background: none;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
  }

  .mobile-bottom-btn.active { color: var(--primary); }

  /* Textes */
  h1 { font-size: clamp(24px, 7vw, 36px) !important; letter-spacing: -0.5px !important; }
  h2 { font-size: clamp(20px, 5vw, 28px) !important; }
  h3 { font-size: clamp(16px, 4vw, 22px) !important; }

  /* Images */
  img { max-width: 100% !important; height: auto !important; }

  /* Tableaux */
  table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Formulaires */
  input, textarea, select {
    width: 100% !important;
    font-size: 16px !important; /* Evite zoom iOS */
  }

  /* Largeurs fixes → 100% */
  [style*="width: 220"], [style*="width: 230"], [style*="width: 300"],
  [style*="width: 380"], [style*="width: 400"], [style*="width: 500"] {
    width: 100% !important;
    min-width: unset !important;
  }

  /* Min-widths */
  [style*="minWidth: 400"], [style*="minWidth: 500"], [style*="minWidth: 600"],
  [style*="minWidth: 300"], [style*="minWidth: 200"] {
    min-width: unset !important;
  }

  /* Nav */
  nav { padding: 0 16px !important; height: 60px !important; }

  /* Hero sections */
  [style*="padding: \"80px 20px 100px\""] { padding: 48px 16px 60px !important; }
}

/* ============================================
   DESKTOP (min 1025px)
   ============================================ */
@media (min-width: 1025px) {
  .mobile-only { display: none !important; }
}
