:root {
    --indices-green: #00ff00;
--indices-zero-line-color: #999999;
    --indices-crosshair-color: #aaaaaa;
    --indices-color-fallback: #aaaaaa;
    --indices-rs-r2-color: #ff0000;
    --indices-rs-r1-color: #ffff00;
    --indices-rs-mid-color: #ffffff;
    --indices-rs-s1-color: #00CCFF;
    --indices-rs-s2-color: #CC00FF;
    --indices-abmove-main-color: #FFFF00;
    --indices-abmove-fast-color: #00FF00;
    --indices-abmove-slow-color: #FF0000;

    --indices-abtrend-main-color: #FF0000;
    --indices-abtrend-signal-color: #FFFFFF;

    --indices-hvspread-main-color: #FFFFFF;
    --indices-hvspread-mm1-color: #00FF00;
    --indices-hvspread-mm2-color: #FF0000;

    --indices-pressurehv-main-color: #FFFF00;
    --indices-pressurehv-mm-color: #FF0000;
    
    --bg-color: #000000;
    --panel-bg: #000000;
    --text-color: #e0e0e0;

    --signal-plus1-color: #0088ff;
    --signal-minus0-color: #ffff00;
    --signal-plus0-color: #ffffff;
    --signal-minus1-color: #ff0000;

    --indices-speed-main-color: #03d34b;
    --indices-speed-ema-color: #ff0000;
    --indices-speed-normalized-color: #00ccff;
    --indices-speed-reversal-up-color: #0088ff;
    --indices-speed-reversal-down-color: #ff3333;
--indices-speed-bell-color: #cccccc;
    --indices-speed-bell-axis-color: #666666;
    --indices-speed-bell-marker-color: #ffff00;
    --indices-speed-bell-hist-color: rgba(180, 180, 180, 0.18);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.text-muted { color: #ccc; }
.color-green { color: var(--indices-green); }
.color-rs-r2 { color: var(--indices-rs-r2-color); }
.color-rs-r1 { color: var(--indices-rs-r1-color); }
.color-rs-mid { color: var(--indices-rs-mid-color); }
.color-rs-s1 { color: var(--indices-rs-s1-color); }
.color-rs-s2 { color: var(--indices-rs-s2-color); }
.color-abmove-main { color: var(--indices-abmove-main-color); }
.color-abmove-fast { color: var(--indices-abmove-fast-color); }
.color-abmove-slow { color: var(--indices-abmove-slow-color); }

.color-abtrend-main { color: var(--indices-abtrend-main-color); }
.color-abtrend-signal { color: var(--indices-abtrend-signal-color); }

.color-hvspread-main { color: var(--indices-hvspread-main-color); }
.color-hvspread-mm1 { color: var(--indices-hvspread-mm1-color); }
.color-hvspread-mm2 { color: var(--indices-hvspread-mm2-color); }

.color-pressure-main { color: var(--indices-pressurehv-main-color); }
.color-pressure-mm { color: var(--indices-pressurehv-mm-color); }
.color-speed-main { color: var(--indices-speed-main-color); }
.color-speed-ema { color: var(--indices-speed-ema-color); }
.color-speed-normalized { color: var(--indices-speed-normalized-color); }
.speed-reversal-legend {
    white-space: nowrap;
}

.speed-reversal-up {
    color: var(--indices-speed-reversal-up-color);
}

.speed-reversal-down {
    color: var(--indices-speed-reversal-down-color);
}
.cursor-grab { cursor: grab !important; }
.cursor-grabbing { cursor: grabbing !important; }

.transparent-menu-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid #333;
}

.indices-button-group {
    display: flex;
    gap: 15px; 
}

.indices-btn-wrapper { 
    position: relative; 
    min-width: 150px;
}

.indices-btn {
    background-color: transparent;
    color: #e3e3e3;
    border: 1px solid #cccccc;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    transition: background-color 0.2s, color 0.2s;
}

.indices-btn:hover { 
    background-color: #cccccc; 
    color: #000000; 
}

.indices-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: transparent;
    display: flex;
    flex-direction: column;
}

.indices-menu-option {
    background-color: #000000; 
    color: #e3e3e3;
    border: 1px solid #cccccc;
    border-top: none;
    padding: 8px 10px;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    transition: background-color 0.2s, color 0.2s;
    width: 100%;
    box-sizing: border-box;
}



.indices-menu-option.is-active-rs,
.indices-menu-option.is-active-rs:hover {
    background-color: #000000;
    color: #999999;
    border-color: #CCCCCC;
    cursor: default;
}

#spread-clear:disabled {
    color: #CCCCCC;
    border-color: #CCCCCC;
    background-color: #000000;
    cursor: not-allowed;
    opacity: 0.55;
}

.indices-menu-option:hover { 
    background-color: #cccccc; 
    color: #000000; 
}

.indices-dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-top: 40px;
    box-sizing: border-box;
}

.indices-chart-panel {
    flex: 1;
    background-color: var(--panel-bg);
    border: 1px solid #333;
    position: relative;
    width: 100%;
    min-height: 0;
}

.indices-chart-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.indices-chart-title {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    pointer-events: none;
}

.indices-price-title {
    font-size: 17px;
}

.indices-maximize-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 50;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #555;
    border-radius: 3px;
    background-color: rgba(30, 30, 30, 0.6);
    color: #cccccc;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}
.indices-maximize-btn:hover {
    background-color: #555;
    color: #ffffff;
    border-color: #777;
}

.is-hidden { display: none !important; }
.is-hidden-by-maximize { display: none !important; }
.is-maximized { flex: 0 0 100%; height: 100%; }

.indices-tooltip {
    position: absolute;
    top: 165px;
    left: 185px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #555;
    color: white;
    padding: 10px;
    pointer-events: none;
    z-index: 1000;
    min-width: 180px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    font-size: 12px;
}
.indices-tooltip-header {
    display: flex;
    pointer-events: auto;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    margin-bottom: 5px;
    cursor: grab;
}
.indices-tooltip-header:active,
.indices-tooltip-header.is-dragging {
    cursor: grabbing !important;
}

.indices-tooltip-title {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    pointer-events: none;
}

.indices-tooltip-controls { display: flex; gap: 5px; align-items: center; }
.indices-tooltip-toggle {
    pointer-events: auto;
    background: none; border: 1px solid #777; color: white;
    cursor: pointer; width: 20px; height: 20px;
}
.indices-tooltip-date-row {
    text-align: center;
    color: #aaa;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.indices-tooltip-row {
    display: flex; justify-content: space-between; padding: 2px 0;
}
.indices-tooltip-label { color: #aaa; }
.indices-tooltip-value { font-weight: bold; }
.indices-tooltip-separator { border-top: 1px solid #444; margin: 5px 0; }

.indices-tooltip-section + .indices-tooltip-section {
    border-top: 1px solid #555;
    margin-top: 8px;
    padding-top: 7px;
}

.indices-tooltip-section-title {
    margin-bottom: 4px;
    text-align: center;
    color: #d0d0d0;
    font-weight: bold;
    pointer-events: none;
}

.indices-tooltip-sr-row {
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
}

.indices-tooltip-sr-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.indices-tooltip-sr-row.is-sr-disabled .indices-tooltip-label,
.indices-tooltip-sr-row.is-sr-disabled .indices-tooltip-value {
    color: #666666 !important;
}

.indices-tooltip-sr-row.is-sr-disabled {
    opacity: 0.65;
}

.is-minimized .indices-tooltip-body { display: none; }

.future-detail-overlay {
    position: fixed;
    top: 40px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
}

.future-detail-close {
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 950;
    width: 26px;
    height: 26px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #555;
    border-radius: 3px;
    background: rgba(30, 30, 30, 0.8);
    color: #cccccc;
    cursor: pointer;
}

.future-detail-close:hover {
    background: #555;
    color: #ffffff;
    border-color: #777;
}

.future-detail-stack {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 6px;
    padding: 6px;
    box-sizing: border-box;
}

.future-detail-panel {
    position: relative;
    border: 1px solid #333;
    background: var(--panel-bg);
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#future-detail-price { height: 400px; }
#future-detail-move { height: 150px; }
#future-detail-pressure { height: 150px; }

.future-detail-panel.is-detail-isolated {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 150px;
}

.future-detail-stack:has(.future-detail-panel.is-detail-isolated) {
    overflow-y: hidden;
    padding-bottom: 0;
}

.is-detail-hidden {
    display: none !important;
}

.indices-horizontal-legend {
    position: absolute;
    top: 12px;
    left: 45px;
    z-index: 10;
    display: flex;
    gap: 15px;
    align-items: center;
    pointer-events: none;
}

.indices-legend-title {
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.70);
}

.indices-legend-items {
    display: flex;
    gap: 10px;
    font-size: 12px;
    font-weight: bold;
}

.future-detail-indicator-toggle {
    position: absolute;
    top: 7px;
    right: 10px;
    z-index: 50; 
    width: 24px;
    height: 24px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #555;
    border-radius: 3px;
    background: rgba(30, 30, 30, 0.6);
    color: #cccccc;
}

.future-detail-indicator-toggle:hover {
    background: #555;
    color: #ffffff;
    border-color: #777;
}

/* ==========================================
   MODULE SPREAD : 4 fenÃªtres verticales
   ========================================== */

.spread-part1-panel {
    flex: 1.5; /* Ratio 60% pour la partie haute */
}

.spread-part2-panel {
    flex: 1; /* Ratio 40% pour la partie basse */
    display: flex;
    flex-direction: row; /* 4 fenÃªtres verticales cÃ´te Ã  cÃ´te */
    width: 100%;
    border: 1px solid #333;
    background-color: var(--panel-bg);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.spread-panel {
    flex: 1 1 25%;
    width: 25%;
    height: 100%;
    position: relative;
    border-left: 1px solid #333;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.spread-panel:first-child {
    border-left: none;
}

.spread-panel-header {
    position: absolute;
    top: 1rem;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    z-index: 20;
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    box-sizing: border-box;
}

.spread-panel.is-isolated {
    flex: 1 1 100%;
    width: 100%;
    height: 100%;
}

.spread-panel-toggle {
    position: absolute;
    right: 10px;
    top: 4px;
    background: transparent;
    border: none;
    color: #cccccc;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.spread-panel-toggle:hover {
    color: #ffffff;
}

.spread-part2-panel.has-isolated .spread-panel.is-hidden {
    display: none !important;
}

.spread-part2-panel.has-isolated .spread-panel.is-isolated {
    display: flex;
    flex: 1 1 100%;
    width: 100%;
    height: 100%;
}

/* ==========================================
   VISIBILITÉ LOGOS EN MODE FENÊTRES
   - Bar charts principaux : inchangés
   - Maturity MOVE / PRESSURE : logo masqué en vue multiple,
     visible uniquement quand la fenêtre est ouverte
   - Spread 4 sous-fenêtres : logo masqué en vue 4 fenêtres,
     visible uniquement quand la fenêtre est isolée
   ========================================== */

#future-detail-move:not(.is-detail-isolated) .analysebourses-logo,
#future-detail-pressure:not(.is-detail-isolated) .analysebourses-logo,
.spread-panel:not(.is-isolated) .analysebourses-logo {
    display: none;
}

#future-detail-move.is-detail-isolated .analysebourses-logo,
#future-detail-pressure.is-detail-isolated .analysebourses-logo,
.spread-panel.is-isolated .analysebourses-logo {
    display: block;
}


/* ==========================================
   INFO ICON MODULE
   ========================================== */

.info-icon-wrapper {
    position: fixed;
    bottom: 20px; 
    left: 20px;   
    z-index: 1000;
}

.info-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: blue;
    border: 1px solid yellow;
    color: yellow;
    font-weight: bold;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin: 0;
}

.info-bubble {
    position: absolute;
    bottom: 100%;
    left: 100%;
    margin-bottom: 10px;
    margin-left: 10px;
    background-color: rgba(20, 20, 20, 0.97);
    border: 1px solid #777777;
    color: #e0e0e0;
    padding: 13px 14px;
    width: 430px;
    max-width: calc(100vw - 80px);
    max-height: 68vh;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.45;
    border-radius: 5px;
    pointer-events: auto;
    z-index: 1001;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.75);
}

.info-bubble strong {
    color: #ffffff;
}

.info-bubble-separator {
    height: 1px;
    margin: 9px 0;
    background-color: #444444;
}

.spread-sub-legend {
    top: 22px;
    display: none;
}

.spread-panel.is-isolated .spread-sub-legend {
    display: flex !important;
}


/* ==========================================
   SPEED STUDY
   ========================================== */

.speed-study-view {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    overflow: hidden;
}

.speed-study-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: var(--panel-bg);
    border: 1px solid #333333;
    box-sizing: border-box;
}

#speed-study-main {
    flex: 1.2 1 0;
    width: 100%;
}

.speed-study-bottom {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 72%) minmax(260px, 28%);
    width: 100%;
}

#speed-study-normalized {
    min-width: 0;
    min-height: 0;
    border-top: none;
}

.speed-study-side {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 0.72fr 1.28fr;
}

#speed-study-acceleration,
#speed-study-zscore {
    border-top: none;
    border-left: none;
}

#speed-study-zscore {
    border-top: 1px solid #333333;
}

.speed-study-title {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 20;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.78);
    pointer-events: none;}

#speed-study-main .speed-study-title {
    top: 1.5rem;}

#speed-study-normalized .speed-study-title {
    top: 1.5rem;}

#speed-study-acceleration .speed-study-title {
    top: 0.5rem;}

#speed-study-zscore .speed-study-title {
    top: 0.5rem;}

#speed-study-main .speed-study-title {
    font-size: 16px;}

#speed-study-acceleration .speed-study-title {
    font-size: 12px;}

.speed-study-close {
    position: absolute;
    top: 7px;
    right: 10px;
    z-index: 40;
    border: none;
    background: transparent;
    color: #cccccc;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.speed-study-close:hover {
    color: #ffffff;
}

.speed-study-legend {
    top: 27px;
    left: 55px;
    z-index: 20;
}

.speed-study-canvas {
    width: 100% !important;
    height: 100% !important;
}

.speed-study-diagnostic {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 12px 18px;
    text-align: center;
}

.speed-study-diagnostic-value {
    margin-top: 4px;
    font-size: clamp(21px, 2vw, 34px);
    line-height: 1;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.speed-study-diagnostic-state {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #cccccc;
}

.speed-study-diagnostic-date {
    margin-top: 8px;
    font-size: 11px;
    color: #888888;
    font-variant-numeric: tabular-nums;
}

.speed-study-zscore-bell {
    width: min(96%, 390px);
    height: 88%;
    min-height: 105px;
    margin-top: 0px;
}

.speed-study-zscore-bell svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.speed-study-bell-axis,
.speed-study-bell-tick {
    stroke: var(--indices-speed-bell-axis-color);
    stroke-width: 1.3;
}

.speed-study-bell-curve {
    fill: none;
    stroke: var(--indices-speed-bell-color);
    stroke-width: 2;
}

.speed-study-bell-hist-bar {
    fill: var(--indices-speed-bell-hist-color);
    stroke: none;
}

.speed-study-bell-label {
    fill: #999999;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.speed-study-bell-marker-line {
    stroke: var(--indices-speed-bell-marker-color);
    stroke-width: 2;
    stroke-dasharray: 4 3;
}

.speed-study-bell-marker {
    fill: var(--indices-speed-bell-marker-color);
    stroke: #000000;
    stroke-width: 1.5;
}

.speed-study-zscore-values {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: -2px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .speed-study-bottom {
        grid-template-columns: minmax(0, 65%) minmax(220px, 35%);
    }

    .speed-study-diagnostic-value {
        font-size: 21px;
    }

    .speed-study-diagnostic-state {
        font-size: 10px;
    }
}
