/* Spin Rate — project-specific overrides only.
   Design tokens live in lailara-frame.css (do not duplicate). */

/* Tab styling — !important overrides Dash's inline styles */
.custom-tabs {
    border-bottom: 2px solid var(--ll-london-85) !important;
    margin-bottom: var(--ll-space-lg);
}

.custom-tab {
    font-family: var(--ll-sans) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--ll-london-35) !important;
    padding: 12px 20px !important;
    border: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
    cursor: pointer;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px;
    transition: color var(--ll-duration-fast) var(--ll-ease-out);
}

.custom-tab:hover {
    color: var(--ll-london-20) !important;
}

.custom-tab--selected {
    color: var(--ll-chicago-20) !important;
    border-bottom: 3px solid var(--ll-chicago-20) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
}

/* Dash dropdown — override Dash 4.x default purple accent */
.dash-dropdown {
    accent-color: var(--ll-chicago-20) !important;
    outline-color: var(--ll-chicago-20) !important;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ll-space-base);
    align-items: flex-end;
    padding: var(--ll-space-base) 0;
    border-bottom: 1px solid var(--ll-london-85);
    margin-bottom: var(--ll-space-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--ll-space-xs);
    min-width: 180px;
}

.filter-group label {
    font-family: var(--ll-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--ll-london-35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--ll-space-3xl) var(--ll-space-lg);
    color: var(--ll-london-35);
    font-family: var(--ll-sans);
    font-size: 17px;
}

.empty-state button {
    margin-top: var(--ll-space-base);
    background: var(--ll-chicago-20);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--ll-radius);
    font-family: var(--ll-sans);
    font-weight: 600;
    cursor: pointer;
}

.empty-state button:hover {
    background: var(--ll-chicago-10);
}

/* Error banner */
.error-banner {
    background: var(--ll-red-95);
    color: var(--ll-red-18);
    padding: var(--ll-space-md) var(--ll-space-base);
    border-radius: var(--ll-radius);
    font-family: var(--ll-sans);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: var(--ll-space-sm);
}

/* Loading spinner override */
._dash-loading-callback {
    background-color: rgba(245, 243, 238, 0.7) !important;
}

/* Dark callout card */
.dark-callout {
    background: var(--ll-card-bg);
    color: var(--ll-card-text);
    padding: var(--ll-space-base) var(--ll-space-lg);
    border-radius: var(--ll-radius);
    margin: var(--ll-space-base) 0;
    transition: opacity var(--ll-duration-normal) var(--ll-ease-out);
}

.dark-callout-title {
    font-family: var(--ll-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--ll-card-text);
    margin-bottom: var(--ll-space-sm);
}

.dark-callout-subtitle {
    font-family: var(--ll-sans);
    font-size: 14px;
    color: var(--ll-card-subtitle);
}

.dark-callout-row {
    display: flex;
    justify-content: space-between;
    padding: var(--ll-space-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--ll-sans);
    font-size: 14px;
    color: var(--ll-card-item);
}

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

/* Annotation / insight line */
.insight-line {
    border-left: 3px solid var(--ll-london-85);
    padding: var(--ll-space-sm) var(--ll-space-base);
    font-family: var(--ll-sans);
    font-size: 15px;
    color: var(--ll-london-35);
    margin: var(--ll-space-base) 0;
    line-height: 1.5;
}

/* SPPD formula note */
.formula-note {
    font-family: var(--ll-sans);
    font-size: 13px;
    color: var(--ll-london-40);
    font-style: italic;
    padding: var(--ll-space-sm) 0;
    border-top: 1px solid var(--ll-london-85);
    margin-top: var(--ll-space-base);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .filter-bar {
        flex-direction: column;
        gap: var(--ll-space-sm);
    }

    .filter-group {
        min-width: 100%;
    }

    .custom-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Print — hide interactive controls */
@media print {
    .filter-bar,
    .custom-tabs,
    .dark-callout { display: none; }
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ll-chicago-20);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    font-family: var(--ll-sans);
}

.skip-link:focus {
    top: 0;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--ll-london-20);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Narrative intro (U7) ── */

.narrative-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px 32px;
}

.narrative-content {
    max-width: 660px;
}

.narrative-title {
    font-family: var(--ll-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--ll-london-5);
    letter-spacing: -0.02em;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.narrative-body {
    font-family: var(--ll-sans);
    font-size: 17px;
    font-weight: 400;
    color: var(--ll-london-20);
    line-height: 1.6;
    margin: 0 0 12px 0;
    max-width: 660px;
}

.narrative-protagonist {
    margin: 24px 0;
    padding-left: 16px;
    border-left: 3px solid var(--ll-london-85);
}

.narrative-archetype-label {
    font-family: var(--ll-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--ll-london-5);
    margin: 0 0 4px 0;
}

.narrative-transition {
    font-family: var(--ll-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--ll-london-35);
    margin: 32px 0 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--ll-london-85);
}

@media (max-width: 640px) {
    .narrative-section {
        padding: 32px 16px 24px;
    }

    .narrative-title {
        font-size: 22px;
    }

    .narrative-body {
        font-size: 15px;
    }
}

@media print {
    .narrative-section {
        padding: 24px 0;
    }
}

/* ── Quadrant view (U3) ── */

/* Quadrant detail card container */
#quadrant-detail-card {
    min-width: 320px;
}

#quadrant-detail-card .dark-callout {
    min-width: 320px;
    font-size: 16px;
}

/* Indexed SPPD toggle button */
.indexed-toggle-btn {
    transition: background-color 200ms ease-out, color 200ms ease-out;
}

.indexed-toggle-btn:hover {
    opacity: 0.9;
}

/* Plotly chart marker transition for opacity dimming */
.js-plotly-plot .plotly .scatterlayer .trace .points path {
    transition: opacity 200ms ease-out;
}

/* Quadrant chart container */
#quadrant-view {
    position: relative;
}

/* Mobile responsive quadrant */
@media (max-width: 640px) {
    #quadrant-detail-card {
        min-width: 100%;
    }

    #quadrant-detail-card .dark-callout {
        min-width: 100%;
    }
}
