/* ═══════════════════════════════════════════════════════
   AntibioGuide – Style sobre & minimaliste
   ═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:    #1a56db;
  --primary-bg: #eff6ff;
  --warn:       #d97706;
  --danger:     #dc2626;
  --success:    #16a34a;
  --bg:         #f9fafb;
  --surface:    #ffffff;
  --border:     #e5e7eb;
  --text:       #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --drawer-w:   272px;
  --app-max:    430px;
  --header-h:   56px;
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  background: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  color: var(--text);
}

#app {
  width: 100%;
  max-width: var(--app-max);
  height: 100vh;
  max-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05), 0 2px 24px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

#offline-notice {
  display: none;
  background: var(--warn);
  color: white;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  flex-shrink: 0;
}

#overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}
#overlay.active { opacity: 1; pointer-events: all; }

/* ── Drawer ─────────────────────────────────────────── */
#drawer {
  position: absolute; top: 0; left: 0;
  width: var(--drawer-w); height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 200;
  transition: transform 0.3s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateX(-100%);
}
#drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 40px 20px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.drawer-logo-icon {
  width: 36px; height: 36px;
  background: var(--primary-bg);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.drawer-logo-text { font-size: 16px; font-weight: 700; color: var(--text); }
.drawer-subtitle { font-size: 11px; color: var(--text-muted); padding-left: 46px; }

.drawer-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-light);
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; cursor: pointer;
  transition: background 0.15s ease;
  position: relative; border: none; background: none;
  width: 100%; text-align: left;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 400;
  text-decoration: none; border-radius: 7px;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.nav-item-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 14px; flex-shrink: 0;
}
.nav-item.active .nav-item-icon { background: white; }
.nav-item-badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px;
  border-radius: 4px; background: var(--bg); color: var(--text-muted);
  font-weight: 500; border: 1px solid var(--border);
}
.nav-item.active .nav-item-badge { background: white; color: var(--primary); border-color: #bfdbfe; }

.drawer-footer {
  padding: 16px 20px 28px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-light); line-height: 1.6; flex-shrink: 0;
}
.drawer-footer strong { color: var(--text-muted); }

/* ── Header ─────────────────────────────────────────── */
#header {
  position: sticky; top: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 14px; z-index: 300; gap: 12px; flex-shrink: 0;
}
#menu-btn {
  width: 36px; height: 36px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  transition: background 0.15s; flex-shrink: 0;
}
#menu-btn:hover { background: var(--bg); }
#menu-btn span {
  display: block; width: 16px; height: 1.5px;
  background: var(--text); border-radius: 2px; transition: all 0.25s ease;
}
#menu-btn.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
#menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#menu-btn.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.header-text { flex: 1; min-width: 0; }
#header-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#header-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── Content ────────────────────────────────────────── */
#content {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-body { animation: pageIn 0.2s ease; }

/* ── Cards & Components ─────────────────────────────── */
.info-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; border: 1px solid var(--border);
}
.info-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.info-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; background: var(--bg);
}
.info-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.info-chip {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 4px; margin: 2px;
}
.chip-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.chip-green  { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.chip-orange { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.chip-red    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── PDF Viewer ─────────────────────────────────────── */
.pdf-section { padding: 0 14px 20px; }
.pdf-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.pdf-header-icon {
  width: 30px; height: 30px; background: #fffbeb;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.pdf-header-text { font-size: 13px; font-weight: 600; color: var(--text); }
.pdf-header-sub { font-size: 11px; color: var(--text-muted); }
.pdf-download-btn {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: background 0.15s;
}
.pdf-download-btn:hover { background: var(--border); }
.pdf-container {
  width: 100%; height: 500px; background: #f3f4f6;
  border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
  position: relative; border: 1px solid var(--border); border-top: none;
}
.pdf-container iframe { width: 100%; height: 100%; border: none; display: block; }
.pdf-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 12px;
}
.pdf-fallback-icon { font-size: 40px; }
.pdf-fallback-title { font-size: 15px; font-weight: 600; color: var(--text); }
.pdf-fallback-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pdf-open-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--text); color: white;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; text-decoration: none;
}

/* ── Install 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: 12px 14px; z-index: 500; animation: slideUp 0.35s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}
.install-banner-inner { display: flex; align-items: center; gap: 10px; }
.install-banner-icon { font-size: 24px; flex-shrink: 0; }
.install-banner-text { flex: 1; }
.install-banner-title { font-size: 13px; font-weight: 600; color: var(--text); }
.install-banner-sub { font-size: 11px; color: var(--text-muted); }
#install-btn {
  background: var(--primary); color: white; border: none;
  padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: 'Inter', sans-serif;
}
#install-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px; line-height: 1;
}
