/* Gantt Specific Styles */

:root {
    --gantt-border: rgba(0, 0, 0, 0.1);
    --gantt-bg: rgba(255, 255, 255, 0.5);
    --gantt-header-bg: rgba(255, 255, 255, 0.8);
    --gantt-weekend-bg: rgba(0, 0, 0, 0.08); /* Darker for visibility */
}

/* Ensure border-box for all Gantt elements to fix alignment */
.gantt-container * {
    box-sizing: border-box;
}

body.dark-mode {
    --gantt-border: rgba(255, 255, 255, 0.05);
    --gantt-bg: rgba(0, 0, 0, 0.2);
    --gantt-header-bg: rgba(255, 255, 255, 0.05);
    --gantt-weekend-bg: rgba(255, 255, 255, 0.1); /* Lighter/visible in dark mode */
}

.full-width-container {
    max-width: 100% !important;
    padding: 0 1rem;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.gantt-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gantt-wrapper {
    overflow-x: auto;
    border: 1px solid var(--gantt-border);
    border-radius: 8px;
    background: var(--gantt-bg);
    position: relative;
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.gantt-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Grid Layout */
.gantt-container {
    display: grid;
    /* Grid columns will be defined dynamicall in JS based on days */
    /* grid-template-columns: 200px repeat(30, 40px); */
}

/* Header Row */
.gantt-row-header {
    display: contents; /* Makes children participate in the main grid */
}

.gantt-cell-header {
    background: var(--gantt-header-bg);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    border-right: 1px solid var(--gantt-border);
    border-bottom: 1px solid var(--gantt-border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
    color: var(--text-color);
}

.gantt-cell-project-header {
    position: sticky;
    left: 0;
    width: 100%; /* Let grid define width (250px) */
    background: var(--card-bg);
    z-index: 20;
    border-right: 1px solid var(--gantt-border);
    display: flex;
    align-items: center;
    padding-left: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--gantt-border); /* Thicker line */
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Project Body Rows */
.gantt-row {
    display: contents;
}

.gantt-cell-project {
    position: sticky;
    left: 0;
    background: var(--card-bg); /* Match background to hide scroll content */
    border-right: 1px solid var(--gantt-border);
    border-bottom: 2px solid var(--gantt-border); /* Thicker line */
    padding: 0.5rem 1rem;
    z-index: 5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--text-color);
}

.gantt-cell-project small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.gantt-cell-day {
    border-right: 1px solid var(--gantt-border);
    border-bottom: 1px solid var(--gantt-border);
    min-height: 40px;
    position: relative;
}

.gantt-cell-day.weekend {
    background: var(--gantt-weekend-bg);
}

.gantt-cell-day.today {
    background: rgba(16, 185, 129, 0.1); 
}

.project-separator {
    border-bottom: 2px solid var(--gantt-border) !important;
}

/* Task Bars */
.gantt-task-bar {
    position: absolute;
    top: 6px;
    bottom: 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
    transition: transform 0.2s, z-index 0.2s;
}

.gantt-task-bar:hover {
    transform: scale(1.02);
    z-index: 10;
    width: auto !important; /* Expand to show full text on hover if needed? Maybe just min-width */
    min-width: 100%;
}

/* Task Colors */
.bar-completed { background: linear-gradient(90deg, #10B981 0%, #059669 100%); }
.bar-overdue { background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%); }
.bar-warning { background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%); }
.bar-pending { background: linear-gradient(90deg, #6B7280 0%, #4B5563 100%); }

/* Legend Dots */
.dot {
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    display: inline-block;
}


