/* Master Plan Gantt Chart Styles */
.gantt-container {
    overflow-x: auto;
    min-height: 400px;
}

.gantt-chart {
    position: relative;
    width: 100%;
    min-width: 800px;
}

.timeline-header {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

.timeline-scale {
    display: flex;
    padding-top: 10px;
    padding-bottom: 10px;
}

.timeline-unit {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    min-width: 80px;
    padding: 5px 0;
    border-right: 1px solid #e9ecef;
}

.task-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    min-height: 40px;
    align-items: stretch;
    position: relative;
}

.task-row:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.task-label {
    width: 200px;
    min-width: 200px;
    padding: 8px;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 5;
}

.task-label-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-timeline {
    flex: 1;
    position: relative;
    min-width: 600px;
    display: flex;
}

.task-bar {
    position: absolute;
    height: 18px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    cursor: pointer;
    z-index: 1;
    transition: all 0.2s ease;
}

.task-bar:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.task-bar-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

.task-status-planned {
    background-color: #6c757d;
}

.task-status-in-progress {
    background-color: #007bff;
}

.task-status-completed {
    background-color: #28a745;
}

.task-status-overdue {
    background-color: #dc3545;
}

.task-status-on-hold {
    background-color: #ffc107;
}

.milestone {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-color: #6610f2;
    border-radius: 50%;
    z-index: 2;
    cursor: pointer;
}

.milestone:hover {
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 0 5px rgba(102, 16, 242, 0.5);
}

.milestone::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #6610f2;
    z-index: -1;
}

.today-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dc3545;
    z-index: 1;
}

.today-marker::before {
    content: 'Today';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.timeline-selector .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.timeline-selector .btn.active {
    background-color: #007bff;
    color: white;
}

.task-group-header {
    background-color: #e9ecef;
    font-weight: 500;
    cursor: pointer;
}

.task-group-header:hover {
    background-color: #dee2e6;
}

.task-group-toggle {
    margin-right: 8px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.task-group-toggle.collapsed {
    transform: rotate(-90deg);
}

.dependency-line {
    position: absolute;
    border-top: 2px dashed #6c757d;
    z-index: 0;
}

.tooltip-wrapper {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 150px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    z-index: 100;
    text-align: center;
}

.task-bar:hover .tooltip-wrapper,
.milestone:hover .tooltip-wrapper {
    opacity: 1;
}

.control-panel {
    background-color: #f8f9fa;
}

/* Task details panel custom styles */
#taskDetailsPanel {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

#taskDetailsPanel .card-header {
    background-color: #f8f9fa;
}

/* Dark mode compatibility */
.dark-mode .timeline-header,
.dark-mode .task-label,
.dark-mode .control-panel {
    background-color: #2c3034;
    color: #e1e1e1;
}

.dark-mode .timeline-unit,
.dark-mode .task-row {
    border-color: #404040;
}

.dark-mode .task-group-header {
    background-color: #343a40;
}

.dark-mode .task-group-header:hover {
    background-color: #404040;
}

.dark-mode .task-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .task-label {
        width: 150px;
        min-width: 150px;
    }
    
    .timeline-unit {
        min-width: 60px;
    }
}