/* ============================================================
   theme.css - Portside Mobile Reporter v3 Design System
   Dark glassmorphism foundation, OLED-optimized
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* --- CSS Custom Properties --- */
:root {
  /* Dark glassmorphism palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.15);

  /* Accent colors */
  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.3);
  --accent-success: #10b981;
  --accent-success-glow: rgba(16, 185, 129, 0.3);
  --accent-danger: #ef4444;
  --accent-danger-glow: rgba(239, 68, 68, 0.3);
  --accent-warning: #f59e0b;
  --accent-scanner: #00ff88;

  /* Text */
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.35);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Blur */
  --blur-glass: 20px;
  --blur-heavy: 40px;

  /* Shadows / glow */
  --glow-primary: 0 0 20px var(--accent-primary-glow);
  --glow-success: 0 0 20px var(--accent-success-glow);
  --glow-danger: 0 0 20px var(--accent-danger-glow);

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 350ms ease;
}

/* --- Body --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
    'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #0f0a1f 25%, #0a0f1a 50%, #0f0a15 75%, #0a0a1a 100%);
  background-size: 400% 400%;
  background-attachment: fixed;
  animation: gradientShift 20s ease infinite;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  25%      { background-position: 50% 0%; }
  50%      { background-position: 100% 50%; }
  75%      { background-position: 50% 100%; }
}

/* --- Typography Scale --- */
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg  { font-size: 17px; }
.text-xl  { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 28px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mono {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

/* --- Color Utilities --- */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-accent    { color: var(--accent-primary); }
.text-success   { color: var(--accent-success); }
.text-danger    { color: var(--accent-danger); }
.text-warning   { color: var(--accent-warning); }
.text-scanner   { color: var(--accent-scanner); }

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

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

/* Firefox thin scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* --- Selection --- */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

/* --- Focus Ring --- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-primary-glow);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--accent-primary-glow);
}

/* --- Placeholder --- */
::placeholder {
  color: var(--text-tertiary);
  opacity: 1;
}

/* --- Transition Defaults --- */
button,
a,
input,
select,
textarea {
  transition: background var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base),
              opacity var(--transition-base),
              transform var(--transition-fast);
}
