/* === DEEP ANALYSIS PAGE === */
.an-page {
  min-height: calc(100vh - 64px);
  padding: 40px 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

/* === SEARCH BAR === */
.an-search-section {
  margin-bottom: 40px;
}
.an-page-title {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 24px;
  line-height: 1.1;
}
.an-search-wrap {
  position: relative;
  max-width: 480px;
}
.an-search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.an-search-input::placeholder { color: var(--fg-muted); }
.an-search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.an-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
}
.an-search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.an-suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.an-suggestion-item:last-child { border-bottom: none; }
.an-suggestion-item:hover { background: rgba(255,255,255,0.04); }
.an-suggestion-ticker {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.an-suggestion-name {
  font-size: 13px;
  color: var(--fg-muted);
  margin-left: 12px;
}
.an-suggestion-exchange {
  font-size: 11px;
  color: var(--fg-muted);
  opacity: 0.6;
  background: rgba(255,255,255,0.04);
  padding: 3px 8px;
  border-radius: 6px;
}
.an-empty-state {
  text-align: center;
  padding: 80px 40px;
}
.an-empty-title {
  font-size: 28px;
  margin-bottom: 14px;
}
.an-empty-sub {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto;
}

/* === ANALYSIS HEADER === */
.an-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.an-company-name {
  font-size: 32px;
  margin-bottom: 6px;
}
.an-company-meta {
  font-size: 14px;
  color: var(--fg-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.an-company-meta span { display: flex; align-items: center; gap: 6px; }
.an-price-block { text-align: right; }
.an-price-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 42px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.an-market-cap {
  font-size: 14px;
  color: var(--fg-muted);
}

/* === SECTION CARDS === */
.an-section {
  margin-bottom: 40px;
}
.an-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.an-section-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-dim);
  border: 1px solid rgba(244, 185, 66, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.an-section-title {
  font-size: 20px;
}
.an-section-sub {
  font-size: 12px;
  color: var(--fg-muted);
}

/* === DATA TABLE === */
.an-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.an-table {
  width: 100%;
  border-collapse: collapse;
}
.an-table thead tr {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.an-table th {
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: left;
}
.an-table th:last-child,
.an-table th:nth-last-child(2) { text-align: right; }
.an-table td {
  padding: 13px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.an-table tbody tr:last-child td { border-bottom: none; }
.an-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.an-table .an-metric-name {
  color: var(--fg-muted);
  font-weight: 500;
}
.an-table .an-metric-value {
  color: var(--fg);
  font-weight: 600;
  text-align: right;
}
.an-table .an-metric-highlight {
  color: var(--accent);
  font-weight: 700;
}
.an-table .an-metric-change {
  font-size: 12px;
  text-align: right;
}
.an-growth-positive { color: #3DD68C; }
.an-growth-negative { color: #EF4444; }
.an-bar-wrap { display: flex; align-items: center; gap: 12px; }
.an-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.an-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
}
.an-vs-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}
.an-vs-above { background: rgba(61, 214, 140, 0.1); color: #3DD68C; border: 1px solid rgba(61, 214, 140, 0.2); }
.an-vs-below { background: rgba(239, 68, 68, 0.1); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* === CHART BARS === */
.an-chart-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr 1fr;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.an-chart-row:last-child { border-bottom: none; }
.an-chart-metric {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 500;
  padding: 14px 16px;
}
.an-chart-bar-wrap {
  padding: 10px 8px;
}
.an-chart-bar {
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.2));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
  min-width: 40px;
  transition: width 0.6s ease;
}
.an-chart-bar.projected {
  background: linear-gradient(90deg, rgba(244, 185, 66, 0.4), rgba(244, 185, 66, 0.15));
  border: 1px dashed rgba(244, 185, 66, 0.3);
}

/* === RATIO GRID === */
.an-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.an-ratio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  transition: border-color 0.2s;
}
.an-ratio-card:hover { border-color: rgba(139, 92, 246, 0.2); }
.an-ratio-label {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.an-ratio-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  color: var(--fg);
}
.an-ratio-sub {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* === TECHNICALS === */
.an-tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.an-tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.an-tech-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.an-tech-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.an-trend-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.an-trend-bullish { background: rgba(61, 214, 140, 0.1); color: #3DD68C; }
.an-trend-bearish { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.an-trend-neutral { background: rgba(255,255,255,0.06); color: var(--fg-muted); }

.an-tech-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px;
  color: var(--fg);
  margin-bottom: 4px;
}
.an-tech-sub {
  font-size: 12px;
  color: var(--fg-muted);
}
.an-rsi-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #EF4444 0%, #F4B942 40%, #3DD68C 100%);
  margin: 12px 0 6px;
  position: relative;
}
.an-rsi-marker {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: #fff;
  border-radius: 1px;
  transform: translateX(-50%);
}
.an-rsi-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--fg-muted);
}

/* === RECOMMENDATION === */
.an-recommendation {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
}
.an-rec-badge {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 36px;
  font-weight: 400;
}
.an-rec-buy { color: #3DD68C; }
.an-rec-hold { color: var(--accent); }
.an-rec-sell { color: #EF4444; }
.an-rec-info strong { font-size: 18px; display: block; margin-bottom: 4px; }
.an-rec-info p { font-size: 14px; color: var(--fg-muted); line-height: 1.6; }
.an-rec-price-target {
  margin-left: auto;
  text-align: right;
}
.an-rec-price-label { font-size: 12px; color: var(--fg-muted); margin-bottom: 6px; }
.an-rec-price-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  color: var(--accent);
}

/* === YEAR HEADERS FOR TABLES === */
.an-year-group {
  margin-bottom: 8px;
}

/* === DEMO BANNER === */
.an-demo-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(244, 185, 66, 0.08);
  border: 1px solid rgba(244, 185, 66, 0.2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 24px;
}

/* === BS SUMMARY === */
.an-bs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .an-page { padding: 24px 24px 60px; }
  .an-header { flex-direction: column; gap: 20px; }
  .an-price-block { text-align: left; }
  .an-chart-row { grid-template-columns: 1fr; gap: 4px; }
  .an-chart-bar-wrap { padding: 4px 0; }
  .an-ratio-grid { grid-template-columns: repeat(2, 1fr); }
  .an-tech-grid { grid-template-columns: 1fr; }
  .an-bs-grid { grid-template-columns: 1fr; }
  .an-recommendation { flex-direction: column; gap: 12px; }
  .an-rec-price-target { margin-left: 0; text-align: left; }
}