/* ==========================================================================
   SmartWasteAI Design System & Stylesheet
   Theme: Modern Eco-Tech & AI (Deep Forest Dark, Emerald & Teal Accents)
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #090e0c;
  --bg-surface: #101815;
  --bg-surface-elevated: #15221d;
  --bg-surface-glass: rgba(16, 24, 21, 0.78);
  
  --border-subtle: rgba(52, 211, 153, 0.12);
  --border-medium: rgba(52, 211, 153, 0.24);
  --border-focus: #10b981;
  
  /* Primary & Accent Accents */
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.28);
  
  --teal-400: #2dd4bf;
  --cyan-400: #22d3ee;
  
  /* Status Colors */
  --status-online: #10b981;
  --status-offline: #f87171;
  --status-warning: #fbbf24;
  
  /* Category Tones */
  --cat-battery: #f59e0b;
  --cat-biological: #10b981;
  --cat-brown-glass: #b45309;
  --cat-cardboard: #d97706;
  --cat-green-glass: #059669;
  --cat-metal: #64748b;
  --cat-paper: #38bdf8;
  --cat-plastic: #06b6d4;
  --cat-trash: #ef4444;
  --cat-white-glass: #a7f3d0;

  /* Typography Colors */
  --text-primary: #f1f5f3;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Typography Scale & Weights */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  
  /* Transitions & Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 9999px;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: radial-gradient(circle at top center, #10221a 0%, #090e0c 70%);
  background-attachment: fixed;
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--emerald-400);
  outline-offset: 3px;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.25;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
  color: #ffffff;
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 4px 14px var(--emerald-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
  color: #062b1b;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.45);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--emerald-400);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--emerald-400);
  border-color: var(--border-medium);
  background: rgba(52, 211, 153, 0.1);
}

.btn-text-danger {
  background: none;
  border: none;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem;
}

.btn-text-danger:hover {
  color: #ef4444;
}

/* Card Component */
.card {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: var(--border-medium);
}

/* Section Headings */
.section-header {
  margin-bottom: 2.75rem;
}

.section-header-inline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}

/* ==========================================================================
   1. Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 14, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.14);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.brand-accent {
  color: var(--emerald-400);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Connection Status Pill */
.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-warning);
  transition: background-color var(--transition-base);
}

.status-dot.online {
  background-color: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}

.status-dot.offline {
  background-color: var(--status-offline);
  box-shadow: 0 0 8px var(--status-offline);
}

/* ==========================================================================
   2. Hero Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--emerald-400);
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  max-width: 800px;
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 680px;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ==========================================================================
   3. Classifier Workstation
   ========================================================================== */
.classifier-section {
  padding: 3.5rem 0 4.5rem;
}

.workstation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.workstation-card {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  background: rgba(16, 24, 21, 0.45);
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.15);
}

.file-input-hidden {
  display: none;
}

.drop-zone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.upload-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.1);
  color: var(--emerald-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: transform var(--transition-base);
}

.drop-zone:hover .upload-icon-wrapper {
  transform: translateY(-3px) scale(1.05);
}

.drop-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.drop-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

#browse-btn {
  margin-top: 0.5rem;
}

/* Preview State */
.preview-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-frame {
  position: relative;
  width: 100%;
  height: 230px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Scanning Beam Animation during classification */
.scan-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan-400), var(--emerald-400), transparent);
  box-shadow: 0 0 14px var(--emerald-400);
  animation: scanAnimation 1.6s infinite ease-in-out;
  pointer-events: none;
}

@keyframes scanAnimation {
  0% { top: 0%; opacity: 0.2; }
  50% { opacity: 1; }
  100% { top: 96%; opacity: 0.2; }
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
}

.meta-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.meta-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-specs {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.workstation-actions {
  margin-top: 1.25rem;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   4. Prediction Result & Recommendation Panel
   ========================================================================== */
.result-placeholder {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.placeholder-icon {
  color: var(--border-medium);
  margin-bottom: 1rem;
}

.placeholder-title {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.placeholder-text {
  font-size: 0.9rem;
  max-width: 320px;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.result-header {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.result-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.result-filename {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-pill-large {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-400);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
}

.cat-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.cat-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Confidence Meter */
.confidence-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}

.confidence-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.confidence-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.confidence-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--emerald-400);
  font-family: var(--font-mono);
}

.confidence-meter {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.confidence-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald-500), var(--cyan-400));
  border-radius: var(--radius-pill);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.confidence-footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Recommendation Card */
.recommendation-card {
  background: linear-gradient(145deg, rgba(16, 34, 26, 0.7), rgba(16, 24, 21, 0.9));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.rec-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.rec-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: rgba(52, 211, 153, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.rec-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.rec-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.rec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.rec-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rec-item-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--emerald-400);
}

.rec-item-val {
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* ==========================================================================
   5. Waste Guidelines Reference Cards
   ========================================================================== */
.guidelines-section {
  padding: 4.5rem 0;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.guidelines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-base);
}

.guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-medium);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.guide-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.guide-name {
  font-size: 1rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--text-primary);
}

.guide-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.guide-action {
  margin-top: auto;
  font-size: 0.8rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  color: var(--emerald-400);
  border-left: 3px solid var(--emerald-400);
}

/* ==========================================================================
   6. Prediction History Table
   ========================================================================== */
.history-section {
  padding: 4.5rem 0;
}

.history-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.history-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
}

.history-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.history-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-time {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.history-file {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.history-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ==========================================================================
   7. Analytics Dashboard
   ========================================================================== */
.analytics-section {
  padding: 4.5rem 0 5.5rem;
  border-top: 1px solid var(--border-subtle);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-value-text {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  text-transform: capitalize;
  color: var(--emerald-400);
}

.metric-value-status {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  color: var(--emerald-400);
}

.metric-footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Category Distribution Bars */
.distribution-card {
  padding: 1.75rem;
}

.distribution-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.distribution-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.distribution-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.source-tag {
  font-size: 0.75rem;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dist-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dist-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.dist-cat-name {
  text-transform: capitalize;
  font-weight: 600;
  color: var(--text-primary);
}

.dist-cat-stats {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.dist-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.dist-progress-fill {
  height: 100%;
  background: var(--emerald-400);
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* ==========================================================================
   8. Settings Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-helper {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--emerald-400);
}

.endpoint-presets {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.endpoint-status-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.endpoint-status-box code {
  color: var(--emerald-400);
  font-family: var(--font-mono);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: #060a08;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  font-size: 0.88rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.4rem;
  max-width: 320px;
}

.footer-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-pill {
  font-size: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-note code {
  color: var(--emerald-400);
  font-family: var(--font-mono);
}

/* Helper Class */
.hidden {
  display: none !important;
}

/* ==========================================================================
   10. Responsive Breakpoints
   ========================================================================== */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
  .workstation-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2.75rem;
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .nav-links {
    display: none; /* Keep clean navigation bar on small mobile screens */
  }

  .hero-section {
    padding: 3rem 0 2rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-top,
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Small Screens (max-width: 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.85rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .category-pill-large {
    width: 100%;
    justify-content: center;
  }

  .rec-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
