/* ============================================================
   GastroAudit Pro — Main Stylesheet
   ============================================================ */

:root {
  --ga-primary: #1565C0;
  --ga-primary-dark: #0d3b66;
  --ga-primary-light: #E3F2FD;
  --ga-success: #2E7D32;
  --ga-warning: #E65100;
  --ga-danger: #C62828;
  --ga-info: #0288D1;
  --ga-text: #212121;
  --ga-text-muted: #546E7A;
  --ga-border: #E0E7EF;
  --ga-bg: #F0F4F8;
  --ga-surface: #FFFFFF;
  --ga-navbar-bg: #0d3b66;
  --ga-card-shadow: 0 2px 12px rgba(21,101,192,0.08);
  --ga-radius: 12px;
}

[data-bs-theme="dark"] {
  --ga-text: #E8EDF2;
  --ga-text-muted: #9EADBF;
  --ga-border: #2D3748;
  --ga-bg: #0f1923;
  --ga-surface: #1a2332;
  --ga-card-shadow: 0 2px 12px rgba(0,0,0,0.3);
  --bs-body-bg: #0f1923;
  --bs-body-color: #E8EDF2;
  --bs-card-bg: #1a2332;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--ga-bg);
  color: var(--ga-text);
  line-height: 1.6;
}

.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.85rem; }

/* ── Navbar ───────────────────────────────────────────────── */
.ga-navbar {
  background: linear-gradient(135deg, var(--ga-primary-dark) 0%, var(--ga-primary) 100%);
  border-bottom: 2px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}
.ga-navbar .nav-link {
  color: rgba(255,255,255,0.8) !important;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}
.ga-navbar .nav-link:hover,
.ga-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  padding-top: 1.5rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.ga-card {
  border-radius: var(--ga-radius);
  background: var(--ga-surface);
  box-shadow: var(--ga-card-shadow);
  transition: box-shadow 0.2s ease;
}
.ga-card:hover { box-shadow: 0 4px 20px rgba(21,101,192,0.14); }
.ga-card .card-header { background: transparent; border-bottom: 1px solid var(--ga-border); }

/* ── Login Page ───────────────────────────────────────────── */
.ga-login-page {
  background: linear-gradient(135deg, var(--ga-primary-dark) 0%, #1a5276 40%, #2980B9 100%);
  background-attachment: fixed;
}
.ga-login-logo {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
}
.ga-login-card {
  border-radius: 20px;
  background: var(--ga-surface);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
}

/* ── Textarea ─────────────────────────────────────────────── */
.ga-textarea {
  resize: vertical;
  min-height: 300px;
  font-size: 0.82rem;
  line-height: 1.7;
  border-color: var(--ga-border);
  background: var(--ga-surface);
  transition: all 0.2s;
  border-radius: 10px;
}
.ga-textarea:focus {
  border-color: var(--ga-primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
  outline: none;
}

/* ── Dropzone ─────────────────────────────────────────────── */
.ga-dropzone {
  border-color: var(--ga-border) !important;
  background: var(--ga-bg);
  transition: all 0.2s;
  cursor: pointer;
}
.ga-dropzone:hover, .ga-dropzone-active {
  border-color: var(--ga-primary) !important;
  background: var(--ga-primary-light);
}

/* ── Analyze Button ───────────────────────────────────────── */
.ga-analyze-btn {
  background: linear-gradient(135deg, var(--ga-primary) 0%, var(--ga-primary-dark) 100%);
  border: none;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(21,101,192,0.35);
}
.ga-analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(21,101,192,0.45);
  filter: brightness(1.05);
}
.ga-analyze-btn:active { transform: translateY(0); }

/* ── Empty State ──────────────────────────────────────────── */
.ga-empty-state { max-width: 520px; }

/* ── Results ──────────────────────────────────────────────── */
.ga-section-header {
  background: linear-gradient(135deg, var(--ga-primary) 0%, var(--ga-primary-dark) 100%);
  color: white;
  border-radius: 10px 10px 0 0;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ga-section-header.green { background: linear-gradient(135deg, #2E7D32, #1B5E20); }
.ga-section-header.teal  { background: linear-gradient(135deg, #00695C, #004D40); }
.ga-section-header.grey  { background: linear-gradient(135deg, #455A64, #263238); }
.ga-section-header.orange{ background: linear-gradient(135deg, #E65100, #BF360C); }

.ga-result-card {
  border-radius: 10px;
  box-shadow: var(--ga-card-shadow);
  background: var(--ga-surface);
  overflow: hidden;
  margin-bottom: 1rem;
}
.ga-result-body { padding: 1rem; }

/* ── Score Indicator ──────────────────────────────────────── */
.ga-score-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 6px solid;
  font-size: 1.6rem;
  font-weight: 800;
}
.ga-score-ring.score-low    { border-color: #2E7D32; color: #2E7D32; }
.ga-score-ring.score-medium { border-color: #E65100; color: #E65100; }
.ga-score-ring.score-high   { border-color: #C62828; color: #C62828; }
.ga-score-ring.score-critical { border-color: #B71C1C; background: #FFEBEE; color: #B71C1C; }

/* ── Observations ─────────────────────────────────────────── */
.ga-observation {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  border-left: 4px solid;
  line-height: 1.5;
}
.ga-observation.obs-error   { background: #FFF5F5; border-color: #C62828; color: #7B1A1A; }
.ga-observation.obs-warning { background: #FFF8F0; border-color: #E65100; color: #7B3200; }
.ga-observation.obs-info    { background: #F0F7FF; border-color: #0288D1; color: #01579B; }
.ga-observation.obs-success { background: #F0FFF4; border-color: #2E7D32; color: #1B5E20; }

[data-bs-theme="dark"] .ga-observation.obs-error   { background: #2D1515; color: #FFCDD2; }
[data-bs-theme="dark"] .ga-observation.obs-warning { background: #2D1E00; color: #FFE0B2; }
[data-bs-theme="dark"] .ga-observation.obs-info    { background: #0C2035; color: #B3E5FC; }
[data-bs-theme="dark"] .ga-observation.obs-success { background: #0C2D0C; color: #C8E6C9; }

/* ── Supply Tables ────────────────────────────────────────── */
.ga-supply-table th {
  background: var(--ga-primary-light);
  color: var(--ga-primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 0.75rem;
}
.ga-supply-table td { font-size: 0.82rem; padding: 0.5rem 0.75rem; }
.ga-supply-table tr:hover td { background: var(--ga-primary-light); }

/* ── Summary Box ──────────────────────────────────────────── */
.ga-summary-box {
  background: var(--ga-primary-light);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: 0.3px;
  border-left: 4px solid var(--ga-primary);
  color: var(--ga-primary-dark);
  max-height: 300px;
  overflow-y: auto;
}
[data-bs-theme="dark"] .ga-summary-box {
  background: #0D1F33;
  color: #B3D4F8;
  border-color: #1565C0;
}

/* ── Suggested Text Box ───────────────────────────────────── */
.ga-suggested-box {
  background: #F0FFF4;
  border: 1px solid #A5D6A7;
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.8;
  color: #1B5E20;
  position: relative;
}
[data-bs-theme="dark"] .ga-suggested-box {
  background: #0A2010;
  border-color: #2E7D32;
  color: #C8E6C9;
}

/* ── Copy Button ──────────────────────────────────────────── */
.ga-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
}

/* ── Progress Bar ─────────────────────────────────────────── */
.ga-progress-container {
  background: var(--ga-bg);
  border-radius: 20px;
  overflow: hidden;
  height: 10px;
}
.ga-progress-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 1s ease;
}

/* ── Quality Indicators ───────────────────────────────────── */
.ga-quality-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--ga-border);
}
.ga-quality-item:last-child { border-bottom: none; }

/* ── Toast ────────────────────────────────────────────────── */
.ga-toast {
  min-width: 280px;
  border-radius: 10px;
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  font-size: 0.85rem;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ga-fade-in { animation: fadeInUp 0.4s ease forwards; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.ga-pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #B0BEC5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ga-primary); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { padding-top: 1rem; }
  .ga-textarea { min-height: 200px; }
  .ga-score-ring { width: 80px; height: 80px; font-size: 1.3rem; }
}

/* ── Badge overrides ──────────────────────────────────────── */
.badge { font-weight: 500; }
.bg-primary-subtle  { background-color: var(--ga-primary-light) !important; }
.text-primary       { color: var(--ga-primary) !important; }
