/* simulator_styles.css — lageniale · Luxe Edition 2026
   Using hardcoded values + public_styles.css tokens to ensure visibility
   =========================================================== */

/* ==========================================================
   COLOUR PALETTE (hardcoded to guarantee rendering)
   gold:   #E8B84B  /  gold-glow: rgba(232,184,75,.14)
   dark:   #07070B  /  dark2:     #0D0D13
   glass:  rgba(255,255,255,0.07)   (visible on dark bg)
   border: rgba(255,255,255,0.09)
   text:   #F0EEE8  /  muted: rgba(240,238,232,0.55)
========================================================== */

/* ==========================================================
   1. SECTION WRAPPER
========================================================== */
.lg-simulator-section {
    background: transparent;
    /* ── Fix: on hérite padding-top depuis .lg-snap-section (62px),
       on ajoute juste le décalage interne supplémentaire ── */
    padding-top: calc(62px + 16px) !important;
    padding-bottom: 28px;
    padding-left: 0;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* ── Fix: overflow hidden vient de .lg-snap-section, on override ── */
    overflow: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none;
    /* ── Fix: s'assure que la section occupe toute la hauteur ── */
    height: 100svh !important;
    min-height: 100svh;
    box-sizing: border-box;
}

/* ── Fix critique: .lg-section-inner est générique (max-width+padding seulement).
   Dans le simulateur, il doit occuper TOUTE la hauteur disponible
   et passer son espace au flex child simulator-dual-layout ── */
.lg-simulator-section .lg-section-inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: var(--max, 1340px);
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 60px);
    box-sizing: border-box;
    padding-bottom: 20px;
}

/* ── Fix: le dual layout doit aussi grandir pour remplir l'espace ── */
.lg-simulator-section .simulator-dual-layout {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}
.lg-simulator-section::-webkit-scrollbar { display: none; }

/* ==========================================================
   2. DUAL LAYOUT
========================================================== */
.simulator-dual-layout {
    display: flex;
    gap: clamp(14px, 2vw, 28px);
    width: 100%;
    align-items: flex-start;
}

/* ==========================================================
   3. SIDEBAR
========================================================== */
.simulator-sidebar {
    width: 100%;
    max-width: 340px;
    flex-shrink: 0;
    /* ── Pur blur, pas de background ── */
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.09) !important;
    border-radius: 14px;
    padding: clamp(14px, 1.8vw, 22px);
    /* ── Fix: scroll interne si contenu trop long ── */
    overflow-y: auto;
    overflow-x: hidden;
    /* ── Fix: s'étire pour remplir la hauteur du flex parent ── */
    align-self: stretch;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 16px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.simulator-sidebar:hover {
    border-color: rgba(255,255,255,0.18) !important;
    box-shadow: 0 4px 24px rgba(0,0,0,.28);
}

/* Hero bloc – kicker + H2 */
.sidebar-hero-content {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    margin-bottom: 14px;
}

/* kicker label shared atom */
.simulator-sidebar .lg-kicker-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: #E8B84B;
    margin-bottom: 8px;
    opacity: .9;
}
.simulator-sidebar .lg-kicker-label::before {
    content: '';
    display: block;
    width: 18px;
    height: 1px;
    background: linear-gradient(90deg, #E8B84B, transparent);
    border-radius: 2px;
    flex-shrink: 0;
}

.sidebar-hero-title {
    font-size: clamp(16px, 2vw, 21px);
    font-weight: 900;
    letter-spacing: -0.6px;
    color: #F0EEE8;
    line-height: 1.15;
    margin: 0 0 8px;
}
.sidebar-hero-title .lg-accent { color: #E8B84B; }

.sidebar-hero-subtitle {
    font-size: 11px;
    color: rgba(240,238,232,0.55);
    margin: 0;
    line-height: 1.6;
}

/* Toggle */
.simulator-sidebar .simulator-toggle {
    display: flex;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.09);
    padding: 4px;
    border-radius: 10px;
    width: 100%;
    margin-top: 14px;
}

.toggle-option {
    flex: 1;
    text-align: center;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    color: rgba(240,238,232,0.55);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}
.toggle-option input[type="radio"] { display: none; }
.toggle-option.active {
    background: #E8B84B;
    color: #000;
    box-shadow: 0 2px 14px rgba(232,184,75,.2);
}
.toggle-option:not(.active):hover {
    color: #F0EEE8;
    background: rgba(255,255,255,0.07);
}

/* Params section header */
.sidebar-title-params {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #E8B84B;
    margin: 14px 0 10px;
    opacity: .9;
}

/* Input panel wrapper */
.input-panel-wrapper {
    flex: 1;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.09);
    margin-top: 14px;
    display: flex;
    flex-direction: column;
}

.input-panel { display: none; flex-direction: column; }
.input-panel.active { display: flex; }

.input-panel > p {
    font-size: 11px;
    color: rgba(240,238,232,0.55);
    margin: 0 0 12px;
    line-height: 1.6;
}

/* Sliders */
.big-slider-wrapper { margin-bottom: 12px; }

.big-slider-wrapper .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 6px;
}
.big-slider-wrapper label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(240,238,232,0.75);
    margin: 0;
}
.big-value-display {
    font-size: 14px;
    font-weight: 800;
    color: #E8B84B;
    line-height: 1;
}

.big-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 2px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px; outline: none; cursor: pointer;
}
.big-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px;
    background: #E8B84B;
    cursor: pointer; border-radius: 50%;
    border: 2px solid #07070B;
    box-shadow: 0 0 10px rgba(232,184,75,.25);
    transition: all 0.2s ease;
}
.big-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 18px rgba(232,184,75,.4);
    transform: scale(1.15);
}
.big-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    background: #E8B84B;
    cursor: pointer; border-radius: 50%;
    border: 2px solid #07070B;
    box-shadow: 0 0 10px rgba(232,184,75,.25);
}

/* CTA buttons */
.sidebar-cta-buttons {
    display: flex; gap: 10px;
    margin-top: auto; padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.09);
}
.btn-sim-primary, .btn-sim-secondary {
    flex: 1; text-decoration: none;
    padding: 10px 12px; border-radius: 8px;
    font-weight: 700; font-size: 12px;
    text-align: center; transition: all 0.25s ease; cursor: pointer;
}
.btn-sim-primary {
    background: #E8B84B; color: #000 !important; border: none;
}
.btn-sim-primary:hover {
    background: #F5CE70;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232,184,75,.2);
}
.btn-sim-secondary {
    background: rgba(255,255,255,0.05);
    color: rgba(240,238,232,0.55) !important;
    border: 1px solid rgba(255,255,255,0.09);
}
.btn-sim-secondary:hover {
    border-color: rgba(255,255,255,0.2);
    color: #F0EEE8 !important;
}

@media (min-width: 992px) {
    .sidebar-cta-buttons .btn-sim-secondary { display: none; }
}

/* ==========================================================
   4. SIMULATOR CONTENT (right column)
========================================================== */
.simulator-content {
    width: 100%;
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* ── Fix: scroll interne vertical si les cards dépassent ── */
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.dashboard-panel > .row,
.col-lg-8 > .row.g-4 {
    --bs-gutter-x: 10px;
    --bs-gutter-y: 10px;
}
.dashboard-panel > .row { flex-grow: 1; }

.dashboard-panel { display: none; width: 100%; }
.dashboard-panel.active {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}

/* ==========================================================
   5. DASH CARDS — visually distinct, glass on dark
========================================================== */
.dash-card {
    background: rgba(255,255,255,0.055) !important;
    border: 1px solid rgba(255,255,255,0.09) !important;
    border-radius: 12px;
    box-shadow: 0 1px 16px rgba(0,0,0,.2);
    padding: 12px;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    justify-content: flex-start;
    height: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.dash-card:hover {
    border-color: rgba(255,255,255,0.18) !important;
    box-shadow: 0 4px 24px rgba(0,0,0,.28);
}

/* Override Bootstrap text color inside cards */
.dash-card,
.dash-card * {
    color: #F0EEE8;
}

/* Card typography */
.dash-card .card-title {
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: rgba(240,238,232,0.52) !important;
    margin: 0 0 10px !important;
    flex-shrink: 0;
}
.dash-card .kpi-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(240,238,232,0.52) !important;
    margin-bottom: 6px;
    display: block;
}
.dash-card .kpi-value {
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 800;
    color: #F0EEE8 !important;
    line-height: 1.1;
    letter-spacing: -0.5px;
    display: block;
}
.dash-card .kpi-value.positive { color: #F0EEE8 !important; }
.dash-card .kpi-calculation {
    font-size: 10px;
    color: rgba(240,238,232,0.52) !important;
    margin-top: 4px;
    display: block;
}
.dash-card .kpi-delta-wrapper {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.dash-card .kpi-delta {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.1;
    color: #22c55e !important;
}
.dash-card .kpi-delta.positive { color: #22c55e !important; }
.dash-card .kpi-delta-label {
    display: block;
    font-size: 10px;
    color: rgba(240,238,232,0.45) !important;
    margin-top: 2px;
}

/* text-danger sub-labels */
.text-danger {
    color: rgba(240,238,232,0.35) !important;
}

/* ==========================================================
   6. CHART & MERGED CARD
========================================================== */
.chart-container {
    position: relative; width: 100%;
    flex-grow: 1; min-height: 140px;
}
.mini-chart-container { display: none; width: 100%; min-height: 80px; }

/* Merged highlight card */
.merged-card {
    background: linear-gradient(160deg, rgba(232,184,75,.08) 0%, rgba(255,255,255,0.055) 100%) !important;
    border-color: rgba(232,184,75,.2) !important;
    box-shadow: 0 0 40px rgba(232,184,75,.06), 0 2px 24px rgba(0,0,0,.25) !important;
    justify-content: space-between;
    padding: 14px;
    text-align: center;
    height: auto !important;
}
.merged-top {
    flex-grow: 1; display: flex;
    flex-direction: column; justify-content: center; align-items: center;
}
.merged-card .kpi-value {
    color: #E8B84B !important;
    font-size: clamp(32px, 4.5vw, 54px) !important;
    font-weight: 900 !important;
    letter-spacing: -2px;
    margin: 8px 0;
    text-shadow: 0 0 40px rgba(232,184,75,.2);
}
.merged-card .kpi-label.highlight {
    color: rgba(240,238,232,0.52) !important;
    font-weight: 800; letter-spacing: 2.5px;
    font-size: 9px; text-transform: uppercase;
}
.merged-card .kpi-calculation.highlight {
    color: rgba(240,238,232,0.52) !important;
    font-size: 11px; font-weight: 500; line-height: 1.6;
    max-width: 200px; margin: 0 auto;
}
.merged-divider {
    height: 1px; background: rgba(255,255,255,0.09);
    margin: 14px 0; width: 100%;
}
.merged-bottom { flex-grow: 0; width: 100%; }
.merged-bottom .card-title {
    font-size: 12px !important; font-weight: 600 !important;
    color: rgba(240,238,232,0.75) !important;
    letter-spacing: 0 !important; text-transform: none !important;
    margin-bottom: 10px !important;
}

/* CTA inside merged card */
.merged-bottom .btn.btn-primary,
.merged-bottom .lg-btn-primary {
    width: 100%; padding: 12px 20px;
    font-size: 12px; font-weight: 800;
    background: #E8B84B !important; color: #000 !important;
    border: none; border-radius: 8px;
    text-decoration: none; display: block; text-align: center;
    transition: all 0.25s ease; letter-spacing: .4px;
}
.merged-bottom .btn.btn-primary:hover,
.merged-bottom .lg-btn-primary:hover {
    background: #F5CE70 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(232,184,75,.2);
    color: #000 !important;
}

/* ==========================================================
   7. PNL TABLE
========================================================== */
.pnl-table {
    color: #F0EEE8 !important;
    font-size: 10px; border-collapse: collapse; width: 100%;
}
.pnl-table thead th,
.pnl-table tbody td,
.pnl-table tfoot td {
    padding: 5px 0; text-align: left; border: none;
    color: #F0EEE8 !important;
}
.pnl-table thead th {
    font-weight: 800; text-transform: uppercase;
    color: rgba(240,238,232,0.45) !important;
    font-size: 9px; letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
}
.pnl-table thead th:not(:first-child) {
    text-align: right; min-width: 20%; vertical-align: top;
}
.pnl-table tbody td:first-child { font-weight: 500; color: rgba(240,238,232,0.72) !important; }
.pnl-table tbody td:not(:first-child) { text-align: right; font-weight: 600; }
.pnl-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
.pnl-table tbody tr:last-child { border-bottom: none; }
.pnl-line.pnl-commission td,
.pnl-line.pnl-charge td,
.pnl-line.pnl-expense-group td { color: rgba(240,238,232,0.55) !important; }
#pnl-comm-k { color: #E8B84B !important; font-weight: 700; }
#pnl-comm-o { color: #E8B84B !important; font-weight: 700; }
.pnl-table tfoot td {
    padding-top: 7px; font-weight: 800; font-size: 11px;
    border-top: 2px solid rgba(255,255,255,0.15);
    color: #F0EEE8 !important;
}
.pnl-table tfoot tr td:not(:first-child) { text-align: right; }

/* ==========================================================
   8. LAYOUT HELPERS
========================================================== */
#main-chart, #savings-chart-card { height: 100%; }
#margin-card .kpi-value { font-size: clamp(18px, 2vw, 24px); margin-bottom: 5px; }

.col-lg-8 > .row.g-4 {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.col-lg-8 .row.g-4 > .col-12.d-md-flex { flex-grow: 1; }

/* ==========================================================
   9. RESPONSIVE MOBILE
========================================================== */
.btn-scroll-down-mobile { display: none; }

@media (max-width: 991.98px) {
    .lg-simulator-section {
        height: auto !important;
        min-height: 100svh;
        overflow: visible !important;
        scroll-snap-type: none !important;
        padding-top: calc(62px + 16px) !important;
        padding-bottom: 40px;
    }
    .lg-simulator-section .lg-section-inner {
        flex: unset;
        padding-bottom: 24px;
    }
    .lg-simulator-section .simulator-dual-layout {
        flex: unset;
        flex-direction: column;
        gap: 16px;
    }
    .simulator-sidebar {
        max-width: 100%;
        overflow-y: visible;
        align-self: unset;
    }
    .simulator-content {
        overflow-y: visible;
        padding: 0;
    }
    .sidebar-hero-title { font-size: clamp(15px, 5vw, 19px); }
    .sidebar-hero-subtitle { font-size: 11px; }
    .toggle-option { font-size: 11px; }
    .sidebar-title-params { font-size: 9px; }
    .input-panel > p { font-size: 11px; }
    .big-value-display { font-size: clamp(13px, 5vw, 15px); }
    .big-slider-wrapper label { font-size: 11px; }
    .big-slider::-webkit-slider-thumb { width: 14px; height: 14px; }
    .dash-card { padding: 10px; }
    .kpi-value { font-size: 20px; }
    .kpi-delta { font-size: 16px; }
    .merged-card .kpi-value { font-size: 28px !important; }
    .merged-divider { margin: 12px 0; }
    .chart-container { height: 150px; min-height: 150px; flex-grow: 0; }
}
