:root {
  --font-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Typography Hierarchy */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Design System: Modern Dark with Teal Accent */
  --color-black: #050507;
  --color-black-soft: #0a0b0d;
  --color-black-lighter: #12141a;
  --color-black-card: #0d0e12;

  --color-white: #ffffff;
  --color-white-soft: #f8fafc;
  --color-white-muted: #e2e8f0;
  --color-white-dark: #94a3b8;

  /* Primary Teal Accent */
  --color-tertiary: #2dd4bf;
  --color-tertiary-hover: #14b8a6;
  --color-tertiary-light: #5eead4;
  --color-tertiary-dark: #0d9488;
  --color-tertiary-glow: rgba(45, 212, 191, 0.4);

  /* Semantic Colors */
  --color-primary: var(--color-tertiary);
  --color-primary-hover: var(--color-tertiary-hover);
  --color-primary-light: var(--color-tertiary-light);
  --color-primary-rgb: 45, 212, 191;

  /* Background Colors */
  --color-bg: var(--color-black);
  --color-bg-soft: var(--color-black-soft);
  --color-surface: var(--color-black-card);
  --color-surface-elevated: var(--color-black-lighter);

  /* Text Colors */
  --color-text: var(--color-white);
  --color-text-muted: var(--color-white-dark);
  --color-text-soft: var(--color-white-muted);

  /* Border Colors */
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-light: rgba(255, 255, 255, 0.1);
  --color-border-strong: rgba(255, 255, 255, 0.15);

  /* Status Colors */
  --color-success: #22c55e;
  --color-success-light: #4ade80;
  --color-success-bg: rgba(34, 197, 94, 0.12);
  --color-warning: #f59e0b;
  --color-warning-light: #fbbf24;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-error: #ef4444;
  --color-error-light: #f87171;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-info: #3b82f6;
  --color-info-light: #60a5fa;
  --color-info-bg: rgba(59, 130, 246, 0.12);

  /* Glass Effect - More subtle */
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-bg-hover: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 16px;

  /* Radii - Slightly softer */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows - More refined */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--color-tertiary-glow);

  /* Spacing scale */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;

  /* Transitions - Refined timing */
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-base);
  font-weight: var(--font-weight-regular);
  font-size: 15px;
  line-height: 1.6;
  background: var(--color-black);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Page Title Styles */
.page-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.03em;
  color: var(--color-white);
}

.page-subtitle {
  font-size: 0.95rem;
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}

.heading {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

.subheading {
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-muted {
  color: var(--color-text-muted);
}

.section-title,
.report-section-title {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Base Form Elements */
button,
.btn {
  font-family: var(--font-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

input,
select,
textarea {
  font-family: var(--font-base);
  font-weight: var(--font-weight-regular);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: transparent;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* Focus Outline */
:focus-visible {
  outline: 2px solid var(--color-tertiary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--color-tertiary);
  color: var(--color-black);
}

/* Chips & Badges Base */
.app-chip,
.app-badge {
  font-weight: var(--font-weight-medium);
  font-size: 0.75rem;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-6);
}

.form-field label {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-1);
  display: block;
  color: var(--color-text-muted);
}

.form-field input,
.form-field select {
  width: 100%;
}

/* Weather Compact */
.form-field--full {
  grid-column: 1 / -1;
}

.weather-compact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.weather-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.weather-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.weather-data-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.weather-data-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.weather-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.app-input--sm {
  height: 34px;
  font-size: 0.8125rem;
  padding: var(--space-1) var(--space-2);
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

.app-input--sm option {
  background: var(--color-surface);
  color: var(--color-white);
}

.weather-data-group select.app-input--sm {
  width: 130px;
  color: var(--color-white) !important;
  background-color: var(--color-surface);
  padding: 0 var(--space-2);
  text-indent: 0;
  font-weight: var(--font-weight-medium);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.weather-data-group input.app-input--sm {
  width: 70px;
  text-align: center;
}

.btn--sm {
  height: 34px;
  padding: 0 var(--space-3);
  font-size: 0.8125rem;
}

.weather-compact.weather-manual .weather-data-row select,
.weather-compact.weather-manual .weather-data-row input {
  background-color: var(--color-surface);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Utility Classes */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
