/* CSS Design System for StockScore */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Common variables */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 32px;
  
  /* Color theme: Light (Apple-inspired docs) */
  --bg: #FBFBFD;
  --bg-card: #FFFFFF;
  --border: #E5E5E7;
  --border-hover: #D2D2D7;
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --accent-primary: #0066CC;
  --accent-primary-hover: #0077ED;
  --accent-bg: #F5F5F7;
  
  /* Indicators */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.08);
  --success-border: rgba(16, 185, 129, 0.2);
  
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --warning-border: rgba(245, 158, 11, 0.2);
  
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.08);
  --danger-border: rgba(239, 68, 68, 0.2);

  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.08);
  --info-border: rgba(59, 130, 246, 0.2);
  
  --score-color: var(--success);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.03), 0 1px 3px 0 rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 12px 32px 0 rgba(0, 0, 0, 0.04), 0 2px 8px 0 rgba(0, 0, 0, 0.02);
  --shadow-search: 0 20px 40px 0 rgba(0, 0, 0, 0.06), 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] {
  /* Color theme: Dark (Premium Carbon/Web3) */
  --bg: #0B0B0C;
  --bg-card: #151517;
  --border: #222225;
  --border-hover: #2D2D31;
  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-tertiary: #636366;
  --accent-primary: #2F80ED;
  --accent-primary-hover: #4FA0FF;
  --accent-bg: #1C1C1E;
  
  /* Indicators */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.3);
  
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);
  
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);

  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.3);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px 0 rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px 0 rgba(0, 0, 0, 0.5);
  --shadow-search: 0 24px 48px 0 rgba(0, 0, 0, 0.6), 0 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Global Reset & Base Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  outline: none;
}

/* Layout */
.app-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0;
  border-bottom: 1px solid transparent;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #a855f7 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  background: var(--bg-card);
}

.theme-toggle-btn:hover {
  background: var(--accent-bg);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Main Views Wrapper */
main {
  flex: 1;
  position: relative;
}

.view-state {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

.view-state.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== HOMEPAGE STATE ==================== */
.home-view {
  text-align: center;
  padding: 80px 0 100px 0;
  max-width: 640px;
  margin: 0 auto;
}

.home-tagline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
  color: var(--text-primary);
}

/* Search Wrapper & Autocomplete System */
.search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 40px;
}

.search-input-container {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 18px;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.search-input-container:focus-within {
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-search);
}

.search-icon {
  color: var(--text-tertiary);
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

.main-search-input {
  width: 100%;
  height: 54px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  outline: none;
}

.main-search-input::placeholder {
  color: var(--text-tertiary);
}

/* Autocomplete Panel */
.autocomplete-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-search);
  z-index: 100;
  overflow: hidden;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  max-height: 380px;
  overflow-y: auto;
}

.autocomplete-panel.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.autocomplete-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 16px 20px 8px 20px;
  border-bottom: 1px solid var(--border);
}

.autocomplete-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border);
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

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

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-symbol {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestion-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-secondary);
}

.suggestion-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.suggestion-score-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestion-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.suggestion-rating {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
}

.no-results-msg {
  padding: 24px 20px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 14px;
}

/* Popular Stocks Section */
.popular-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.popular-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.popular-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.popular-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.popular-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.popular-pill span {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: 6px;
}


/* ==================== STOCK PAGE STATE ==================== */
.stock-view {
  padding-bottom: 80px;
}

/* Stock Page Header Search */
.stock-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all var(--transition-fast);
  background: var(--bg-card);
}

.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  transform: translateX(-2px);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.header-search-container {
  position: relative;
  width: 280px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 12px;
  transition: all var(--transition-fast);
}

.header-search-container:focus-within {
  border-color: var(--text-secondary);
  width: 320px;
}

.header-search-input {
  width: 100%;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.header-search-input::placeholder {
  color: var(--text-tertiary);
}

.header-search-container svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  margin-right: 8px;
}

/* Stock Header Section */
.stock-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
  gap: 32px;
  flex-wrap: wrap;
}

.stock-identity-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stock-name-symbol {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stock-symbol {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--accent-bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.stock-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stock-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.stock-change {
  font-size: 15px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.stock-change.positive {
  color: var(--success);
  background: var(--success-bg);
}

.stock-change.negative {
  color: var(--danger);
  background: var(--danger-bg);
}

/* Hero Score Card */
.score-badge-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 20px 32px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border-left: 6px solid var(--score-color);
}

.score-number-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.score-main-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 52px;
  line-height: 1;
  color: var(--text-primary);
}

.score-max-denom {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 1px;
}

.score-rating-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rating-badge {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  display: inline-block;
  text-align: center;
}

.rating-badge.strong {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.rating-badge.good {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
  filter: hue-rotate(15deg);
}

.rating-badge.average {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.rating-badge.weak {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  filter: hue-rotate(25deg);
}

.rating-badge.high-risk {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.last-updated {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Two-column layout details */
.stock-grid-2col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 820px) {
  .stock-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Why This Score Card */
.why-score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title-simple {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-simple svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.why-score-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.why-score-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 400;
}

.why-score-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
}

/* Overall Health */
.health-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

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

.progress-value {
  color: var(--text-primary);
  font-weight: 600;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill,
.progress-bar {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width var(--transition-slow);
}

.progress-fill.strong,
.progress-bar.strong,
.progress-fill.good,
.progress-bar.good {
  background-color: var(--success);
}

.progress-fill.average,
.progress-bar.average {
  background-color: var(--warning);
}

.progress-fill.weak,
.progress-bar.weak {
  background-color: var(--danger);
}

/* Key Metrics Grid */
.metrics-section {
  margin-bottom: 48px;
}

.metrics-section-header {
  margin-bottom: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-secondary);
  box-shadow: var(--shadow-md);
}

.metric-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.info-icon-btn {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
  padding: 2px;
  border-radius: 4px;
}

.info-icon-btn:hover {
  color: var(--text-primary);
  background: var(--accent-bg);
}

.info-icon-btn svg {
  width: 14px;
  height: 14px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Strengths & Weaknesses Panel */
.procon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

@media (max-width: 640px) {
  .procon-grid {
    grid-template-columns: 1fr;
  }
}

.procon-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.procon-card.strengths-card {
  border-top: 4px solid var(--success);
}

.procon-card.weaknesses-card {
  border-top: 4px solid var(--danger);
}

.procon-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.procon-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.procon-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
}

.procon-icon {
  margin-top: 2px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.strengths-card .procon-icon {
  color: var(--success);
}

.weaknesses-card .procon-icon {
  color: var(--danger);
}

/* About and Similar Stocks Footer Section */
.about-similar-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 820px) {
  .about-similar-grid {
    grid-template-columns: 1fr;
  }
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.about-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 16px;
}

.similar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.similar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.similar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.similar-item:hover {
  border-color: var(--text-secondary);
  background: var(--accent-bg);
  transform: translateX(2px);
}

.similar-name-symbol {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.similar-symbol {
  font-weight: 600;
  font-size: 14px;
}

.similar-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.similar-price-group {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.similar-price {
  font-weight: 600;
  font-size: 14px;
}

.similar-change {
  font-size: 11px;
  font-weight: 500;
}

.similar-change.positive {
  color: var(--success);
}

.similar-change.negative {
  color: var(--danger);
}


/* ==================== METRIC EXPLANATION SIDE DRAWER ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 440px;
  padding: 32px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
  position: relative;
  margin: 0 16px;
}

.modal-overlay.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

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

.modal-close-btn svg {
  width: 20px;
  height: 20px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 12px;
  margin-bottom: 20px;
}

.modal-formula {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-primary);
  margin-top: 12px;
  word-break: break-all;
}

.modal-formula-title {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}


/* ==================== FOOTER ==================== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: auto;
}

.disclaimer {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Dynamic score colors for detail score badge card */
.score-badge-card.strong,
.score-badge-card.good {
  border-left-color: var(--success);
}
.score-badge-card.average {
  border-left-color: var(--warning);
}
.score-badge-card.weak,
.score-badge-card.high-risk {
  border-left-color: var(--danger);
}

/* Score Warning Note style relocated from templates/stock.html */
#score-warning-note {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 32px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}
#score-warning-note.visible {
  display: flex;
}

/* ==================== MOBILE RESPONSIVE ADAPTATIONS ==================== */

.constituents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 820px) {
  .knowledge-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .home-sections-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-top: 32px !important;
  }
}

@media (max-width: 580px) {
  header {
    padding: 20px 0;
  }
  
  .home-view {
    padding: 40px 0 60px 0;
  }
  
  .stock-navigation {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .header-search-container {
    width: 100% !important;
  }
  
  .header-search-container:focus-within {
    width: 100% !important;
  }
  
  .stock-header {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    margin-bottom: 32px;
  }
  
  .score-badge-card {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }
  
  .constituents-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 0 16px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .metric-card {
    padding: 14px;
    gap: 8px;
  }
  
  .metric-value {
    font-size: 16px;
  }
  
  .metric-label {
    font-size: 11px;
  }
  
  .score-main-value {
    font-size: 42px;
  }
  
  .rating-badge {
    font-size: 15px;
    padding: 4px 10px;
  }
  
  .stock-name {
    font-size: 26px;
  }
}


