/* gantt.css — Phase 8: Timeline/Gantt layout + styles */

/* ---- Gantt shell (reuses .board as outer wrapper) ---- */
.gantt {
    /* inherits from .board: flex column, height 100%, overflow hidden */
}

/* ---- Two-panel body ---- */
.gantt__body {
    display: flex;
    flex: 1;
    overflow: hidden;
    border-top: 1px solid var(--color-border);
    position: relative;   /* Containing block für die schwebende Zoom-Steuerung */
}

/* ---- Left: fixed label panel ---- */
.gantt__labels {
    width: 220px;
    flex-shrink: 0;
    overflow: hidden;               /* no scroll — synced with chart */
    border-right: 1px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
}

.gantt__label-header {
    flex-shrink: 0;
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
}

.gantt__label-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.12s;
}

.gantt__label-row:hover {
    background: color-mix(in srgb, var(--color-accent) 6%, transparent) !important;
}

.gantt__label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gantt__label-text {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Welle B2 Slice D — Subtask-Zeilen in der Timeline (eingerückt, gedämpft). */
.gantt__label-row--sub { padding-left: 16px; }
.gantt__label-row--sub .gantt__label-text { color: var(--color-text-secondary); }
.timeline-row--sub { opacity: 0.78; }

/* ---- Right: scrollable chart ---- */
.gantt__chart-wrap {
    flex: 1;
    overflow: auto;
    position: relative;
    background: var(--color-bg);
}

/* SVG text defaults */
.gantt__chart-wrap svg text {
    dominant-baseline: auto;
    pointer-events: none;
    user-select: none;
}

/* ---- Tooltip ---- */
.gantt__tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    padding: var(--space-2) var(--space-3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gantt__tooltip-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt__tooltip-status {
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gantt__tooltip-due {
    font-size: 11px;
    color: var(--color-text-secondary);
}

/* ---- Timeline axis (rendered in SVG but styled here for reference) ---- */
.timeline-axis {
    /* SVG group — styling via SVG attributes in gantt.js */
}

/* ---- Mobile responsive: gantt timeline ---- */
@media (max-width: 639px) {
    .gantt__labels {
        width: 140px;
    }

    .gantt__label-header,
    .gantt__label-row {
        padding: 0 var(--space-2);
    }

    .gantt__label-text {
        font-size: 11px;
    }

    .gantt__tooltip {
        max-width: 160px;
        font-size: 11px;
        padding: var(--space-1) var(--space-2);
    }
}

/* Meilenstein-Raute (TIME-03): leichter Hover-Effekt. */
.timeline-milestone {
    transition: opacity 0.12s ease;
}
.timeline-row:hover .timeline-milestone {
    opacity: 0.85;
}

/* Export-Leiste (TIME-08): PNG/PDF-Buttons rechts im Timeline-Kopf. */
.gantt__export {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}
.gantt__export-btn {
    font-size: 13px;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-subtle);
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.gantt__export-btn:hover:not(:disabled) {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
}
.gantt__export-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Critical-Path-Toggle (TIME-04) — aktiver Zustand rot. */
.gantt__crit-toggle.is-active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.gantt__crit-toggle.is-active:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

/* Task-Nummer in der Label-Spalte (TIME-04-Follow-up, Redmine-Stil). */
.gantt__label-num {
    font-size: 11px;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    font-weight: var(--font-weight-semibold);
}

/* Ziehbarer Teiler zwischen Label-Spalte und Chart. */
.gantt__resizer {
    width: 6px;
    flex-shrink: 0;
    cursor: col-resize;
    background: transparent;
    align-self: stretch;
    transition: background 0.12s ease;
    touch-action: none;
}
.gantt__resizer:hover,
.gantt__resizer.is-dragging {
    background: color-mix(in srgb, var(--color-accent) 35%, transparent);
}

/* Zoom-Steuerung (Ganzbild / + / −) — schwebend unten rechts im Chart. */
.gantt__zoom {
    /* fixed statt absolute: der Gantt-Body reicht nicht bis zum Fensterboden
       (#app hat min-height, darunter bleibt Leerraum) → fixed ankert am Viewport,
       so sitzen die Buttons ganz unten im FENSTER statt am Chart-Ende. */
    position: fixed;
    right: 18px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 50;
}
.gantt__zoom-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.gantt__zoom-btn:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-border-strong);
}
.gantt__zoom-btn--fit { font-size: 15px; }

/* Baseline-Auswahl (TIME-05) im Timeline-Kopf. */
.gantt__baseline-select {
    font-size: 13px;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-subtle);
    color: var(--color-text);
    cursor: pointer;
    max-width: 200px;
}
.gantt__baseline-select:hover {
    border-color: var(--color-border-strong);
}

/* ── Mindmap / Entitäten-Graph (#19 Säule 2) ─────────────────────────── */
.mindmap__canvas {
    position: relative;
    overflow: hidden;
    /* konkrete Höhe: der Flex-Container ist sonst content-height → height:100%-SVG = 0 */
    height: calc(100vh - 168px);
    min-height: 420px;
    background: var(--color-bg);
}
.mindmap__svg {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}
.mindmap__svg.is-panning { cursor: grabbing; }
.mindmap__node { cursor: default; }
.mindmap__node:hover circle { filter: brightness(1.08); }

.mindmap__legend {
    position: absolute;
    top: 12px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    background: color-mix(in srgb, var(--color-surface) 88%, transparent);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--space-2) var(--space-3);
    font-size: 12px;
    color: var(--color-text-secondary);
    z-index: 10;
    pointer-events: none;
}
.mindmap__legend-item { display: flex; align-items: center; gap: 6px; }
.mindmap__legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.mindmap__legend-size {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--color-text-disabled);
    display: inline-block;
}
