/* ==========================================================================
   TahliLET Modern Design System & Theme
   Compact, Clinical & High-Performance UI
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Color Palette */
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-primary-light: #eff6ff;
    --brand-primary-glow: rgba(37, 99, 235, 0.16);
    
    --brand-accent: #06b6d4;
    --brand-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --brand-gradient-subtle: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);

    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border-hairline: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: #3b82f6;

    --status-normal: #10b981;
    --status-normal-bg: #ecfdf5;
    --status-normal-border: #a7f3d0;

    --status-high: #f43f5e;
    --status-high-bg: #fff1f2;
    --status-high-border: #fecdd3;

    --status-low: #0284c7;
    --status-low-bg: #f0f9ff;
    --status-low-border: #bae6fd;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* Beautiful Shadows */
    --shadow-sm: 0px 2px 3px -1px rgba(0,0,0,0.06), 0px 1px 0px 0px rgba(25,28,33,0.02), 0px 0px 0px 1px rgba(25,28,33,0.06);
    --shadow-md: 0px 0px 0px 1px rgba(0,0,0,0.05), 0px 1px 2px -0.5px rgba(0,0,0,0.05), 0px 4px 6px -1.5px rgba(0,0,0,0.05), 0px 10px 15px -3px rgba(0,0,0,0.04);
    --shadow-lg: 0px 0px 0px 1px rgba(0,0,0,0.06), 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0px 0px 0px 1px rgba(37,99,235,0.2), 0 14px 28px -6px rgba(15, 23, 42, 0.1);
}

/* Base Reset & Typography */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Floating Navbar */
.navbar-modern {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    transition: all 0.25s ease;
    z-index: 1030;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--brand-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.navbar-modern .nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
    font-size: 0.925rem;
}

.navbar-modern .nav-link:hover,
.navbar-modern .nav-link.active {
    color: var(--brand-primary);
    background: var(--brand-primary-light);
}

/* Compact Trust Pill */
.badge-trust {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.815rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

/* Hero Stage (Integrated Compact Stage) */
.hero-stage {
    position: relative;
    padding: 3rem 0 3.5rem 0;
    overflow: hidden;
}

.hero-stage::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(6, 182, 212, 0.03) 60%, transparent 100%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.hero-headline {
    font-size: clamp(2.1rem, 4vw, 3.25rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-subtext {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Interactive Upload Console (The Core Stage Component) */
.upload-console-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-hairline);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.upload-console-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    background: #fafbfc;
    padding: 1.75rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
    border-color: var(--brand-primary);
    background: #eff6ff;
    transform: scale(0.995);
}

.upload-icon-pulse {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.upload-dropzone:hover .upload-icon-pulse {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

/* Selected File Pill */
.selected-file-chip {
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Category Quick Selector Chips */
.category-chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.category-chips-scroll::-webkit-scrollbar {
    display: none;
}

.chip-btn {
    flex-shrink: 0;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip-btn:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

.chip-btn.active {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Modern Form Controls */
.form-control-compact,
.form-select-compact {
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.95rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.form-control-compact:focus,
.form-select-compact:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

/* Action Button */
.btn-analyze {
    background: var(--brand-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.btn-analyze:active {
    transform: translateY(0);
}

/* Bento Grid System (Features & Value Prop) */
.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    position: relative;
}

.bento-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.bento-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

/* Live Report Demo Card inside Bento */
.demo-report-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.85rem;
}

.demo-param-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}
.demo-param-row:last-child {
    border-bottom: none;
}

.status-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.status-pill.normal {
    background: var(--status-normal-bg);
    color: var(--status-normal);
    border: 1px solid var(--status-normal-border);
}
.status-pill.high {
    background: var(--status-high-bg);
    color: var(--status-high);
    border: 1px solid var(--status-high-border);
}
.status-pill.low {
    background: var(--status-low-bg);
    color: var(--status-low);
    border: 1px solid var(--status-low-border);
}

/* Test Category Cards */
.category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.category-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    color: inherit;
}

.category-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Modern FAQ Accordion */
.accordion-modern .accordion-item {
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md) !important;
    margin-bottom: 10px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.accordion-modern .accordion-button {
    font-weight: 600;
    font-size: 0.98rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    background: #ffffff;
    box-shadow: none;
}

.accordion-modern .accordion-button:not(.collapsed) {
    color: var(--brand-primary);
    background: #f8fafc;
}

.accordion-modern .accordion-body {
    padding: 1rem 1.25rem;
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Compact Footer */
.footer-compact {
    background: #0f172a;
    color: #94a3b8;
    padding: 3.5rem 0 2rem 0;
    border-top: 1px solid #1e293b;
}

.footer-compact a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-compact a:hover {
    color: #ffffff;
}

/* Result Dashboard Styling */
.result-header-bar {
    background: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.param-card-modern {
    background: #ffffff;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    height: 100%;
    overflow: hidden;
}

.param-card-modern:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.param-card-header {
    padding: 1.15rem 1.25rem 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.param-card-body {
    padding: 0.5rem 1.25rem 1.25rem 1.25rem;
}

.param-val-bold {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
    .hero-stage {
        padding: 2rem 0;
    }
    .upload-console-card {
        margin-top: 1.5rem;
    }
}
