/* =========================================================
   RECOVERAI — FUTURISTIC AI COMMAND CENTER
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #05050b;
    --bg-secondary: #090914;

    --panel: rgba(17, 17, 30, 0.72);
    --panel-light: rgba(255, 255, 255, 0.035);

    --border: rgba(255, 255, 255, 0.09);
    --border-glow: rgba(123, 97, 255, 0.35);

    --text: #f5f5ff;
    --muted: #8c8ca5;
    --muted-light: #b5b5c8;

    --purple: #7c5cff;
    --purple-light: #a78bfa;
    --blue: #4f8cff;
    --cyan: #56d9ff;

    --green: #35e39a;
    --red: #ff5f73;

    --radius: 18px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(91, 61, 255, 0.18),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(53, 91, 255, 0.12),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #05050b,
            #080812 45%,
            #05050b
        );

    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* =========================================================
   BACKGROUND GLOW EFFECTS
   ========================================================= */

body::before {
    content: "";
    position: fixed;

    width: 500px;
    height: 500px;

    top: -200px;
    left: -150px;

    background:
        radial-gradient(
            circle,
            rgba(112, 82, 255, 0.22),
            transparent 65%
        );

    filter: blur(40px);

    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;

    width: 450px;
    height: 450px;

    bottom: -200px;
    right: -100px;

    background:
        radial-gradient(
            circle,
            rgba(46, 113, 255, 0.16),
            transparent 65%
        );

    filter: blur(50px);

    pointer-events: none;
    z-index: -1;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: 260px;

    background:
        linear-gradient(
            180deg,
            rgba(12, 12, 22, 0.96),
            rgba(7, 7, 14, 0.98)
        );

    border-right: 1px solid var(--border);

    color: white;

    padding: 28px 18px;

    display: flex;
    flex-direction: column;

    position: fixed;

    height: 100vh;

    backdrop-filter: blur(20px);

    z-index: 10;
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 13px;

    margin-bottom: 55px;

    padding: 0 10px;
}

.brand-icon {
    width: 46px;
    height: 46px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #7c5cff,
            #3d6cff
        );

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 800;

    font-size: 22px;

    box-shadow:
        0 0 25px rgba(124, 92, 255, 0.45),
        inset 0 1px rgba(255,255,255,0.3);
}

.brand h1 {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 21px;

    letter-spacing: -0.5px;
}

.brand span {
    display: block;

    color: var(--muted);

    font-size: 10px;

    margin-top: 3px;

    letter-spacing: 0.4px;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

nav {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

nav a {
    position: relative;

    padding: 14px 15px;

    border-radius: 12px;

    color: #85859d;

    text-decoration: none;

    font-size: 13px;

    font-weight: 500;

    transition:
        background 0.25s,
        color 0.25s,
        transform 0.25s;
}

nav a span {
    margin-right: 11px;
}

nav a:hover {
    color: white;

    background:
        rgba(255,255,255,0.04);

    transform: translateX(3px);
}

nav a.active {
    color: white;

    background:
        linear-gradient(
            90deg,
            rgba(124,92,255,0.18),
            rgba(124,92,255,0.04)
        );

    border: 1px solid rgba(124,92,255,0.18);

    box-shadow:
        inset 0 0 20px rgba(124,92,255,0.06);
}

nav a.active::before {
    content: "";

    position: absolute;

    left: 0;

    top: 25%;

    height: 50%;

    width: 3px;

    border-radius: 0 5px 5px 0;

    background:
        linear-gradient(
            #a78bfa,
            #4f8cff
        );

    box-shadow:
        0 0 10px #7c5cff;
}


/* =========================================================
   SIDEBAR BOTTOM
   ========================================================= */

.sidebar-bottom {
    margin-top: auto;

    padding: 10px;
}

.simulation-badge {
    display: flex;

    align-items: center;

    gap: 8px;

    background:
        rgba(255,255,255,0.035);

    border: 1px solid var(--border);

    padding: 13px;

    border-radius: 12px;

    font-size: 11px;

    color: var(--muted-light);

    margin-bottom: 15px;
}

.simulation-badge::before {
    content: "";

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 12px var(--green);
}

.sidebar-bottom small {
    color: #55556d;

    font-size: 10px;
}


/* =========================================================
   MAIN
   ========================================================= */

.main {
    margin-left: 260px;

    width: calc(100% - 260px);

    padding: 42px 48px;

    min-height: 100vh;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    margin-bottom: 38px;
}

.eyebrow {
    font-size: 10px;

    font-weight: 700;

    letter-spacing: 2px;

    color: var(--purple-light);

    margin-bottom: 10px;

    text-transform: uppercase;
}

.topbar h2 {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 36px;

    letter-spacing: -1.2px;

    margin-bottom: 9px;

    background:
        linear-gradient(
            90deg,
            #ffffff,
            #b9b2ff
        );

    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--muted);

    font-size: 14px;
}

.system-status {
    display: flex;

    align-items: center;

    background:
        rgba(255,255,255,0.035);

    border: 1px solid var(--border);

    padding: 12px 16px;

    border-radius: 30px;

    font-size: 11px;

    color: var(--muted-light);

    backdrop-filter: blur(15px);

    box-shadow:
        0 10px 30px rgba(0,0,0,0.25);
}

.status-dot {
    width: 7px;
    height: 7px;

    background: var(--green);

    display: inline-block;

    border-radius: 50%;

    margin-right: 8px;

    box-shadow:
        0 0 12px var(--green);

    animation: pulse 2s infinite;
}

@keyframes pulse {

    0% {
        box-shadow: 0 0 0 0 rgba(53,227,154,0.6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(53,227,154,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(53,227,154,0);
    }
}


/* =========================================================
   METRICS
   ========================================================= */

.metrics {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 18px;

    margin-bottom: 24px;
}

.metric-card {
    position: relative;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.07),
            rgba(255,255,255,0.025)
        );

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 22px;

    backdrop-filter: blur(18px);

    transition:
        transform 0.3s,
        border-color 0.3s,
        box-shadow 0.3s;
}

.metric-card::before {
    content: "";

    position: absolute;

    width: 130px;
    height: 130px;

    top: -80px;
    right: -60px;

    background:
        radial-gradient(
            circle,
            rgba(124,92,255,0.18),
            transparent 70%
        );
}

.metric-card:hover {
    transform: translateY(-5px);

    border-color:
        rgba(124,92,255,0.35);

    box-shadow:
        0 20px 45px rgba(0,0,0,0.3);
}

.metric-label {
    color: var(--muted);

    font-size: 11px;

    margin-bottom: 14px;

    text-transform: uppercase;

    letter-spacing: 0.7px;
}

.metric-value {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 28px;

    font-weight: 700;

    margin-bottom: 8px;

    color: white;
}

.metric-sub {
    color: #65657d;

    font-size: 10px;
}

.metric-sub.positive {
    color: var(--green);
}


/* =========================================================
   PANELS
   ========================================================= */

.workspace {
    display: grid;

    grid-template-columns:
        1.15fr 0.85fr;

    gap: 20px;

    margin-bottom: 20px;
}

.panel {
    position: relative;

    background:
        linear-gradient(
            145deg,
            rgba(20,20,35,0.82),
            rgba(10,10,20,0.82)
        );

    border: 1px solid var(--border);

    border-radius: 20px;

    padding: 26px;

    margin-bottom: 20px;

    backdrop-filter: blur(20px);

    box-shadow:
        0 20px 50px rgba(0,0,0,0.22);
}

.panel::before {
    content: "";

    position: absolute;

    inset: 0;

    border-radius: inherit;

    pointer-events: none;

    background:
        linear-gradient(
            130deg,
            rgba(255,255,255,0.06),
            transparent 30%
        );
}

.panel-header {
    position: relative;

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 25px;
}

.panel-header h3 {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 19px;

    letter-spacing: -0.3px;
}

.model-badge {
    font-size: 10px;

    background:
        rgba(124,92,255,0.12);

    border:
        1px solid rgba(124,92,255,0.25);

    color: #b7aaff;

    padding: 8px 11px;

    border-radius: 20px;

    font-weight: 600;
}


/* =========================================================
   FORM
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 17px;
}

.field {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.field label {
    font-size: 10px;

    font-weight: 600;

    color: var(--muted-light);

    text-transform: uppercase;

    letter-spacing: 0.5px;
}

input,
select {
    width: 100%;

    border:
        1px solid rgba(255,255,255,0.09);

    border-radius: 11px;

    padding: 13px 14px;

    background:
        rgba(255,255,255,0.035);

    color: white;

    font-size: 13px;

    outline: none;

    transition:
        border 0.25s,
        background 0.25s,
        box-shadow 0.25s;
}

select option {
    background: #151522;

    color: white;
}

input:focus,
select:focus {
    border-color:
        rgba(124,92,255,0.7);

    background:
        rgba(124,92,255,0.06);

    box-shadow:
        0 0 0 3px rgba(124,92,255,0.12);
}

.percentage-input {
    position: relative;
}

.percentage-input input {
    width: 100%;
}

.percentage-input span {
    position: absolute;

    right: 14px;
    top: 13px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   ANALYZE BUTTON
   ========================================================= */

.analyze-button {
    position: relative;

    width: 100%;

    margin-top: 22px;

    border: none;

    border-radius: 12px;

    padding: 15px 18px;

    background:
        linear-gradient(
            90deg,
            #6547ff,
            #426cff,
            #6a42ff
        );

    background-size: 200%;

    color: white;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    display: flex;

    justify-content: space-between;

    align-items: center;

    overflow: hidden;

    box-shadow:
        0 12px 30px rgba(88,67,255,0.3);

    transition:
        transform 0.25s,
        box-shadow 0.25s;
}

.analyze-button:hover {
    transform: translateY(-2px);

    background-position: right;

    box-shadow:
        0 18px 40px rgba(88,67,255,0.5);
}


/* =========================================================
   DECISION PANEL
   ========================================================= */

.decision-panel {
    margin-bottom: 0;

    border-color:
        rgba(124,92,255,0.18);
}

.decision-status {
    font-size: 9px;

    font-weight: 700;

    padding: 8px 11px;

    border-radius: 20px;

    background:
        rgba(124,92,255,0.1);

    border:
        1px solid rgba(124,92,255,0.2);

    color: #b9afff;

    letter-spacing: 0.5px;
}

.decision-main {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin: 28px 0;
}

.probability-label {
    font-size: 10px;

    color: var(--muted);

    margin-bottom: 9px;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}

.probability {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 48px;

    font-weight: 700;

    background:
        linear-gradient(
            90deg,
            #ffffff,
            #a78bfa
        );

    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;
}

.action-box {
    text-align: right;
}

.action-box span {
    display: block;

    color: var(--muted);

    font-size: 9px;

    margin-bottom: 8px;

    letter-spacing: 0.5px;
}

.action-box strong {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 24px;

    color: var(--green);
}


/* =========================================================
   RECOVERY VALUES
   ========================================================= */

.recovery-value {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    border-top:
        1px solid var(--border);

    border-bottom:
        1px solid var(--border);

    padding: 20px 0;

    gap: 20px;
}

.recovery-value span {
    display: block;

    font-size: 9px;

    color: var(--muted);

    margin-bottom: 8px;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}

.recovery-value strong {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 20px;

    color: white;
}


/* =========================================================
   REASON BOX
   ========================================================= */

.reason-box {
    margin-top: 20px;

    background:
        rgba(255,255,255,0.025);

    border:
        1px solid rgba(255,255,255,0.05);

    padding: 16px;

    border-radius: 13px;
}

.reason-box span {
    font-size: 9px;

    font-weight: 700;

    color: var(--purple-light);

    letter-spacing: 0.8px;
}

.reason-box p {
    margin-top: 8px;

    font-size: 12px;

    line-height: 1.6;

    color: var(--muted-light);
}


/* =========================================================
   ACTION COMPARISON
   ========================================================= */

.actions {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 20px;
}

.action-card {
    background:
        rgba(255,255,255,0.025);

    border:
        1px solid var(--border);

    border-radius: 15px;

    padding: 20px;

    transition:
        transform 0.25s,
        border-color 0.25s;
}

.action-card:hover {
    transform: translateY(-3px);

    border-color:
        rgba(124,92,255,0.35);
}

.action-title {
    display: flex;

    justify-content: space-between;

    font-size: 12px;

    font-weight: 700;

    margin-bottom: 16px;

    color: white;
}

.action-title span:last-child {
    color: var(--purple-light);
}

.bar {
    height: 8px;

    background:
        rgba(255,255,255,0.06);

    border-radius: 20px;

    overflow: hidden;
}

.bar-fill {
    height: 100%;

    width: 0%;

    background:
        linear-gradient(
            90deg,
            #7c5cff,
            #4f8cff
        );

    border-radius: inherit;

    box-shadow:
        0 0 15px rgba(124,92,255,0.8);

    transition: width 0.6s ease;
}

.action-bottom {
    display: flex;

    justify-content: space-between;

    margin-top: 15px;

    font-size: 10px;

    color: var(--muted);
}

.action-bottom strong {
    color: white;
}


/* =========================================================
   BOTTOM GRID
   ========================================================= */

.bottom-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 20px;
}

.bottom-grid .panel {
    margin-bottom: 0;
}


/* =========================================================
   GUARDRAILS
   ========================================================= */

.guardrail-list {
    display: flex;

    flex-direction: column;

    gap: 18px;
}

.guardrail {
    display: flex;

    gap: 13px;

    align-items: flex-start;
}

.check {
    flex-shrink: 0;

    width: 25px;
    height: 25px;

    border-radius: 50%;

    background:
        rgba(53,227,154,0.1);

    border:
        1px solid rgba(53,227,154,0.2);

    color: var(--green);

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 12px;

    box-shadow:
        0 0 15px rgba(53,227,154,0.08);
}

.guardrail strong {
    display: block;

    font-size: 12px;

    margin-bottom: 5px;

    color: white;
}

.guardrail small {
    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   MODEL STATS
   ========================================================= */

.model-stats {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 13px;
}

.model-stats div {
    background:
        rgba(255,255,255,0.03);

    border:
        1px solid rgba(255,255,255,0.05);

    padding: 17px;

    border-radius: 14px;

    transition:
        transform 0.25s,
        background 0.25s;
}

.model-stats div:hover {
    transform: translateY(-3px);

    background:
        rgba(124,92,255,0.07);
}

.model-stats span {
    display: block;

    color: var(--muted);

    font-size: 9px;

    margin-bottom: 9px;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}

.model-stats strong {
    font-family: 'Space Grotesk', sans-serif;

    font-size: 19px;

    color: white;
}

.muted {
    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    text-align: center;

    color: #56566d;

    font-size: 10px;

    margin-top: 30px;

    padding-bottom: 10px;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: #07070d;
}

::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            #3f337f,
            #20205a
        );

    border-radius: 20px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1150px) {

    .metrics {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .workspace {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 850px) {

    .sidebar {
        width: 220px;
    }

    .main {
        margin-left: 220px;

        width: calc(100% - 220px);

        padding: 30px;
    }

}


@media (max-width: 700px) {

    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;

        width: 100%;

        padding: 22px;
    }

    .topbar {
        flex-direction: column;

        gap: 20px;
    }

    .topbar h2 {
        font-size: 29px;
    }

    .metrics,

    .bottom-grid,
    .actions,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .model-stats {
        grid-template-columns: 1fr;
    }

}

/* ========================================================= */
/* RECOVERY ANALYTICS - MODERN UPGRADE */
/* ========================================================= */

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.analytics-stat {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid #eaecf0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.analytics-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.10);
}

.analytics-stat::after {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    right: -30px;
    top: -30px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
}

.analytics-stat span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #667085;
    margin-bottom: 10px;
}

.analytics-stat strong {
    font-size: 28px;
    color: #172033;
}


/* ========================================================= */
/* ANALYTICS PERFORMANCE ROWS */
/* ========================================================= */

.analytics-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 16px 18px;
    margin-bottom: 10px;

    background: #f8fafc;
    border: 1px solid #eaecf0;
    border-radius: 12px;

    transition: all 0.25s ease;
}

.analytics-row:hover {
    background: white;
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.07);
}

.analytics-row:last-child {
    margin-bottom: 0;
}

.analytics-row div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.analytics-row strong {
    font-size: 13px;
    color: #172033;
}

.analytics-row div strong {
    font-weight: 700;
}

.analytics-row small {
    color: #667085;
    font-size: 11px;
}


/* ========================================================= */
/* PERFORMANCE BADGE */
/* ========================================================= */

.analytics-row > strong {
    background: #eff6ff;
    color: #2563eb;

    padding: 7px 10px;
    border-radius: 8px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}


/* ========================================================= */
/* RESPONSIVE ANALYTICS */
/* ========================================================= */

@media (max-width: 900px) {

    .analytics-summary {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .analytics-row {
        padding: 14px;
    }

    .analytics-row > strong {
        font-size: 11px;
    }

}