/* app.css – Version modernisée d'AntibioGuide */

/* === RESET & VARIABLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2c7a3e;
  --primary-dark: #1f5c2e;
  --primary-light: #e6f4e8;
  --secondary: #2c6e9e;
  --accent: #f4b942;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --drawer-w: 280px;
  --app-max: 450px;
  --header-h: 64px;
  --radius: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03), 0 4px 8px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #eef2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: var(--app-max);
  height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 8px 30px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  border-radius: 28px;
}

/* Offline */
#offline-notice {
  background: #f97316;
  color: white;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  padding: 6px;
  display: none;
  flex-shrink: 0;
}

/* Overlay */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}
#overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* === DRAWER (moderne) === */
#drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--drawer-w);
  height: 100%;
  background: var(--surface);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  display: flex;
  flex-direction: column;
  border-right: none;
  box-shadow: 2px 0 20px rgba(0,0,0,0.05);
}
#drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 28px 20px 24px;
  background: linear-gradient(135deg, #f0f9f0 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
}

.drawer-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-hero-icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  box-shadow: 0 6px 12px rgba(44,122,62,0.2);
}

.drawer-hero-info {
  flex: 1;
}

.drawer-hero-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.drawer-hero-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-version-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 40px;
  margin-top: 12px;
  display: inline-block;
}

.drawer-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px;
  margin-bottom: 4px;
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.15s;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-item-icon {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s;
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.nav-item.active .nav-item-icon {
  background: var(--primary);
  color: white;
}

.nav-item-label {
  flex: 1;
  font-size: 14px;
}

.nav-separator {
  height: 1px;
  background: var(--border);
  margin: 16px 12px;
}

.drawer-footer {
  padding: 16px 20px 24px;
  font-size: 11px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  line-height: 1.5;
  background: #fefefe;
}

/* === HEADER === */
#header {
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226,232,240,0.7);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 50;
}

#menu-btn {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border: none;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

#menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: all 0.2s;
}

#menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#menu-btn.open span:nth-child(2) {
  opacity: 0;
}
#menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header-text {
  flex: 1;
}

#header-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.3px;
}

#header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-app-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: 0 4px 8px rgba(44,122,62,0.2);
}

/* === CONTENU PRINCIPAL === */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
  scroll-behavior: smooth;
}

/* Hero section (page d'accueil) */
.hero {
  background: linear-gradient(120deg, #f1f9f0 0%, #ffffff 80%);
  padding: 32px 24px;
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-block;
  background: rgba(44,122,62,0.1);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 30px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.4;
}

/* Grille d'accueil */
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 20px;
}

.guide-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.guide-card:active {
  transform: scale(0.97);
}

.guide-card-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.guide-card-title {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
}

.guide-card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Avertissement */
.warning-card {
  margin: 0 20px 20px;
  background: #fff9ed;
  border-radius: 24px;
  padding: 16px;
  display: flex;
  gap: 12px;
  border: 1px solid #ffe2b5;
}

.warning-icon {
  font-size: 22px;
}

.warning-text {
  font-size: 13px;
  color: #a65c00;
  line-height: 1.4;
}

/* Installation banner */
#install-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  z-index: 500;
  animation: slideUp 0.3s ease;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
  }
  to {
    transform: translateX(-50%) translateY(0);
  }
}

.install-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-banner-icon {
  font-size: 28px;
}

.install-banner-text {
  flex: 1;
}

.install-banner-title {
  font-weight: 700;
  font-size: 14px;
}

.install-banner-sub {
  font-size: 11px;
  color: var(--text-muted);
}

#install-btn {
  background: var(--primary);
  border: none;
  color: white;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 13px;
  cursor: pointer;
}

#install-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
}