:root {
  /* Core Colors - Dark Theme */
  --bg-body: #09090b;
  --bg-card: #18181b;
  --bg-card-hover: #27272a;
  --bg-elevated: #27272a;
  
  /* Text Colors */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;

  /* Borders */
  --border-subtle: #27272a;
  --border-default: #3f3f46;
  --border-active: #71717a;

  /* Brand / Accent Colors */
  --primary: #3b82f6; /* Blue for trust/gov */
  --primary-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  
  /* AQI Colors */
  --aqi-good: #22c55e;
  --aqi-moderate: #eab308;
  --aqi-poor: #f97316;
  --aqi-very-poor: #ef4444;
  --aqi-severe: #b91c1c;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Layout */
  --container-width: 1280px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

ul {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* Utilities */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* CMS Layout & Components */
.cms-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.cms-sidebar {
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-default);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.cms-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.cms-brand span {
  color: var(--primary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cms-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.cms-nav-item:hover, .cms-nav-item.active {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.cms-user-profile {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-default);
}

.cms-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shortcut-hint {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cms-main {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
}

.cms-header {
  height: 64px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background-color: var(--bg-card);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-back-link {
  color: var(--text-secondary);
}

.header-separator {
  height: 20px;
  width: 1px;
  background: var(--border-default);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.editor-container {
  padding: var(--space-xl);
  flex: 1;
  overflow-y: auto;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.editor-title-input {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  outline: none;
}

.editor-toolbar {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 8px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.toolbar-btn:hover {
  background-color: var(--border-default);
  color: var(--text-primary);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-default);
  margin: 4px 8px;
}

.toolbar-spacer {
  flex: 1;
}

.editor-canvas {
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 40px;
  min-height: 500px;
  color: var(--text-primary);
}

/* Shortcuts Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcuts-modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-elevated);
}

.modal-close-btn {
  border: none;
  padding: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

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

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-default);
  background-color: var(--bg-elevated);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

.shortcut-group {
  margin-bottom: var(--space-xl);
}

.shortcut-group-title {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.shortcut-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.shortcut-item:hover {
  border-color: var(--border-active);
}

.shortcut-key-wrapper {
  display: flex;
  align-items: center;
}

.kbd-key {
  display: inline-block;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--border-default);
  min-width: 24px;
  text-align: center;
}

.kbd-key-sm {
  min-width: 0;
  padding: 2px 6px;
  font-size: 0.7rem;
}

.shortcut-action {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.shortcut-edit-btn {
  color: var(--primary);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: 8px;
}

.shortcut-item:hover .shortcut-edit-btn {
  opacity: 1;
}

.modal-tabs {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
}

.modal-tab {
  padding-bottom: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.modal-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--primary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(250, 250, 250, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.dot-indicator.saved { background-color: var(--aqi-good); }
.dot-indicator.unsaved { background-color: var(--aqi-moderate); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mr-sm { margin-right: var(--space-sm); }
.mx-lg { margin-left: var(--space-lg); margin-right: var(--space-lg); }

.hidden-mobile { display: none; }

/* Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--border-default);
  border-color: var(--text-secondary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  width: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-orange { background: rgba(249, 115, 22, 0.15); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-green { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  position: relative;
}

.card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header & Nav */
.top-bar {
  background: #000;
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.main-header {
  height: var(--header-height);
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Hero Section / AQI Widget */
.hero-section {
  padding: var(--space-2xl) 0;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.aqi-widget-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-lg);
  align-items: stretch;
}

.aqi-dial {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: conic-gradient(
    var(--aqi-good) 0deg 60deg,
    var(--aqi-moderate) 60deg 120deg,
    var(--aqi-poor) 120deg 200deg,
    var(--aqi-very-poor) 200deg 300deg,
    var(--aqi-severe) 300deg 360deg
  );
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.aqi-dial::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  background: var(--bg-card);
  border-radius: 50%;
}

.aqi-value {
  position: relative;
  z-index: 2;
  text-align: center;
}

.aqi-number {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(to bottom, #fff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.aqi-status {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--aqi-severe); /* Dynamic based on JS in real app */
  margin-top: 8px;
}

.aqi-location {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.grap-card {
  background: linear-gradient(145deg, rgba(185, 28, 28, 0.1), var(--bg-card));
  border: 1px solid rgba(185, 28, 28, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.grap-stage {
  font-size: 3rem;
  font-weight: 800;
  color: var(--aqi-severe);
  line-height: 1.1;
}

.news-ticker {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker 30s linear infinite;
  padding-left: 100%;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Quick Links Grid */
.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  cursor: pointer;
}

.quick-link-card:hover {
  background: var(--bg-elevated);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.icon-box {
  width: 56px;
  height: 56px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}

/* Lists */
.list-item {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.list-item:last-child {
  border-bottom: none;
}

.list-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Forms */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 16px;
  width: 240px;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-size: 0.9rem;
}

.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Footer */
.main-footer {
  background: #000;
  border-top: 1px solid var(--border-default);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-2xl);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-2xl);
}

.footer-heading {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--primary);
}

.emblem-placeholder {
  width: 48px;
  height: 64px;
  background-color: #3f3f46;
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  font-size: 0.7rem;
}

/* Responsive */
@media (min-width: 768px) {
  .hidden-mobile { display: flex; }
  .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .aqi-widget-container { grid-template-columns: 1.5fr 1fr; }
}

@media (max-width: 767px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .aqi-widget-container { grid-template-columns: 1fr; }
  .nav-links { display: none; } /* Simplified mobile nav */
  h1 { font-size: 2rem; }
  .aqi-dial { width: 220px; height: 220px; }
  .aqi-dial::before { width: 190px; height: 190px; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .search-bar { display: none; } /* Hide for simple mobile view */
}

/* Added from inline styles cleanup */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 20px;
  color: var(--primary);
  background: #000;
  padding: 10px;
  z-index: 1000;
}

.skip-link:focus {
  left: 20px;
}

.opacity-30 { opacity: 0.3; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }

.text-10 { font-size: 10px; }

.pad-2-6 { padding: 2px 6px; }
.pad-8 { padding: 8px; }

.border-t { border-top: 1px solid var(--border-default); }
.pt-lg { padding-top: var(--space-lg); }

.min-h-400 { min-height: 400px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-default);
  cursor: pointer;
}

.dot.active {
  background: var(--primary);
}

.tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; }

.bar-chart-container {
  display: flex;
  align-items: flex-end;
  gap: var(--space-xs);
  width: 100%;
  height: 64px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 4px;
}

.bar {
  width: 14%;
  border-radius: 2px 2px 0 0;
}

.avatar {
  width: 24px;
  height: 24px;
  background: #333;
  border-radius: 50%;
}

.divider-h {
  height: 1px;
  background: var(--border-subtle);
  width: 100%;
}

.col-span-2 { grid-column: span 2; }
.line-height-relaxed { line-height: 1.6; }
