/* ══════════════════════════════════════════════════
   KodeLos Design System
   Premium Scandinavian Medical aesthetic — Ultra Light Mode
   ══════════════════════════════════════════════════ */

:root {
    --kl-primary: #1e3b8a;
    --kl-primary-hover: #172554;
    --kl-primary-light: #eff6ff;
    --kl-accent: #3b82f6;
    --kl-bg: #ffffff;
    --kl-surface: #fafafa;
    --kl-text: #111827;
    --kl-text-muted: #6b7280;
    --kl-border: #f1f5f9;
    --kl-border-strong: #e2e8f0;

    --kl-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --kl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --kl-shadow-md: 0 10px 15px -3px rgba(30, 59, 138, 0.08), 0 4px 6px -2px rgba(30, 59, 138, 0.04);
    --kl-shadow-lg: 0 20px 25px -5px rgba(30, 59, 138, 0.1), 0 10px 10px -5px rgba(30, 59, 138, 0.04);

    --kl-radius-sm: 0.375rem;
    --kl-radius: 0.75rem;
    --kl-radius-lg: 1rem;
    --kl-radius-xl: 1.5rem;
    --kl-radius-2xl: 2rem;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--kl-bg);
    color: var(--kl-text);
    -webkit-font-smoothing: antialiased;
}

.font-display {
    font-family: 'Manrope', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ── Custom Background ── */
.kl-bg-gradient {
    background: radial-gradient(circle at top right, #f0f7ff 0%, #ffffff 40%, #ffffff 100%);
}

/* ── Material Symbols ────────────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    vertical-align: middle;
}

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

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

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* ── View Transitions ────────────────────────────── */
.kl-view {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kl-view.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(10px);
}

/* ── Landing Page ────────────────────────────────── */
.landing-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
    /* Tighter padding to fit infographic */
}

@keyframes landingFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-fade {
    animation: landingFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Search Container ── */
.search-container-premium {
    background: var(--kl-bg);
    border-radius: var(--kl-radius-2xl);
    border: 1px solid var(--kl-border-strong);
    box-shadow: var(--kl-shadow-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0.375rem;
}

.search-container-premium:focus-within {
    border-color: var(--kl-accent);
    box-shadow: var(--kl-shadow-lg);
    transform: translateY(-2px);
}

.search-input-premium {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 1rem 1.5rem;
    /* Reduced from 1.25rem */
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--kl-text);
}

.search-btn-premium {
    width: 48px;
    height: 48px;
    background: var(--kl-primary);
    color: white;
    border-radius: var(--kl-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* ── Purpose Selector (Radio Pills) ───────────────────────── */
.purpose-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.purpose-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--kl-text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.purpose-btn:hover {
    background: #f1f5f9;
}

.purpose-btn.active {
    border-color: #dbeafe;
    /* border-blue-100 */
    background: #eff6ff;
    /* bg-blue-50 */
    box-shadow: none;
}

.purpose-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.purpose-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--kl-text-muted);
    font-family: var(--font-display);
    transition: color 0.2s;
}

.purpose-btn.active .purpose-label {
    color: var(--kl-primary);
}

.purpose-desc {
    display: none;
}

/* ── Quick Chips ─────────────────────────────────── */
.quick-chip {
    padding: 0.4rem 1.125rem;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    /* border-blue-100 */
    background: #eff6ff;
    /* bg-blue-50 */
    color: #1e40af;
    /* text-blue-800 */
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.quick-chip:hover {
    border-color: #3b82f6;
    /* border-blue-500 */
    background: #dbeafe;
    /* bg-blue-100 */
    color: #1e3a8a;
    /* text-blue-900 */
    transform: translateY(-1px);
}

/* ── Infographic ── */
.landing-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.25rem 0;
}

.landing-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.6875rem;
}

.step-num--amber {
    background: #fffbeb;
    color: #d97706;
}

.step-num--green {
    background: #f0fdf4;
    color: #16a34a;
}

.step-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.step-title {
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--kl-text);
}

.step-desc {
    font-size: 0.6875rem;
    color: var(--kl-text-muted);
    margin-top: 1px;
}

/* ── Sidebar ── */
#sidebar {
    background: #ffffff;
    border-left: 1px solid #f1f5f9;
}

.sidebar-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    color: #111827;
}

.selected-code-item {
    padding: 0.75rem;
    border-radius: var(--kl-radius);
    border: 1px solid #f1f5f9;
    background: #fff;
    transition: all 0.2s;
}

.selected-code-item:hover {
    border-color: #cbd5e1;
}

/* ── Animations ── */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.kl-logo-float {
    animation: float 6s ease-in-out infinite;
}

/* ── KPP Tab Switcher ─────────────────────────────── */
.kpp-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid var(--kl-border-strong);
    background: var(--kl-bg);
    color: var(--kl-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.kpp-tab:hover {
    border-color: var(--kl-accent);
    color: var(--kl-primary);
}

.kpp-tab.active {
    background: var(--kl-primary);
    border-color: var(--kl-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 59, 138, 0.25);
}

.kpp-tab.active .material-symbols-outlined {
    color: #ffffff;
}

/* ── KPP Accordion ──────────────────────────────── */
.kpp-chevron {
    transition: transform 0.2s ease;
}

.kpp-accordion-body {
    transition: max-height 0.3s ease;
}

/* ── Chat Sections ──────────────────────────────── */
.chat-section {
    transition: all 0.2s ease;
}

.chat-section-collapsible {
    max-height: 6rem;
    overflow: hidden;
    position: relative;
}

.chat-section-collapsible.expanded {
    max-height: none;
}

.chat-section-collapsible::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2rem;
    background: linear-gradient(transparent, var(--section-bg, #f9fafb));
    pointer-events: none;
}

.chat-section-collapsible.expanded::after {
    display: none;
}

/* ── Code Card Grid ─────────────────────────────── */
.code-card-compact {
    min-height: 0;
}

.code-card-compact .code-term {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}