/* Schedule / Gantt Chart Styles */
/* Custom styling for Bryntum Gantt in Groundplan */

/* Critical path highlighting */
.critical-path .b-gantt-task-content {
    background: var(--accent-red) !important;
    box-shadow: 0 0 8px rgba(205, 66, 70, 0.5);
}

.critical-path:hover .b-gantt-task-content {
    background: #e04a4e !important;
}

/* Today marker */
.b-current-time-line {
    background: var(--accent-red) !important;
    z-index: 10;
}

/* Baseline bars (grå under nuvarande) */
.b-baseline-task {
    background: rgba(167, 182, 194, 0.3) !important;
    border: 1px solid var(--border-primary);
}

/* Progress bars */
.b-gantt-task-percent {
    background: rgba(0, 0, 0, 0.2);
}

/* ÄTA time extension markers (kommer senare) */
.ata-extension {
    background: rgba(35, 133, 81, 0.1);
    border-left: 3px solid var(--accent-green);
    pointer-events: all;
    cursor: pointer;
}

.ata-extension:hover {
    background: rgba(35, 133, 81, 0.2);
}

/* Team avatar circles in resource column */
.gp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

/* Non-working time (weekends, holidays) — subtle shading in timeline */
.b-sch-nonworkingtime {
    background: rgba(0, 0, 0, 0.12);
}

/* Holiday labels in header */
.b-sch-nonworkingtime-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* WBS column — compact */
.b-wbs-column {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

/* Toolbar view combo — match dark theme */
.b-toolbar .b-combo {
    min-width: 140px;
}

.b-toolbar .b-combo .b-field-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Critical path row highlighting (Bryntum native) */
.b-gantt-critical-path .b-grid-row {
    background: rgba(205, 66, 70, 0.08);
}

/* Schedule container */
.schedule-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: var(--space-md);
}

/* Schedule tabs styling */
.schedule-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.schedule-tab {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.schedule-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.schedule-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Gantt container */
.schedule-container .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#bryntum_gantt_container {
    width: 100%;
    height: 100%;
}

/* Toolbar button styling (matcha Groundplan design) */
.b-toolbar .b-button.b-blue {
    background: var(--accent-blue);
    color: white;
}

.b-toolbar .b-button.b-blue:hover {
    background: #1e5bb8;
}

.b-toolbar .b-button.b-raised {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Loading spinner */
.schedule-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

/* Resource Histogram — dark theme overrides */
#bryntum_histogram_container {
    width: 100%;
    overflow: hidden;
}

#bryntum_histogram_container .b-histogram {
    background-color: var(--bg-primary, #1C2127);
}

#bryntum_histogram_container .b-resourcehistogram,
#bryntum_histogram_container .b-grid-base {
    --b-grid-background: var(--bg-primary, #1C2127);
    --b-grid-cell-background: var(--bg-primary, #1C2127);
    --b-grid-cell-color: var(--text-primary, #F6F7F9);
    --b-grid-row-border-color: var(--border-primary, #383E47);
    --b-grid-cell-border-color: var(--border-primary, #383E47);
    --b-grid-header-background: var(--bg-secondary, #252A31);
    --b-grid-header-color: var(--text-secondary, #A7B6C2);
}

/* Histogram bar colors — override color-mix that becomes invisible on dark bg */
#bryntum_histogram_container .b-histogram rect {
    fill: rgba(35, 133, 81, 0.6);
}

#bryntum_histogram_container .b-histogram rect.b-exceeds-top {
    fill: rgba(205, 66, 70, 0.8);
}

/* Outline path */
#bryntum_histogram_container .b-histogram path {
    stroke: rgba(35, 133, 81, 0.4);
}

/* Scale text (8h etc) */
#bryntum_histogram_container .b-histogram text,
#bryntum_histogram_container .b-scale text {
    fill: var(--text-muted, #738091);
}

/* Grid splitter between name column and timeline */
#bryntum_histogram_container .b-grid-splitter {
    background: var(--border-primary, #383E47);
}

/* Error state */
.schedule-error {
    padding: var(--space-lg);
    background: rgba(205, 66, 70, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-md);
    color: var(--accent-red);
}
