:root {
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent: #b15ad6;
    /* ← deze is om x en x-waarden te verbinden op kleur*/
}

/* walkthrough glass css */
/* Container */
#walkthrough {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

/* Actief */
#walkthrough.active {
    opacity: 1;
}

/* Blur/dim achtergrond */
.walkthrough-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.55);
}

/* Spotlight */
.walkthrough-spotlight {
    position: absolute;
    border-radius: 14px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.65),
        0 0 25px rgba(139, 124, 255, 0.35);

    transition: all 0.4s ease;
}

/* Glass kaart */
.walkthrough-card {
    position: absolute;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(10px);

    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;

    padding: 14px 18px;
    width: min(90%, 340px);

    text-align: center;
    color: white;

    pointer-events: auto;
    opacity: 0;
    transition: all 0.35s ease;
}

/* Actief */
#walkthrough.active .walkthrough-card {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Button */
.walkthrough-card button {
    margin-top: 10px;
}

/* walkthrough glass css */


body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #0f0f17;
    color: white;
}

.container {
    max-width: 90vw;
    margin: auto;
    padding: 10px 30px 30px 30px;
    /* aanpassingen tbv grafiek rechts van rest  */
    display: grid;
    gap: 12px;
    align-items: start;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
}


header p {
    margin: 4px 0 0 0;
    /* 🔥 compacte uitleg */
    line-height: 1.35;
    color: #888;
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

header span {
    color: #8b7cff;
}

.controls {
    margin-top: 30px;
    background: #171726;
    padding: 10px;
    border-radius: 12px;
}

.output {
    display: flex;
    /* grid-template-columns: 1fr 1fr; */
    gap: 20px;
    /* margin-top: 12; */
    width: 100%;
    max-width: none;
    /* 🔥 cruciaal */
}

.formula-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 6px;
    gap: 24px;
}

.formula-box input {
    flex: 1;
    background: #0f0f17;
    border: 1px solid #333;
    color: white;
    border-radius: 8px;
}

.range-box {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.range-box input {
    padding: 8px;
    width: 80px;
    background: #0f0f17;
    border: 1px solid #333;
    color: white;
    border-radius: 8px;
}

#updateBtn {
    white-space: nowrap;
}

button {
    padding: 10px 10px;
    background: #8b7cff;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}



.table-panel,
.chart-panel {
    width: 100%;
    background: #171726;
    padding: 12px;
    border-radius: 12px;
}

table {
    background: #182d09;
    width: 100%;
    border-collapse: collapse;
}

.table-panel {
    background: #171726;
    width: 100%;
}

.left-column,
.table-panel {
    min-width: 0;
    width: 100%;
    max-width: none;
}


.calc-row {
    color: #aaa;
    font-size: 0.9rem;
}

canvas {
    width: 100%;
    height: 300px;
}

/* Toevoeging om de tabel horizontaal en met hover aanbod te maken */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

td,
th {
    padding: 8px 6px;
    /* 🔥 iets compacter */
    text-align: center;
    white-space: nowrap;
}

td {
    border-bottom: 1px solid #2a2a3a;
    font-variant-numeric: tabular-nums;
}

tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table-panel table {
    width: 100%;
    margin: 0 auto;
    /* 🔥 magic */
}

tr:first-child td {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    text-align: center;
    position: relative;
}

/* Datacellen */
.value-cell {
    cursor: pointer;
    transition: 0.2s;
}

.value-cell:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Hover berekening */

.calc-tooltip {
    position: absolute;
    left: 50%;
    bottom: 130%;

    transform: translateX(-50%) translateY(6px);

    padding: 8px 12px;
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    border: 1px solid rgba(255, 255, 255, 0.18);

    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre;

    color: rgba(255, 255, 255, 0.85);

    opacity: 0;
    pointer-events: none;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.35),
        0 0 18px rgba(139, 124, 255, 0.18);
    /* 🔥 glow */
}

.value-cell:hover .calc-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    color: white
}


/*  accentkleur realiseren voor x en de ingevulde waarde */

.accent {
    color: var(--accent);
    font-weight: 500;
}

/* .value-cell:hover .calc-tooltip .accent {
    color: var(--accent);
    font-size: 1.5rem;
} */

.accentX {
    color: var(--accent);
    font-size: 1.3rem;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

/* Beide lagen IDENTIEK */
#formulaInput,
#formulaHighlight {
    font: 1rem system-ui, sans-serif;
    letter-spacing: 0.3px;
    line-height: 1.4;
    padding: 10px;
}

/* Input */
#formulaInput {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: transparent;
    /* 🔥 tekst onzichtbaar */
    caret-color: white;
    /* cursor zichtbaar */
    z-index: 2;
}

/* Highlight layer */
#formulaHighlight {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    /* color: rgba(255, 255, 255, 0.35); */
    color: white;
    pointer-events: none;
    white-space: pre;
    overflow: hidden;
}

/* Accentkleur */
#formulaHighlight .accent {
    color: var(--accent);
    font-size: 1.3rem;
}

/* Standaard → desktop */
.mobile-text {
    display: none;
}

/* aanpassingen tbv grafiek rechts van rest  */
.left-column {
    display: flex;
    flex-direction: column;
    /* height: 80vh;
    justify-content: end; */
    gap: 24px;
}

/* --- FIX: chart-panel onderaan in de rechterkolom --- */
.right-column {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;

}


/* duw de chart naar de bodem van de kolom */
.right-column .chart-panel {
    margin-top: auto;
}


/* Mobiel */
@media (max-width:900px) {
    .desktop-text {
        display: none;
    }

    .mobile-text {
        display: block;
    }

    /* Titel iets compacter */
    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 0.9rem;
    }

    /* Formule invoer */
    #formulaInput,
    #formulaHighlight {
        height: 42px;
        /* 🔥 cruciaal */
        line-height: 42px;
        /* 🔥 perfecte centrering */
        padding: 0 10px;
        /* i.p.v. vertical padding */
        font-size: 1.2rem;
        font-family: system-ui, sans-serif;
        box-sizing: border-box;
    }

    #formulaInput {
        -webkit-appearance: none;
        appearance: none;
    }

    /* Controls */
    .range-box label {
        font-size: 0.8rem;
    }

    .range-box input {
        font-size: 1.1rem;
    }

    button {
        font-size: 1.1rem;
        padding: 8px 14px;
    }

    /* Tabel */
    table {
        font-size: 1.1rem;
    }

    /* Tooltip / berekening */
    .calc-tooltip {
        font-size: 5vw;
        padding: 6px 10px;
    }

    #formulaHighlight .accent {
        color: var(--accent);
        font-size: 5vw;
        padding: 0%;
    }

    .accentX {
        color: var(--accent);
        font-size: 5vw;
    }

    /* Panel spacing iets strakker */
    .controls,
    .table-panel,
    .chart-panel {
        padding: 16px;
    }



    .container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
        gap: 20px;
    }


    .right-column {
        position: relative;
        top: 0;
        height: auto;

        display: block;
        /* 🔥 reset flex layout */
    }

    .right-column .chart-panel {
        margin-top: 12px;
        /* niet 'auto' op mobiel */
    }

}

.value-cell.highlight {
    background: rgba(139, 124, 255, 0.15);
    outline: 1px solid rgba(139, 124, 255, 0.4);
}