/* ==================================================================
   Causal Pathways: Panel "Top 5 Pfade" neben dem Graphen
   (Handoff "Causal Pathways 1b - Timeline Strips")

   Markup: ExpertUI.view.predModel.Graph (html), befuellt von
   GraphController.renderTopPathsPanel, Zustaende (is-active / is-dim)
   von GraphController.applyPanelState. Ein-/ausgeblendet ueber
   .xcpPanelOff am Wrapper (Header-Button "toggleTopPathsBtn",
   standardmaessig aus).

   No SASS / theme rebuild required.
   ================================================================== */

body .xcpWrap {
    --xcp-teal: #589999;
    --xcp-plum: #644162;
    --xcp-plum-50: #F3EFF2;
    --xcp-red: #DC2A48;
    --xcp-blue-1: #7BAEE0;                   /* = Kategorie "1 Schritt" im Graphen */
    --xcp-blue-2: #417DBF;                   /* = Kategorie ">= 2 Schritte" */
    --xcp-text: #2A3138;
    --xcp-muted: #97A2AD;
    --xcp-ring: #D2D7DC;
    --xcp-border: #E7EAED;
    --xcp-dot-border: #ffffff;

    /* absolut am Panel-Body (bzw. an der Vollbild-Ebene) verankert: Ext
       legt das html in einen table-cell-Container, darin loest
       height:100% nicht auf - der Chart bekaeme Hoehe 0 */
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    min-width: 0;
}

body.oe-theme-dark .xcpWrap {
    --xcp-teal: #62a8a8;
    --xcp-plum: #b48db1;
    --xcp-plum-50: rgba(180, 141, 177, 0.14);
    --xcp-text: #e6e8eb;
    --xcp-muted: #93a4bd;
    --xcp-ring: #454d5e;
    --xcp-border: #2f3542;
    --xcp-dot-border: #1e2129;
}

body .xcpWrap > .xcpChart {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
}

body .xcpWrap > .xcpPanel {
    flex: 0 0 auto;
    width: clamp(420px, 34%, 640px);
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid var(--xcp-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--xcp-text);
    font-size: 12px;
}

body .xcpWrap.xcpPanelOff > .xcpPanel {
    display: none;
}

/* im Vollbild sitzt der "Minimieren"-Button oben rechts ueber dem Panel */
body div.xgraphFullscreen .xcpWrap > .xcpPanel {
    padding-top: 60px;
}

body .xcpPanel .xcpHead {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--xcp-muted);
    padding-bottom: 8px;
}

body .xcpPanel .xcpEmpty {
    color: var(--xcp-muted);
    padding: 12px;
    line-height: 1.4;
}

/* ---- eine Pfad-Zeile ---- */
body .xcpPanel .xcpRow {
    --xcp-accent: var(--xcp-teal);

    cursor: pointer;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    opacity: 1;
    transition: all .15s ease;
}

body .xcpPanel .xcpRow.is-active {
    --xcp-accent: var(--xcp-plum);
    background: var(--xcp-plum-50);
}

body .xcpPanel .xcpRow.is-dim {
    opacity: .55;
}

body .xcpPanel .xcpTitle {
    display: flex;
    align-items: center;
    gap: 8px;
}

body .xcpPanel .xcpRank {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: var(--xcp-accent);
}

body .xcpPanel .xcpMeta {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--xcp-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body .xcpPanel .xcpEffect {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: var(--xcp-text);
    font-variant-numeric: tabular-nums;
}

/* ---- Zeitleiste: links = linker Rand der X-Achse, rechts = Target ---- */
body .xcpPanel .xcpStrip {
    position: relative;
    height: 26px;
    /* die Punkte ragen um ihren halben Durchmesser ueber die Enden */
    margin: 0 9px;
}

body .xcpPanel .xcpBase {
    position: absolute;
    left: 0;
    right: 0;
    top: 13px;
    height: 1px;
    background: var(--xcp-border);
}

body .xcpPanel .xcpSeg {
    position: absolute;
    top: 12px;
    height: 3px;
    border-radius: 2px;
    background: var(--xcp-accent);
    transition: background .15s ease;
}

body .xcpPanel .xcpDot {
    position: absolute;
    top: 2px;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 2px solid var(--xcp-dot-border);
    box-shadow: 0 0 0 1px var(--xcp-ring);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

body .xcpPanel .xcpDot1      { background: var(--xcp-blue-1); }
body .xcpPanel .xcpDot2      { background: var(--xcp-blue-2); }
body .xcpPanel .xcpDotTarget { background: var(--xcp-red); }

/* ---- Schritte: einzeilig, voller Text als Tooltip ---- */
body .xcpPanel .xcpSteps {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 4px;
}

body .xcpPanel .xcpStep {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

body .xcpPanel .xcpStep b         { font-weight: 700; }
body .xcpPanel .xcpStep .xcpNum1  { color: var(--xcp-blue-1); }
body .xcpPanel .xcpStep .xcpNum2  { color: var(--xcp-blue-2); }

body .xcpPanel .xcpLbl {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--xcp-text);
}

body .xcpPanel .xcpDay {
    color: var(--xcp-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body .xcpPanel .xcpAxis {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--xcp-muted);
    padding: 4px 12px 0;
    font-variant-numeric: tabular-nums;
}

/* ---- Header-Button im ausgeschalteten Zustand: Icon gedaempft ---- */
body div.predictionPanelWindow .x-panel-header .graphHeaderToggleBtn.graphHeaderToggleBtnOff.x-btn {
    background: transparent !important;
    border: 1px solid #dfe3ea !important;
}

body div.predictionPanelWindow .x-panel-header .graphHeaderToggleBtn.graphHeaderToggleBtnOff.x-btn .x-btn-icon-el {
    color: #8b97a3 !important;
}

body.oe-theme-dark div.predictionPanelWindow .x-panel-header .graphHeaderToggleBtn.graphHeaderToggleBtnOff.x-btn {
    background: transparent !important;
    border: 1px solid #394051 !important;
}

body.oe-theme-dark div.predictionPanelWindow .x-panel-header .graphHeaderToggleBtn.graphHeaderToggleBtnOff.x-btn .x-btn-icon-el {
    color: #93a4bd !important;
}

/* ---- Vollbild: Umschalter links neben dem "Minimieren"-Button ----
   Grundoptik kommt von .xgraphFullscreenExitBtn (predtable-filters.css),
   hier nur die Position und der ausgeschaltete Zustand. */
body div.xgraphFullscreen .xgraphFullscreenExitBtn.xgraphFullscreenPathsBtn.x-btn {
    right: 70px !important;
}

body div.xgraphFullscreen .xgraphFullscreenPathsBtn.graphHeaderToggleBtnOff.x-btn {
    background: #ffffff !important;
    border: 1px solid #dfe3ea !important;
}

body div.xgraphFullscreen .xgraphFullscreenPathsBtn.graphHeaderToggleBtnOff.x-btn .x-btn-icon-el {
    color: #8b97a3 !important;
}

body.oe-theme-dark div.xgraphFullscreen .xgraphFullscreenPathsBtn.graphHeaderToggleBtnOff.x-btn {
    background: transparent !important;
    border: 1px solid #394051 !important;
}

body.oe-theme-dark div.xgraphFullscreen .xgraphFullscreenPathsBtn.graphHeaderToggleBtnOff.x-btn .x-btn-icon-el {
    color: #93a4bd !important;
}
