/* ============================================================
   Gantt Chart & Timeline Styles
   ============================================================ */

/* ---- Gantt Container ---- */
.gantt-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary);
}

.gantt-svg {
    display: block;
    min-width: 100%;
}

/* ---- Gantt Header Row ---- */
.gantt-header-bg {
    fill: var(--color-bg-quaternary);
}
.gantt-header-text {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    fill: var(--color-text-muted);
}
.gantt-header-line {
    stroke: var(--color-border-secondary);
    stroke-width: 1;
}

/* ---- Gantt Rows ---- */
.gantt-row-bg {
    fill: transparent;
    transition: fill var(--transition-fast);
}
.gantt-row-bg:hover {
    fill: rgba(59, 130, 246, 0.05);
}
.gantt-row-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    fill: var(--color-text-secondary);
}
.gantt-row-divider {
    stroke: var(--color-border-secondary);
    stroke-width: 0.5;
}

/* ---- Gantt Bars ---- */
.gantt-bar {
    rx: 3;
    ry: 3;
    cursor: pointer;
    transition: all var(--transition-fast);
    stroke-width: 0;
}
.gantt-bar:hover {
    filter: brightness(1.2);
    stroke: white;
    stroke-width: 1;
    stroke-opacity: 0.5;
}

.gantt-bar--completed {
    fill: var(--color-bg-quaternary);
    opacity: 0.6;
}
.gantt-bar--active {
    fill: var(--color-accent-blue);
}
.gantt-bar--disrupted {
    fill: var(--color-accent-red);
    animation: bar-pulse 2s ease-in-out infinite;
}
.gantt-bar--proposed {
    fill: var(--color-accent-amber);
    stroke: var(--color-accent-amber);
    stroke-width: 1;
    stroke-dasharray: 4 2;
    fill-opacity: 0.5;
}
.gantt-bar--maintenance {
    fill: var(--color-accent-purple);
    fill-opacity: 0.5;
    stroke: var(--color-accent-purple);
    stroke-dasharray: 2 2;
}

.gantt-bar-text {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    fill: white;
    pointer-events: none;
}

/* ---- Current Time Indicator ---- */
.gantt-now-line {
    stroke: var(--color-accent-red);
    stroke-width: 1.5;
    stroke-dasharray: 4 2;
}
.gantt-now-marker {
    fill: var(--color-accent-red);
}
.gantt-now-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    fill: var(--color-accent-red);
}

/* ---- Dependency Arrows ---- */
.gantt-dependency {
    fill: none;
    stroke: var(--color-text-muted);
    stroke-width: 1;
    marker-end: url(#arrowhead);
    opacity: 0.5;
}

/* ---- Gantt Tooltip ---- */
.gantt-tooltip {
    position: absolute;
    z-index: var(--z-popover);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    font-size: var(--text-xs);
    min-width: 180px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.gantt-tooltip.visible {
    opacity: 1;
}
.gantt-tooltip__title {
    font-weight: var(--weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}
.gantt-tooltip__row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    color: var(--color-text-tertiary);
}
.gantt-tooltip__row-value {
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
}

/* ---- Vertical Timeline ---- */
.vtimeline {
    position: relative;
    padding-left: var(--space-8);
}
.vtimeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border-primary);
}
.vtimeline__entry {
    position: relative;
    padding-bottom: var(--space-4);
    animation: fade-in 0.3s ease;
}
.vtimeline__entry:last-child {
    padding-bottom: 0;
}
.vtimeline__dot {
    position: absolute;
    left: -22px;
    top: 2px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-primary);
}
.vtimeline__dot--critical {
    background: var(--color-accent-red);
    box-shadow: 0 0 8px var(--color-accent-red-glow);
}
.vtimeline__dot--warning {
    background: var(--color-accent-amber);
}
.vtimeline__dot--info {
    background: var(--color-accent-blue);
}
.vtimeline__dot--success {
    background: var(--color-accent-green);
}
.vtimeline__time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-bottom: 2px;
}
.vtimeline__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: 2px;
}
.vtimeline__desc {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    line-height: var(--leading-relaxed);
}

@keyframes bar-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
