/* Components - Modern FinTech Design System for AnalystAI */

/* Site Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  background-color: rgba(var(--paper-rgb), 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--highlight) 100%);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px var(--glow-accent);
}

.brand-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  background-color: #FFFFFF;
  border-radius: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.nav-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background-color: var(--accent-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Control Selectors */
.select-compact, .btn-icon {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.select-compact:hover, .btn-icon:hover {
  border-color: var(--accent);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-button);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: var(--glow-button);
}

.btn-primary:hover {
  opacity: 0.95;
  color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(13, 122, 134, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--paper-2);
  color: var(--ink);
  border-color: var(--rule);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--paper-3);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.875rem;
}

/* Form Inputs */
.input-group {
  margin-bottom: 22px;
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.input-hint {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-2);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  color: var(--ink-2);
  font-weight: 600;
  pointer-events: none;
  font-family: var(--font-sans);
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-input);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.input-with-prefix .input-field {
  padding-left: 36px;
}

.input-field:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--glow-accent);
  background-color: var(--paper-2);
}

.input-field.error {
  border-color: var(--bad);
}

.field-error-msg {
  display: block;
  font-size: 0.8125rem;
  color: var(--bad);
  margin-top: 5px;
}

/* THE ANSWER BLOCK (Signature Highlight Element) */
.answer-block {
  background: var(--highlight-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 5px solid var(--highlight);
  border-radius: var(--radius-answer);
  padding: 26px 28px;
  margin-top: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.12);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.answer-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--highlight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.answer-figure {
  font-family: var(--font-serif);
  font-size: 3rem; /* 48px desktop */
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  transition: opacity 150ms ease;
  letter-spacing: -0.02em;
}

.answer-interpretation {
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0;
  line-height: 1.55;
  font-weight: 500;
}

@media (max-width: 640px) {
  .answer-figure {
    font-size: 2.25rem; /* 36px mobile */
  }
}

/* Steps Breakdown */
.steps-container {
  background-color: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}

.steps-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--ink);
}

.step-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.step-row:last-child {
  border-bottom: none;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--ink-2);
  margin-bottom: 24px;
  list-style: none;
}

.breadcrumbs a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  opacity: 0.4;
}

/* Tables */
.table-ledger {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.95rem;
  border-radius: var(--radius-panel);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-ledger th, .table-ledger td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

.table-ledger th {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  background-color: var(--paper-2);
}

.table-ledger td.num, .table-ledger th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Callouts */
.callout {
  padding: 20px 24px;
  border-left: 4px solid var(--rule);
  background-color: var(--paper-2);
  border-radius: var(--radius-panel);
  margin: 28px 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-card);
}

.callout-note {
  border-left-color: var(--accent);
}

.callout-warn {
  border-left-color: var(--warn);
}

/* Category & Hub Cards */
.hub-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

/* RESERVED AD SLOTS */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 36px auto;
  width: 100%;
  max-width: 100%;
  position: relative;
  background-color: transparent;
}

.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 0.75rem;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ad-slot[data-slot="tool-below-result"] {
  min-height: 280px;
}

.ad-slot[data-slot="in-article-1"],
.ad-slot[data-slot="in-article-2"] {
  min-height: 280px;
}

.ad-slot[data-slot="sidebar-sticky"] {
  min-height: 600px;
}

@media (max-width: 640px) {
  .ad-slot[data-slot="tool-below-result"] {
    min-height: 250px;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  background-color: var(--paper-2);
  padding: 56px 0 36px;
  margin-top: auto;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 44px;
}

.footer-col h4 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--ink);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-2);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
