@import "tailwindcss";

/* =========================================
   1. THEME VARIABLES (Base/Classic)
   ========================================= */
:root {
  /* Typography */
  font-family:
    "Inter",
    "SF Pro Display",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* HSL tokens used by Tailwind-based components */

  --background: 216 33% 97%;
  --foreground: 228 35% 12%;
  --card: 0 0% 100%;
  --card-foreground: 228 35% 12%;
  --popover: 0 0% 100%;
  --popover-foreground: 228 35% 12%;
  --primary: 193 100% 43%;
  --primary-foreground: 216 33% 97%;
  --secondary: 214 32% 91%;
  --secondary-foreground: 228 35% 16%;
  --muted: 214 30% 94%;
  --muted-foreground: 224 12% 42%;
  --accent: 214 32% 93%;
  --accent-foreground: 228 35% 16%;
  --destructive: 349 82% 56%;
  --destructive-foreground: 210 33% 98%;
  --border: 217 28% 84%;
  --input: 217 28% 84%;
  --ring: 193 100% 43%;
  --radius: 1rem;
  --elevated: 0 0% 100%;
  --hover: 214 29% 90%;
  --secondary-text: 224 14% 34%;
  --muted-text: 224 10% 48%;

  --color-cyan: hsl(var(--primary));
  --color-cyan-dim: hsl(var(--primary) / 0.8);
  --color-cyan-glow: hsl(var(--primary) / 0.18);
  --color-purple: 247 84% 66%;
  --color-purple-dim: 247 84% 56%;
  --color-purple-glow: hsl(247 84% 66% / 0.18);
  --color-success: 142 76% 36%;
  --color-warning: 35 92% 41%;
  --color-danger: 349 82% 56%;
  /* Tailwind aliases (for hsl(var(--success))) */
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);

  /* Sentiment indicator colors (Fear & Greed Index) - Adjustable via CSS */
  --sentiment-greed: var(--color-cyan);
  --sentiment-neutral: var(--color-purple);
  --sentiment-fear: var(--color-danger);

  /* Sentiment indicator glow effect - Intensity adjustable via CSS */
  --glow-spread: 8px;
  --glow-intensity: 0.18;
  --sentiment-greed-glow: hsl(var(--sentiment-greed) / var(--glow-intensity));
  --sentiment-neutral-glow: hsl(var(--sentiment-neutral) / var(--glow-intensity));
  --sentiment-fear-glow: hsl(var(--sentiment-fear) / var(--glow-intensity));

  --bg-base: hsl(var(--background));
  --bg-card: hsl(var(--card));
  --bg-elevated: hsl(var(--elevated));
  --bg-hover: hsl(var(--hover));

  /* New: Design token color sources (Raw HSL values) */
  --bg-subtle-raw: var(--foreground);
  --border-dim-raw: var(--foreground);
  --border-subtle-raw: var(--foreground);

  /* Design tokens (Ready to use HSL strings) */
  --bg-subtle: hsl(var(--bg-subtle-raw) / 0.03);
  --border-dim: hsl(var(--border-dim-raw) / 0.05);
  --border-subtle: hsl(var(--border-subtle-raw) / 0.04);
  --border-subtle-hover: hsl(var(--border-subtle-raw) / 0.06);
  --border-default: var(--border-dim);
  --border-hover: hsl(var(--primary) / 0.24);
  --border-selected: hsl(var(--primary) / 0.32);

  /* Surface variants */
  --surface-1: hsl(var(--card));
  --surface-2: hsl(var(--elevated));
  --surface-3: hsl(var(--hover));

  /* State overlay colors */
  --overlay-hover: hsl(var(--foreground) / 0.05);
  --overlay-selected: hsl(var(--primary) / 0.1);

  /* Compatibility preservation */
  --border-accent: hsl(var(--primary) / 0.7);
  --border-purple: hsl(247 84% 66% / 0.24);
  --border-cyan: hsl(var(--primary));
  --text-primary: hsl(var(--foreground));
  --text-secondary-text: hsl(var(--secondary-text));
  --text-muted-text: hsl(var(--muted-text));

  /* Navigation related (using HSL format) */
  --nav-active-bg: hsl(var(--primary) / 0.09);
  --nav-active-border: hsl(var(--primary) / 0.24);
  --nav-active-shadow: hsl(var(--primary) / 0.04);
  --nav-hover-bg: hsl(var(--primary) / 0.05);
  --nav-icon-active: hsl(var(--primary));
  --nav-item-height: 2.75rem;
  --nav-item-padding-x: 1rem;
  --nav-indicator-width: 0.25rem;
  --nav-indicator-bg: hsl(var(--primary));
  --nav-indicator-shadow: hsl(var(--primary) / 0.52);
  --nav-badge-bg: hsl(var(--primary));
  --nav-brand-shadow: hsl(var(--primary) / 0.2);

  /* Home page related (using HSL format) */
  --home-loading-ring-track: hsl(var(--primary) / 0.2);
  --home-loading-ring-head: hsl(var(--primary));
  --home-mobile-overlay-bg: hsl(0 0% 0% / 0.6);
  --home-action-ai-bg: hsl(var(--primary) / 0.1);
  --home-action-ai-border: hsl(var(--primary) / 0.2);
  --home-action-ai-text: hsl(var(--primary));
  --home-action-ai-hover-bg: hsl(var(--primary) / 0.18);
  --home-action-report-bg: hsl(247 84% 66% / 0.1);
  --home-action-report-border: hsl(247 84% 66% / 0.2);
  --home-action-report-text: hsl(247 84% 66%);
  --home-action-report-hover-bg: hsl(247 84% 66% / 0.18);
  --home-accent-bg: hsl(var(--primary) / 0.1);
  --home-accent-bg-hover: hsl(var(--primary) / 0.16);
  --home-accent-border: hsl(var(--primary) / 0.2);
  --home-accent-border-hover: hsl(var(--primary) / 0.28);
  --home-accent-text: hsl(var(--primary));
  --home-secondary-accent-text: hsl(247 84% 66%);
  --home-title-accent: hsl(247 84% 66%);
  --home-price-up: hsl(0 88% 62%);
  --home-price-down: hsl(149 100% 42%);
  --home-strategy-buy: hsl(149 100% 42%);
  --home-strategy-secondary: hsl(var(--primary));
  --home-strategy-stop: hsl(346 100% 63%);
  --home-strategy-take: hsl(38 100% 52%);
  --home-panel-border: hsl(var(--foreground) / 0.08);
  --home-panel-border-hover: hsl(var(--primary) / 0.24);
  --home-panel-border-selected: hsl(var(--primary) / 0.32);
  --home-panel-gradient-start: hsl(var(--primary) / 0.22);
  --home-panel-gradient-mid: hsl(247 84% 66% / 0.16);
  --home-panel-gradient-end: hsl(var(--foreground) / 0.06);
  --home-panel-selected-shadow:
    0 0 0 1px hsl(var(--primary) / 0.08),
    0 4px 16px hsl(var(--primary) / 0.12);
  --home-panel-subtle-bg: hsl(var(--foreground) / 0.04);
  --home-panel-subtle-bg-hover: hsl(var(--foreground) / 0.06);
  --home-history-item-bg: hsl(var(--foreground) / 0.03);
  --home-history-item-hover-bg: hsl(var(--foreground) / 0.05);
  --home-history-item-selected-bg:
    linear-gradient(180deg, hsl(247 84% 66% / 0.12), hsl(var(--primary) / 0.08));
  --home-divider-border: hsl(var(--foreground) / 0.08);
  --home-surface-button-bg: hsl(var(--foreground) / 0.03);
  --home-surface-button-bg-hover: hsl(var(--foreground) / 0.05);
  --home-surface-button-border: hsl(var(--foreground) / 0.08);
  --home-surface-button-border-hover: hsl(var(--primary) / 0.2);
  --home-prose-border: hsl(var(--foreground) / 0.1);
  --home-prose-border-strong: hsl(var(--foreground) / 0.16);
  --home-prose-blockquote-border: hsl(247 84% 66% / 0.28);
  --home-prose-blockquote-bg: hsl(247 84% 66% / 0.08);
  --autocomplete-hover-bg: #04d1f6;

  /* Shadows (using HSL format) */
  --shadow-soft-card: 0 18px 48px hsl(215 25% 27% / 0.08);
  --shadow-soft-card-strong: 0 24px 56px hsl(215 25% 27% / 0.12);
  --settings-surface: hsl(0 0% 100% / 0.02);
  --settings-surface-hover: hsl(0 0% 100% / 0.05);
  --settings-surface-strong: hsl(var(--card) / 0.92);
  --settings-surface-panel: hsl(var(--elevated) / 0.62);
  --settings-surface-overlay: hsl(var(--background) / 0.22);
  --settings-surface-overlay-soft: hsl(var(--background) / 0.15);
  --settings-surface-overlay-muted: hsl(var(--background) / 0.12);
  --settings-border: hsl(0 0% 100% / 0.1);
  --settings-border-soft: hsl(0 0% 100% / 0.08);
  --settings-border-strong: hsl(0 0% 100% / 0.2);
  --settings-border-overlay: hsl(0 0% 100% / 0.45);
  --settings-accent-shadow: hsl(190 100% 50% / 0.1);
  --settings-primary-border: hsl(190 100% 50% / 0.26);
  --settings-primary-gradient:
    linear-gradient(135deg, hsl(190 100% 50% / 0.96), hsl(191 100% 40% / 0.96));
  --settings-primary-text: hsl(205 71% 6%);
  --settings-primary-shadow: hsl(190 100% 50% / 0.2);
  --settings-primary-shadow-hover: hsl(190 100% 50% / 0.22);
  --settings-secondary-border: hsl(0 0% 100% / 0.08);
  --settings-secondary-bg: hsl(0 0% 100% / 0.03);
  --settings-secondary-border-hover: hsl(190 100% 50% / 0.3);
  --settings-secondary-bg-hover: hsl(190 100% 50% / 0.06);
  --settings-glow-hover: hsl(190 100% 50% / 0.38);
  --settings-skeleton-strong: hsl(0 0% 100% / 0.1);
  --settings-skeleton-soft: hsl(0 0% 100% / 0.06);
  --input-surface-bg: var(--bg-card);
  --input-surface-border: hsl(var(--border) / 0.82);
  --input-surface-border-hover: rgba(255, 255, 255, 0.18);
  --input-surface-border-focus: hsl(var(--primary) / 0.38);
  --input-surface-focus-ring: 0 0 0 4px hsl(var(--primary) / 0.15);
  --gradient-primary:
    linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.74));
}

.dark {
  --background: 228 35% 7%;
  --foreground: 210 33% 98%;
  --card: 230 24% 10%;
  --card-foreground: 210 33% 98%;
  --popover: 230 24% 10%;
  --popover-foreground: 210 33% 98%;
  --primary: 190 100% 50%;
  --primary-foreground: 228 35% 8%;
  --secondary: 231 19% 15%;
  --secondary-foreground: 210 33% 94%;
  --muted: 230 18% 14%;
  --muted-foreground: 228 13% 66%;
  --accent: 231 18% 16%;
  --accent-foreground: 210 33% 98%;
  --destructive: 349 100% 63%;
  --destructive-foreground: 210 33% 98%;
  --border: 226 19% 20%;
  --input: 226 19% 20%;
  --ring: 190 100% 50%;
  --elevated: 230 22% 12%;
  --hover: 231 20% 16%;
  --secondary-text: 228 16% 72%;
  --muted-text: 228 10% 48%;

  --color-cyan: hsl(var(--primary));
  --color-cyan-dim: hsl(var(--primary) / 0.8);
  --color-cyan-glow: hsl(var(--primary) / 0.4);
  --color-purple: 247 84% 72%;
  --color-purple-dim: 247 84% 62%;
  --color-purple-glow: hsl(247 84% 72% / 0.3);
  --color-success: 142 76% 54%;
  --color-warning: 35 100% 50%;
  --color-danger: 349 100% 63%;
  --autocomplete-hover-bg: #2dcae6;
  /* Tailwind aliases (for hsl(var(--success))) */
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);

  /* Sentiment indicator colors (Dark theme) - Adjustable via CSS */
  --sentiment-greed: var(--color-cyan);
  --sentiment-neutral: var(--color-purple);
  --sentiment-fear: var(--color-danger);

  /* Sentiment indicator glow effect (Dark theme) - Stronger glow */
  --glow-spread: 12px;
  --glow-intensity: 0.3;
  --sentiment-greed-glow: hsl(var(--sentiment-greed) / var(--glow-intensity));
  --sentiment-neutral-glow: hsl(var(--sentiment-neutral) / var(--glow-intensity));
  --sentiment-fear-glow: hsl(var(--sentiment-fear) / var(--glow-intensity));

  --bg-base: hsl(var(--background));
  --bg-card: hsl(var(--card));
  --bg-elevated: hsl(var(--elevated));
  --bg-hover: hsl(var(--hover));

  /* Dark theme design token color sources */
  --bg-subtle-raw: var(--foreground);
  --border-dim-raw: var(--foreground);
  --border-subtle-raw: var(--foreground);

  /* Dark theme design tokens (Ready to use) */
  --bg-subtle: hsl(var(--bg-subtle-raw) / 0.05);
  --border-dim: hsl(var(--border-dim-raw) / 0.06);
  --border-subtle: hsl(var(--border-subtle-raw) / 0.08);
  --border-subtle-hover: hsl(var(--border-subtle-raw) / 0.15);
  --border-default: var(--border-dim);
  --border-hover: hsl(var(--primary) / 0.34);
  --border-selected: hsl(var(--primary) / 0.46);

  /* Dark theme surface variants */
  --surface-1: hsl(var(--card));
  --surface-2: hsl(var(--elevated));
  --surface-3: hsl(var(--hover));

  --overlay-hover: hsl(var(--foreground) / 0.08);
  --overlay-selected: hsl(var(--primary) / 0.15);

  /* Compatibility preservation */
  --border-accent: hsl(var(--primary) / 0.8);
  --border-purple: hsl(247 84% 72% / 0.28);
  --border-cyan: hsl(var(--primary));
  --text-primary: hsl(var(--foreground));
  --text-secondary-text: hsl(var(--secondary-text));
  --text-muted-text: hsl(var(--muted-text));

  /* Navigation related (Dark theme) */
  --nav-active-bg: hsl(var(--primary) / 0.11);
  --nav-active-border: hsl(var(--primary) / 0.3);
  --nav-active-shadow: hsl(var(--primary) / 0.05);
  --nav-hover-bg: hsl(var(--primary) / 0.06);
  --nav-icon-active: hsl(var(--primary));
  --nav-item-height: 2.75rem;
  --nav-item-padding-x: 1rem;
  --nav-indicator-width: 0.25rem;
  --nav-indicator-bg: hsl(var(--primary));
  --nav-indicator-shadow: hsl(var(--primary) / 0.8);
  --nav-badge-bg: hsl(var(--primary));
  --nav-brand-shadow: hsl(var(--primary) / 0.24);

  /* Home page related (Dark theme) */
  --home-loading-ring-track: hsl(var(--primary) / 0.2);
  --home-loading-ring-head: hsl(var(--primary));
  --home-mobile-overlay-bg: hsl(0 0% 0% / 0.6);
  --home-action-ai-bg: hsl(var(--primary) / 0.1);
  --home-action-ai-border: hsl(var(--primary) / 0.2);
  --home-action-ai-text: hsl(var(--primary));
  --home-action-ai-hover-bg: hsl(var(--primary) / 0.2);
  --home-action-report-bg: hsl(247 84% 72% / 0.1);
  --home-action-report-border: hsl(247 84% 72% / 0.2);
  --home-action-report-text: hsl(247 84% 72%);
  --home-action-report-hover-bg: hsl(247 84% 72% / 0.2);
  --home-accent-bg: hsl(var(--primary) / 0.1);
  --home-accent-bg-hover: hsl(var(--primary) / 0.18);
  --home-accent-border: hsl(var(--primary) / 0.22);
  --home-accent-border-hover: hsl(var(--primary) / 0.34);
  --home-accent-text: hsl(var(--primary));
  --home-secondary-accent-text: hsl(247 84% 72%);
  --home-title-accent: hsl(247 84% 72%);
  --home-price-up: hsl(0 88% 64%);
  --home-price-down: hsl(149 100% 44%);
  --home-strategy-buy: hsl(149 100% 44%);
  --home-strategy-secondary: hsl(var(--primary));
  --home-strategy-stop: hsl(346 100% 66%);
  --home-strategy-take: hsl(38 100% 58%);
  --home-panel-border: hsl(var(--foreground) / 0.1);
  --home-panel-border-hover: hsl(var(--primary) / 0.34);
  --home-panel-border-selected: hsl(var(--primary) / 0.46);
  --home-panel-gradient-start: hsl(var(--primary) / 0.3);
  --home-panel-gradient-mid: hsl(247 84% 72% / 0.24);
  --home-panel-gradient-end: hsl(var(--foreground) / 0.08);
  --home-panel-selected-shadow:
    0 0 0 1px hsl(var(--primary) / 0.14),
    0 4px 16px hsl(var(--primary) / 0.16);
  --home-panel-subtle-bg: hsl(var(--foreground) / 0.03);
  --home-panel-subtle-bg-hover: hsl(var(--foreground) / 0.05);
  --home-history-item-bg: hsl(var(--foreground) / 0.03);
  --home-history-item-hover-bg: hsl(var(--foreground) / 0.06);
  --home-history-item-selected-bg:
    linear-gradient(180deg, hsl(247 84% 72% / 0.14), hsl(var(--primary) / 0.1));
  --home-divider-border: hsl(var(--foreground) / 0.1);
  --home-surface-button-bg: hsl(var(--foreground) / 0.03);
  --home-surface-button-bg-hover: hsl(var(--foreground) / 0.06);
  --home-surface-button-border: hsl(var(--foreground) / 0.1);
  --home-surface-button-border-hover: hsl(var(--primary) / 0.28);
  --home-prose-border: hsl(var(--foreground) / 0.12);
  --home-prose-border-strong: hsl(var(--foreground) / 0.18);
  --home-prose-blockquote-border: hsl(247 84% 72% / 0.3);
  --home-prose-blockquote-bg: hsl(247 84% 72% / 0.1);

  /* Shadows (Dark theme) */
  --shadow-soft-card: 0 18px 48px hsl(215 25% 10% / 0.4);
  --shadow-soft-card-strong: 0 24px 56px hsl(215 25% 10% / 0.5);
  --settings-surface: hsl(0 0% 100% / 0.02);
  --settings-surface-hover: hsl(0 0% 100% / 0.05);
  --settings-surface-strong: hsl(var(--card) / 0.92);
  --settings-surface-panel: hsl(var(--elevated) / 0.62);
  --settings-surface-overlay: hsl(var(--background) / 0.22);
  --settings-surface-overlay-soft: hsl(var(--background) / 0.15);
  --settings-surface-overlay-muted: hsl(var(--background) / 0.12);
  --settings-border: hsl(0 0% 100% / 0.1);
  --settings-border-soft: hsl(0 0% 100% / 0.08);
  --settings-border-strong: hsl(0 0% 100% / 0.2);
  --settings-border-overlay: hsl(0 0% 100% / 0.45);
  --settings-accent-shadow: hsl(190 100% 50% / 0.1);
  --settings-primary-border: hsl(190 100% 50% / 0.26);
  --settings-primary-gradient:
    linear-gradient(135deg, hsl(190 100% 50% / 0.96), hsl(191 100% 40% / 0.96));
  --settings-primary-text: hsl(205 71% 6%);
  --settings-primary-shadow: hsl(190 100% 50% / 0.2);
  --settings-primary-shadow-hover: hsl(190 100% 50% / 0.22);
  --settings-secondary-border: hsl(0 0% 100% / 0.08);
  --settings-secondary-bg: hsl(0 0% 100% / 0.03);
  --settings-secondary-border-hover: hsl(190 100% 50% / 0.3);
  --settings-secondary-bg-hover: hsl(190 100% 50% / 0.06);
  --settings-glow-hover: hsl(190 100% 50% / 0.38);
  --settings-skeleton-strong: hsl(0 0% 100% / 0.1);
  --settings-skeleton-soft: hsl(0 0% 100% / 0.06);
  --input-surface-bg: var(--bg-card);
  --input-surface-border: hsl(var(--border) / 0.82);
  --input-surface-border-hover: rgba(255, 255, 255, 0.18);
  --input-surface-border-focus: hsl(var(--primary) / 0.45);
  --input-surface-focus-ring: 0 0 0 4px hsl(var(--primary) / 0.18);
  --gradient-primary:
    linear-gradient(135deg, rgba(0, 212, 255, 0.96), rgba(0, 168, 204, 0.96));
}

/* =========================================
   2. GLOBAL STYLES (from Classic)
   ========================================= */

/* ============ Financial Terminal Tokens ============ */

/* ============ Base Styles ============ */
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* ============ Title Styles ============ */
.title-gradient {
  background: linear-gradient(90deg, #ffffff 0%, #a0a0b0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============ Circular Gauge ============ */
.gauge-ring {
  filter: drop-shadow(0 0 8px var(--color-cyan-glow));
  transform: translateZ(0);
}

.gauge-track {
  stroke: rgba(255, 255, 255, 0.05);
  fill: none;
}

.gauge-progress {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}

.gauge-glow {
  filter: blur(6px);
  opacity: 0.6;
}

/* ============ Sentiment-based Gauge Colors ============ */
/* Data attribute selectors for theme-aware sentiment colors */

/* Greed sentiment (score >= 60) */
[data-sentiment="greed"] {
  --current-sentiment: var(--sentiment-greed);
  --current-sentiment-glow: var(--sentiment-greed-glow);
}

/* Neutral sentiment (40 <= score < 60) */
[data-sentiment="neutral"] {
  --current-sentiment: var(--sentiment-neutral);
  --current-sentiment-glow: var(--sentiment-neutral-glow);
}

/* Fear sentiment (score < 40) */
[data-sentiment="fear"] {
  --current-sentiment: var(--sentiment-fear);
  --current-sentiment-glow: var(--sentiment-fear-glow);
}

/* Apply sentiment colors to gauge elements */
[data-sentiment-glow="greed"] {
  filter: drop-shadow(0 0 var(--glow-spread) var(--sentiment-greed-glow)) !important;
}

[data-sentiment-glow="neutral"] {
  filter: drop-shadow(0 0 var(--glow-spread) var(--sentiment-neutral-glow)) !important;
}

[data-sentiment-glow="fear"] {
  filter: drop-shadow(0 0 var(--glow-spread) var(--sentiment-fear-glow)) !important;
}

[data-sentiment-stroke="greed"] {
  stroke: var(--sentiment-greed) !important;
}

[data-sentiment-stroke="neutral"] {
  stroke: var(--sentiment-neutral) !important;
}

[data-sentiment-stroke="fear"] {
  stroke: var(--sentiment-fear) !important;
}

/* Apply to gradient stops */
[data-sentiment-gradient="greed"] stop {
  stop-color: var(--sentiment-greed);
}

[data-sentiment-gradient="neutral"] stop {
  stop-color: var(--sentiment-neutral);
}

[data-sentiment-gradient="fear"] stop {
  stop-color: var(--sentiment-fear);
}

/* Apply to text elements */
[data-sentiment-text="greed"] {
  color: var(--sentiment-greed) !important;
  text-shadow: 0 0 var(--glow-spread) var(--sentiment-greed-glow) !important;
}

[data-sentiment-text="neutral"] {
  color: var(--sentiment-neutral) !important;
  text-shadow: 0 0 var(--glow-spread) var(--sentiment-neutral-glow) !important;
}

[data-sentiment-text="fear"] {
  color: var(--sentiment-fear) !important;
  text-shadow: 0 0 var(--glow-spread) var(--sentiment-fear-glow) !important;
}

[data-sentiment-label="greed"] {
  color: var(--sentiment-greed) !important;
}

[data-sentiment-label="neutral"] {
  color: var(--sentiment-neutral) !important;
}

[data-sentiment-label="fear"] {
  color: var(--sentiment-fear) !important;
}

/* ============ Input Styles ============ */
.input-terminal {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

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

.input-terminal:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}
.input-terminal:hover:not(:focus) {
  border-color: var(--border-subtle-hover);
}

.input-surface {
  background: var(--input-surface-bg);
  border-color: var(--input-surface-border);
  color: var(--text-primary);
  box-shadow: var(--shadow-soft-card);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease;
}

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

.input-surface:hover:not(:focus):not(:disabled) {
  border-color: var(--input-surface-border-hover);
}

.input-surface:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.input-focus-glow:focus,
.input-focus-glow:focus-within {
  border-color: var(--input-surface-border-focus);
  box-shadow: var(--shadow-soft-card), var(--input-surface-focus-ring);
}

/* ============ Badge Styles ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.badge-cyan {
  background: rgba(0, 212, 255, 0.15);
  color: var(--color-cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--color-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--color-success);
}

.badge-danger {
  background: rgba(255, 68, 102, 0.1);
  color: var(--color-danger);
}

/* ============ List Item Styles ============ */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.list-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-dim);
}

/* ============ Feed Item Styles ============ */
.feed-item {
  padding: 10px 0;
  border-left: 2px solid var(--border-accent);
  padding-left: 10px;
}

.feed-item + .feed-item {
  margin-top: 8px;
}

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

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

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

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

/* ============ Animations ============ */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px var(--color-cyan-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--color-cyan-glow);
  }
}

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInFromTopSm {
  from {
    opacity: 0;
    transform: translateY(-0.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromBottomMd {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-in {
  animation-duration: 200ms;
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

.animate-in.duration-200 {
  animation-duration: 200ms;
}

.animate-in.duration-300 {
  animation-duration: 300ms;
}

.fade-in {
  animation-name: fadeIn;
}

.zoom-in {
  animation-name: zoomIn;
}

.slide-in-from-top-1 {
  animation-name: slideInFromTopSm;
}

.slide-in-from-bottom-2 {
  animation-name: slideInFromBottomMd;
}

/* ============ Utilities ============ */
.text-cyan {
  color: var(--color-cyan);
}
.text-purple {
  color: hsl(var(--color-purple));
}
.text-success {
  color: hsl(var(--color-success));
}
.text-danger {
  color: hsl(var(--color-danger));
}
.text-warning {
  color: hsl(var(--color-warning));
}
.text-muted-text {
  color: var(--text-muted-text);
}
.text-secondary-text {
  color: var(--text-secondary-text);
}

.bg-base {
  background: var(--bg-base);
}
.bg-card {
  background: var(--bg-card);
}
.bg-elevated {
  background: var(--bg-elevated);
}

.bg-subtle {
  background: var(--bg-subtle);
}

.bg-subtle-hover:hover {
  background: var(--bg-subtle-hover);
}

.bg-subtle-active:active {
  background: var(--bg-subtle-active);
}

.border-accent {
  border-color: var(--border-accent);
}
.border-purple {
  border-color: var(--border-purple);
}
.border-cyan {
  border-color: var(--border-cyan);
}

.border-subtle {
  border-color: var(--border-subtle);
}

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

/* Glow utilities */
.glow-cyan {
  box-shadow: 0 0 20px var(--color-cyan-glow);
}

.glow-purple {
  box-shadow: 0 0 20px var(--color-purple-glow);
}

/* ============ Responsive ============ */
/* =========================================
   4. NEW UI COMPONENT UTILITIES (from Terminal PR)
   ========================================= */

a {
  color: inherit;
}

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

.terminal-card {
  --terminal-card-border: var(--border-default);
  --terminal-card-border-hover: var(--border-hover);
  --terminal-card-gradient-start: var(--border-accent);
  --terminal-card-gradient-mid: var(--border-purple);
  --terminal-card-gradient-end: var(--border-dim);
  --terminal-card-shadow: 0 18px 48px rgba(3, 8, 20, 0.18);
  --terminal-card-shadow-hover: 0 24px 56px rgba(3, 8, 20, 0.26);
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--terminal-card-border);
  background: linear-gradient(
    180deg,
    hsl(var(--card) / 0.96),
    hsl(var(--background) / 0.96)
  );
  box-shadow: var(--terminal-card-shadow);
}

.terminal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    var(--terminal-card-gradient-start) 0%,
    var(--terminal-card-gradient-mid) 52%,
    var(--terminal-card-gradient-end) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.terminal-card-hover {
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}

.terminal-card-hover:hover {
  --terminal-card-gradient-start: var(--terminal-card-border-hover);
  transform: translateY(-1px);
  border-color: var(--terminal-card-border-hover);
  box-shadow: var(--terminal-card-shadow-hover);
}

.gradient-border-card {
  position: relative;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    180deg,
    var(--border-accent) 0%,
    var(--border-purple) 50%,
    var(--border-dim) 100%
  );
  box-shadow: 0 18px 48px rgba(3, 8, 20, 0.2);
}

.gradient-border-card-inner {
  height: 100%;
  border-radius: calc(1rem - 1px);
  background: linear-gradient(
    180deg,
    hsl(var(--elevated) / 0.98),
    hsl(var(--card) / 0.98)
  );
}

.glass-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: hsl(var(--card) / 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(3, 8, 20, 0.22);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    var(--border-accent) 0%,
    var(--border-purple) 50%,
    var(--border-subtle) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-subtle-hover) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.home-panel-card {
  --terminal-card-border: var(--home-panel-border);
  --terminal-card-border-hover: var(--home-panel-border-hover);
  --terminal-card-gradient-start: var(--home-panel-gradient-start);
  --terminal-card-gradient-mid: var(--home-panel-gradient-mid);
  --terminal-card-gradient-end: var(--home-panel-gradient-end);
}

.dashboard-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  background: hsl(var(--card) / 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(3, 8, 20, 0.22);
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    var(--border-accent) 0%,
    var(--border-purple) 50%,
    var(--border-subtle) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.dashboard-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-subtle-hover) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.home-mobile-overlay {
  background-color: var(--home-mobile-overlay-bg);
}

.home-title-accent {
  color: var(--home-title-accent);
}

.home-subpanel {
  position: relative;
  overflow: hidden;
  border-radius: 0.875rem;
  border: 1px solid var(--home-panel-border);
  background: var(--home-panel-subtle-bg);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.home-subpanel:hover {
  border-color: var(--home-panel-border-hover);
  background: var(--home-panel-subtle-bg-hover);
}

.home-history-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.875rem;
  border: 1px solid transparent;
  background: var(--home-history-item-bg);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.home-history-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    var(--home-panel-gradient-mid) 0%,
    transparent 45%,
    var(--home-panel-gradient-start) 100%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.home-history-item:hover {
  border-color: var(--home-panel-border-hover);
  background: var(--home-history-item-hover-bg);
  transform: translateY(-1px);
}

.home-history-item:hover::before {
  opacity: 0.72;
}

.home-history-item-selected {
  border-color: var(--home-panel-border-selected);
  background: var(--home-history-item-selected-bg);
  box-shadow: var(--home-panel-selected-shadow);
}

.home-history-item-selected::before {
  opacity: 1;
}

.home-surface-button {
  border: 1px solid var(--home-surface-button-border);
  background: var(--home-surface-button-bg);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.home-surface-button:hover {
  border-color: var(--home-surface-button-border-hover);
  background: var(--home-surface-button-bg-hover);
}

.home-accent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  border: 1px solid var(--home-accent-border);
  background: var(--home-accent-bg);
  color: var(--home-accent-text);
}

.home-accent-link {
  color: var(--home-accent-text);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.home-accent-link:hover {
  color: hsl(var(--foreground));
}

.home-accent-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  border: 1px solid var(--home-accent-border);
  background: var(--home-accent-bg);
  color: var(--home-accent-text);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.home-accent-pill-link:hover {
  border-color: var(--home-accent-border-hover);
  background: var(--home-accent-bg-hover);
  color: hsl(var(--foreground));
}

.home-spinner {
  border-style: solid;
  border-radius: 9999px;
  border-color: var(--home-loading-ring-track);
  border-top-color: var(--home-loading-ring-head);
}

.home-divider {
  border-color: var(--home-divider-border);
}

.home-markdown-prose :where(h1) {
  border-bottom: 1px solid var(--home-prose-border);
  padding-bottom: 0.5rem;
}

.home-markdown-prose :where(h2) {
  color: hsl(var(--color-purple));
}

.home-markdown-prose :where(code) {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  border-radius: 0.375rem;
  padding: 0.125rem 0.375rem;
}

.home-markdown-prose :where(pre) {
  border: 1px solid var(--home-prose-border);
  background: hsl(var(--elevated) / 0.92);
}

.home-markdown-prose :where(th, td) {
  border: 1px solid var(--home-prose-border-strong);
}

.home-markdown-prose :where(th) {
  background: hsl(var(--elevated) / 0.92);
  color: hsl(var(--foreground));
}

.home-markdown-prose :where(hr) {
  border-color: var(--home-prose-border);
}

.home-markdown-prose :where(a) {
  color: hsl(var(--primary));
}

.home-markdown-prose :where(blockquote) {
  border-color: var(--home-prose-blockquote-border);
  background: var(--home-prose-blockquote-bg);
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 0.5rem 1rem;
  color: var(--text-secondary-text);
}
.label-uppercase {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-secondary-text);
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.9rem;
  padding: 0.7rem 1.1rem;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.btn-primary {
  border: 1px solid rgba(0, 212, 255, 0.26);
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.96),
    rgba(0, 168, 204, 0.96)
  );
  color: #041118;
  box-shadow: 0 12px 28px rgba(0, 212, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 18px 34px rgba(0, 212, 255, 0.22);
}

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

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--border-accent);
  background: var(--bg-subtle-hover);
  color: var(--text-primary);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none;
}

.bg-hover {
  background: var(--bg-hover);
}

.bg-primary-gradient {
  background: var(--gradient-primary);
}

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

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

.shadow-soft-card {
  box-shadow: var(--shadow-soft-card);
}

.shadow-soft-card-strong {
  box-shadow: var(--shadow-soft-card-strong);
}

.settings-surface {
  background: var(--settings-surface);
}

.settings-surface-hover {
  background: var(--settings-surface-hover);
}

.settings-surface-strong {
  background: var(--settings-surface-strong);
}

.settings-surface-panel {
  background: var(--settings-surface-panel);
}

.settings-surface-overlay {
  background: var(--settings-surface-overlay);
}

.settings-surface-overlay-soft {
  background: var(--settings-surface-overlay-soft);
}

.settings-surface-overlay-muted {
  background: var(--settings-surface-overlay-muted);
}

.settings-border {
  border-color: var(--settings-border);
}

.settings-border-soft {
  border-color: var(--settings-border-soft);
}

.settings-border-strong {
  border-color: var(--settings-border-strong);
}

.settings-border-overlay {
  border-color: var(--settings-border-overlay);
}

.settings-shadow-accent {
  box-shadow: 0 0 15px var(--settings-accent-shadow);
}

.settings-button-primary {
  border-color: var(--settings-primary-border);
  background: var(--settings-primary-gradient);
  color: var(--settings-primary-text);
  box-shadow: 0 12px 28px var(--settings-primary-shadow);
}

.settings-button-primary:hover {
  box-shadow: 0 18px 34px var(--settings-primary-shadow-hover);
}

.settings-button-secondary {
  border-color: var(--settings-secondary-border);
  background: var(--settings-secondary-bg);
  color: var(--text-secondary-text);
}

.settings-button-secondary:hover {
  border-color: var(--settings-secondary-border-hover);
  background: var(--settings-secondary-bg-hover);
  color: var(--text-primary);
}

.settings-glow-cyan-hover:hover {
  box-shadow: 0 0 30px var(--settings-glow-hover);
}

.settings-accent-text {
  color: hsl(var(--primary));
}

.settings-accent-badge {
  border-color: var(--settings-primary-border);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.settings-accent-badge-soft {
  border-color: var(--settings-primary-border);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
}

.settings-drag-active {
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.06);
}

.settings-input-checkbox {
  accent-color: hsl(var(--primary));
}

.settings-panel-muted {
  border-color: var(--settings-border);
  background: var(--settings-surface-strong);
}

.settings-panel-muted-soft {
  border-color: hsl(var(--border) / 0.3);
  background: hsl(var(--background) / 0.1);
}

.settings-skeleton-strong {
  background: var(--settings-skeleton-strong);
}

.settings-skeleton-soft {
  background: var(--settings-skeleton-soft);
}

.shell-page-frame {
  position: relative;
  overflow: hidden;
}

.shell-page-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle closest-side at 100% 0%, hsl(var(--primary) / 0.12), transparent 28%),
    radial-gradient(circle closest-side at 0% 100%, rgba(111, 97, 241, 0.1), transparent 24%);
  opacity: 0.9;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease-out;
}
