/* ============================================================
   GesTask — Diagramma di Gantt
   Timeline della vista Gantt: intestazioni, righe, barre e suggerimenti.
   ============================================================ */

.gt-gantt {
    background: var(--gt-surface);
    border: 1px solid var(--gt-border);
    border-radius: var(--p-border-radius-lg);
    box-shadow: var(--gt-shadow-sm);
    overflow: hidden;
    animation: fadeSlideIn .25s ease backwards;
}

/* --- Header months row --- */
.gt-gantt-header {
    display: flex;
    border-bottom: 1px solid var(--gt-border);
    background: var(--gt-surface-alt);
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 2;
}

.gt-gantt-header-labels {
    flex: 0 0 220px;
    padding: .6rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-right: 1px solid var(--gt-border);
}

.gt-gantt-header-timeline {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.gt-gantt-month {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .6rem .5rem;
    border-right: 1px solid var(--gt-border);
    white-space: nowrap;
    overflow: hidden;
}

/* --- Rows --- */
.gt-gantt-body { overflow-x: auto; }

.gt-gantt-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--gt-border);
    min-height: 48px;
    transition: background .12s;
}
.gt-gantt-row:last-child { border-bottom: none; }
.gt-gantt-row:hover { background: var(--p-content-hover-background); }

.gt-gantt-label {
    flex: 0 0 220px;
    padding: .5rem 1rem;
    border-right: 1px solid var(--gt-border);
    font-size: .85rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gt-gantt-label small {
    display: block;
    font-size: .72rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-gantt-track {
    flex: 1;
    position: relative;
    height: 48px;
    min-width: 0;
}

/* Today line */
.gt-gantt-today {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: color-mix(in srgb, var(--p-danger-color) 55%, transparent);
    z-index: 1;
    pointer-events: none;
}
.gt-gantt-today::after {
    content: 'Oggi';
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: .65rem;
    font-weight: 700;
    color: var(--gt-danger);
    white-space: nowrap;
}

/* Bar */
.gt-gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    border-radius: var(--p-border-radius-full);
    min-width: 8px;
    cursor: pointer;
    transition: filter .15s, transform .15s;
    display: flex;
    align-items: center;
    padding: 0 .5rem;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: var(--p-shadow-sm);
    z-index: 2;
}
.gt-gantt-bar:hover {
    filter: brightness(1.1);
    transform: translateY(-50%) scaleY(1.1);
}

/* Bar colours by priority */
.gt-gantt-bar.prio-low    { background: var(--p-priority-low); }
.gt-gantt-bar.prio-normal { background: var(--p-priority-normal); }
.gt-gantt-bar.prio-high   { background: var(--p-priority-high); }
.gt-gantt-bar.prio-urgent { background: var(--p-priority-urgent); }

/* Done overlay */
.gt-gantt-bar-done {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: var(--p-border-radius-full);
    background: rgba(255, 255, 255, .28);
    pointer-events: none;
}

/* Tooltip */
.gt-gantt-tooltip {
    position: fixed;
    background: var(--p-surface-900);
    color: var(--p-surface-50);
    border-radius: var(--p-border-radius-md);
    padding: .5rem .75rem;
    font-size: .78rem;
    line-height: 1.5;
    pointer-events: none;
    z-index: 9999;
    box-shadow: var(--gt-shadow-lg);
    max-width: 220px;
    display: none;
}

/* Empty state */
.gt-gantt-empty {
    padding: 2.5rem;
    text-align: center;
    color: var(--bs-secondary-color);
    font-size: .9rem;
}
.gt-gantt-empty i { font-size: 2.5rem; opacity: .3; display: block; margin-bottom: .75rem; }

