@import './light.css';

/* ===== Main Wrapper ===== */
.gantt-main-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== Fixed Header - Stays at Top ===== */
.gantt-header-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e4e8;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    width: 100%; /* Full width */
}

/* ===== Scrollable Content - Vertical Only ===== */
.gantt-container {
    line-height: 14.5px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 12px;
    flex: 1;
    width: 100%;
    background: #ffffff;

    & .popup-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        background: #fff;
        box-shadow: 0px 10px 24px -3px rgba(0, 0, 0, 0.2);
        padding: 10px;
        border-radius: 5px;
        width: max-content;
        z-index: 1000;

        & .title {
            margin-bottom: 2px;
            color: var(--g-text-dark);
            font-size: 0.85rem;
            font-weight: 650;
            line-height: 15px;
        }

        & .subtitle {
            color: var(--g-text-dark);
            font-size: 0.8rem;
            margin-bottom: 5px;
        }

        & .details {
            color: var(--g-text-muted);
            font-size: 0.7rem;
        }
    }

    & .current-highlight {
        position: absolute;
        background: var(--g-today-highlight);
        width: 2px;
        z-index: 999;
    }

    & .extras {
        display: none; /* Hide pagination arrows */
    }

    .hide {
        display: none;
    }
}

/* ===== Grid Header ===== */
.grid-header {
    background-color: #f8f9fa;
    position: relative;
    width: 100%;
    display: block;
}

.upper-header {
    position: relative;
    width: 100%;
    display: block;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
}

.lower-header {
    position: relative;
    width: 100%;
    display: block;
    background: #f8f9fa;
}

/* ===== Header Text with Separators ===== */
.lower-text {
    font-size: 11px;
    position: absolute;
    width: calc(var(--gv-column-width) * 0.8);
    margin: 0 calc(var(--gv-column-width) * 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6b7280;
    font-weight: 500;
    border-right: 1px solid #e8eaed;
}

.upper-text {
    position: absolute;
    width: fit-content;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-right: 2px solid #d1d5db;
}

.current-upper {
    position: sticky;
    left: 0 !important;
    padding-left: 17px;
    background: #f8f9fa;
    z-index: 10;
    color: #2563eb !important;
    font-weight: 700;
}

/* ===== HIDE SIDE HEADER (built-in controls) ===== */
.side-header {
    display: none !important;
}

/* ===== Current Date Indicators ===== */
.current-ball-highlight {
    position: absolute;
    background: #2563eb;
    z-index: 1001;
    border-radius: 50%;
}

.current-date-highlight {
    background: #2563eb !important;
    color: white !important;
    border-radius: 3px;
}

/* ===== SVG Gantt Chart ===== */
.gantt {
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    display: block;
    width: 100%;

    & .grid-background {
        fill: none;
    }

    & .grid-row {
        fill: var(--g-row-color);
    }

    & .grid-row:nth-child(even) {
        fill: #f9fafb;
    }

    & .row-line {
        stroke: var(--g-border-color);
        stroke-width: 0.5;
    }

    & .tick {
        stroke: var(--g-tick-color);
        stroke-width: 0.4;

        &.thick {
            stroke: #d1d5db;
            stroke-width: 1.5;
        }
    }

    & .arrow {
        fill: none;
        stroke: var(--g-arrow-color);
        stroke-width: 1.5;
    }

    & .bar-wrapper .bar {
        fill: var(--g-bar-color);
        stroke: var(--g-bar-border);
        stroke-width: 0;
        transition: stroke-width 0.3s ease;
    }

    & .bar-progress {
        fill: var(--g-progress-color);
        border-radius: 4px;
    }

    & .bar-label {
        fill: var(--g-text-dark);
        dominant-baseline: central;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 13px;
        font-weight: 400;
    }

    & .handle {
        fill: var(--g-handle-color);
        opacity: 0;
        transition: opacity 0.3s ease;
        
        &.active,
        &.visible {
            cursor: ew-resize;
            opacity: 1;
        }
    }

    & .bar-wrapper {
        cursor: pointer;

        & .bar {
            outline: 1px solid var(--g-row-border-color);
            border-radius: 3px;
        }

        &:hover {
            .bar {
                transition: transform 0.3s ease;
            }
        }
    }
}

/* ===== FOOTER CONTROLS ===== */
.gantt-footer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 2px solid #e0e4e8;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.06);
}

.gantt-footer-controls .footer-left,
.gantt-footer-controls .footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gantt-footer-controls .today-btn {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gantt-footer-controls .today-btn:hover {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gantt-footer-controls .view-mode-select {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 28px 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    min-width: 140px;
    height: 32px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.gantt-footer-controls .view-mode-select:hover {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gantt-footer-controls .view-mode-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}