/* css/style.css - Styles globaux, variables, reset, typo, layout */

/* ============================================
   VARIABLES CSS - MODE CLAIR & SOMBRE
============================================ */
:root {
  --banner-height: 24px;
  --header-height: 50px;
  --nav-height: 54px;

  --primary: #0066cc;
  --secondary: #00a86b;
  --bg-main: #f8f9fa;
  --surface: #ffffff;
  --text-main: #1e2a3e;
  --text-secondary: #5a6874;
  --border: #e2e8f0;

  --dropdown-bg: #ffffff;
  --dropdown-item-border: #f1f5f9;
  --accordion-bg: #f8fafc;

  --scroll-thumb: rgba(100, 116, 139, 0.4);
  --transition-dropdown: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s ease;
}

[data-theme="dark"] {
  --primary: #3399ff;
  --secondary: #2ecc71;
  --bg-main: #0f172a;
  --surface: #1e293b;
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --border: #334155;

  --dropdown-bg: #1a1c1e;
  --dropdown-item-border: #2a2d30;
  --accordion-bg: #121415;
  --scroll-thumb: rgba(148, 163, 184, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Mobile : plein écran, aucun centrage, fond identique au container */
  background-color: var(--bg-main);
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* Desktop seulement : fond gris + cadre téléphone centré */
@media (min-width: 768px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #cbd5e1;
  }
}

[data-theme="dark"] body {
  background-color: var(--bg-main);
}

@media (min-width: 768px) {
  [data-theme="dark"] body {
    background-color: #020617;
  }
}



/* ============================================
   SCROLLBAR PERSONNALISÉE
============================================ */
::-webkit-scrollbar {
  width: 2px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
  border-radius: 6px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

/* ============================================
   APPLICATION CONTAINER — MOBILE FIRST
============================================ */
#app-container {
  /* Plein écran sur mobile : aucun max-width, aucune marge */
  width: 100%;
  max-width: 100%;
  /* Hauteur iOS-safe : svh = small viewport (exclut la barre Safari) */
  height: 100vh;
  height: 100svh;
  background-color: var(--bg-main);
  color: var(--text-main);
  position: relative;
  display: flex;
  flex-direction: column;
  /* Pas d'overflow:hidden en mobile — la bottom-nav est fixed */
  overflow-x: hidden;
  overflow-y: hidden;
}

/* Desktop : cadre téléphone centré */
@media (min-width: 768px) {
  #app-container {
    width: 430px;
    max-width: 430px;
    height: 850px;
    max-height: 90vh;
    border-radius: 32px;
    border: 8px solid var(--surface);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
  }
}

/* ============================================
   SCROLLABLE CONTENT
============================================ */
.scrollable-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1em 0.6em;
  /* Espace sous le contenu pour la bottom-nav fixée */
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 8px) + 8px);
}

@media (min-width: 768px) {
  .scrollable-content {
    /* Desktop : nav dans le flux normal, pas besoin de padding extra */
    padding-bottom: 1em;
  }
}

/* ============================================
   CARD
============================================ */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  animation: fadeInUp 0.5s ease;
}

.card h2 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.9rem;
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   OVERLAY
============================================ */
.menu-overlay {
  position: absolute;
  top: calc(var(--header-height) + var(--banner-height));
  bottom: var(--nav-height);
  left: 0;
  width: 15%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  transform: translateX(-100%);
  transition: var(--transition-dropdown);
}
.menu-overlay.active {
  transform: translateX(0);
}