/* AMI — Automotive Market Intelligence Theme
   Aesthetic: JP/KR OEM precision — clean grids, generous whitespace (間),
   deep indigo navy, restrained accents, Noto Sans for pan-CJK readability */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-primary: #f7f8fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f6;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f8;
    --fg-primary: #2d3748;
    --fg-secondary: #5a6578;
    --fg-heading: #111827;
    --fg-muted: #8b95a5;
    --accent-primary: #2b4acb;
    --accent-secondary: #3b6df0;
    --accent-tertiary: #0d9488;
    --border-color: #dfe3ec;
    --border-light: #c7cdd8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 28px rgba(0,0,0,0.08);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-xs: 4px;
    /* Market outlook colors */
    --outlook-bullish: #0d9488;
    --outlook-bearish: #dc2626;
    --outlook-neutral: #6b7280;
    --outlook-uncertain: #d97706;
    /* Automotive domain colors */
    --domain-mkt:   #2563eb;
    --domain-tech:  #7c3aed;
    --domain-reg:   #dc2626;
    --domain-sc:    #ea580c;
    --domain-comp:  #0891b2;
    --domain-fin:   #059669;
    --domain-lab:   #d97706;
    --domain-infra: #4f46e5;
    --domain-esg:   #16a34a;
    /* Kano class colors */
    --kano-must: #dc2626;
    --kano-one-dim: #2563eb;
    --kano-attractive: #059669;
    --kano-indifferent: #94a3b8;
    /* Brand */
    --brand-primary: #1e3a8a;
    --brand-secondary: #2b4acb;
    --brand-accent: #0d9488;
    /* DS metric colors */
    --ds-belief: #0d9488;
    --ds-plausibility: #2b4acb;
    --ds-uncertainty: #d97706;
    --ds-conflict: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-primary);
    color: var(--fg-primary);
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Classification Banner (legacy — hidden) */
.classification-banner { display: none; }

/* Header — deep navy, precision feel */
.intel-header {
    background: #111827;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand h1, .intel-header h1 {
    color: #f1f5f9;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.4px;
}

.intel-header nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.intel-header nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    transition: all 0.15s ease;
    letter-spacing: 0.2px;
}

.intel-header nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
}

.intel-header nav a.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Container — generous margins */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 36px;
}

/* Cards — sharp, precise */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2, .card-header h3 {
    color: var(--fg-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Market Outlook Badges */
.outlook-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.outlook-bullish    { background: #ecfdf5; color: var(--outlook-bullish); border: 1px solid #a7f3d0; }
.outlook-bearish    { background: #fef2f2; color: var(--outlook-bearish); border: 1px solid #fecaca; }
.outlook-neutral    { background: #f8fafc; color: var(--outlook-neutral); border: 1px solid #e2e8f0; }
.outlook-uncertain  { background: #fffbeb; color: var(--outlook-uncertain); border: 1px solid #fde68a; }

/* Market Impact */
.impact-bullish    { color: #0d9488; }
.impact-bearish    { color: #dc2626; }
.impact-neutral    { color: #6b7280; }
.impact-disruptive { color: #7c3aed; }

/* Domain Badges */
.domain-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-right: 4px;
    color: #fff;
}

.domain-mkt   { background: var(--domain-mkt); }
.domain-tech  { background: var(--domain-tech); }
.domain-reg   { background: var(--domain-reg); }
.domain-sc    { background: var(--domain-sc); }
.domain-comp  { background: var(--domain-comp); }
.domain-fin   { background: var(--domain-fin); }
.domain-lab   { background: var(--domain-lab); }
.domain-infra { background: var(--domain-infra); }
.domain-esg   { background: var(--domain-esg); }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-running { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.status-completed { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.status-pending { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* Buttons — precise, minimal */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    color: var(--fg-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 6px;
}

.btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}

.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: #233fb5;
    border-color: #233fb5;
}

/* Tables — dense, precise alignment */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

th {
    background: var(--bg-tertiary);
    color: var(--fg-secondary);
    padding: 9px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

th:first-child { border-radius: var(--radius-xs) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-xs) 0 0; }

td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--fg-primary);
}

tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* Forms */
input, select, textarea {
    background: var(--bg-secondary);
    color: var(--fg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 9px 14px;
    font-family: inherit;
    font-size: 13px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(43,74,203,0.1);
}

label {
    display: block;
    color: var(--fg-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 5px;
}

.form-group { margin-bottom: 18px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* DS Metric Bars */
.ds-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    margin: 5px 0;
}

.ds-bar-label {
    width: 80px;
    color: var(--fg-secondary);
    font-size: 11px;
    font-weight: 500;
}

.ds-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.ds-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.ds-bar-value {
    width: 44px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* Evidence Cards */
.evidence-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary);
    padding: 14px 16px;
    margin: 8px 0;
    font-size: 13px;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    transition: box-shadow 0.15s ease;
}

.evidence-card:hover { box-shadow: var(--shadow-sm); }

.evidence-card .evidence-meta {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--fg-muted);
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Stat cards — clean numbers */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--fg-heading);
    letter-spacing: -0.5px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-muted);
    margin-top: 4px;
    font-weight: 600;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar — thin, unobtrusive */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); }

/* Links */
a { color: var(--accent-primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: #1e3a8a; }

/* Pre/Code */
pre, code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
}

pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

/* Section headers */
.section-header {
    color: var(--fg-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Mermaid diagrams */
.mermaid {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--fg-muted);
}

.empty-state h3 {
    color: var(--fg-secondary);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Hero Banner */
.hero-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 40px 48px;
    background: linear-gradient(135deg, #111827 0%, #1e3a8a 100%);
    border-radius: var(--radius);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 50%, rgba(255,255,255,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.hero-eyebrow {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.5;
    display: block;
    margin-bottom: 8px;
}

.hero-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
    letter-spacing: -0.3px;
}

.hero-content p {
    font-size: 13px;
    line-height: 1.65;
    opacity: 0.7;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 9px 18px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-xs);
    color: #fff !important;
    font-weight: 600;
    font-size: 13px;
    backdrop-filter: blur(8px);
    transition: all 0.15s ease;
    text-decoration: none;
}

.hero-cta:hover {
    background: rgba(255,255,255,0.2);
    color: #fff !important;
}

.hero-graphic {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* Stat icon */
.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

/* Footer — minimal */
.site-footer {
    max-width: 1240px;
    margin: 20px auto 0;
    padding: 16px 36px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--fg-muted);
}

/* Action button group */
.action-group {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.action-group .btn {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: var(--radius-xs);
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover { background: #fee2e2; }

/* Example query items */
.example-list { display: flex; flex-direction: column; gap: 8px; }
.example-item {
    padding: 11px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--fg-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.example-item:hover {
    border-color: var(--accent-primary);
    background: #eef2ff;
    color: var(--accent-primary);
}

/* Range input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    border: none;
    padding: 0;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

input[type="range"]:focus { box-shadow: none; }

/* Checkbox */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 3px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Tooltip for glossary terms */
.glossary-term {
    border-bottom: 1px dashed var(--fg-muted);
    cursor: help;
    position: relative;
}

.glossary-term:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    margin-bottom: 4px;
    max-width: 280px;
    white-space: normal;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .intel-header { flex-direction: column; gap: 8px; height: auto; padding: 12px 16px; }
    .container { padding: 16px; }
    .hero-banner { flex-direction: column; text-align: center; padding: 32px 24px; }
    .hero-graphic { display: none; }
    .site-footer { flex-direction: column; gap: 8px; text-align: center; }
}
