/* Timeline Schedule Visualization Styles */

.timeline-schedule-container {
    position: relative;
    margin: 15px 0;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Timeline Grid */
.timeline-grid {
    position: relative;
    height: 110px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

/* Hour markers */
.timeline-hours {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 22px;
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f5f5f5;
    overflow: hidden;
    z-index: 1;
}

.hour-marker {
    flex: 1;
    text-align: center;
    font-size: 10px;
    color: #666;
    border-right: 1px solid #e0e0e0;
    padding: 6px 0;
    font-weight: 500;
    position: relative;
    z-index: 2;
    background: transparent;
}

.hour-marker:last-child {
    border-right: none;
}

/* Schedule overlay */
.schedule-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.2);
    border-left: 2px solid rgba(52, 152, 219, 0.5);
    border-right: 2px solid rgba(52, 152, 219, 0.5);
    z-index: 1;
    pointer-events: none;
}

.schedule-label {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 11px;
    color: #2980b9;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Time entries layer */
.timeline-entries {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Individual time entry blocks */
.timeline-entry {
    position: absolute;
    background: #27ae60;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 36px;
}

.timeline-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.timeline-entry.break {
    background: #f39c12;
}

.timeline-entry.running {
    background: #3498db;
    animation: pulse 2s infinite;
}

/* pulse keyframes defined in styles.css */

.entry-label {
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.4;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.entry-time {
    font-size: 10px;
    line-height: 1.3;
    opacity: 0.9;
}

/* Gap indicators */
.timeline-gap {
    position: absolute;
    background: repeating-linear-gradient(
        45deg,
        #e74c3c,
        #e74c3c 5px,
        #c0392b 5px,
        #c0392b 10px
    );
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.timeline-gap:hover {
    opacity: 0.5;
}

.gap-duration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #c0392b;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 2px;
}

/* Current time indicator */
.current-time-indicator {
    position: absolute;
    top: 30px;
    bottom: 0;
    width: 2px;
    background: #e74c3c;
    z-index: 20;
    pointer-events: none;
}

.current-time-indicator::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
}

/* Coverage meter */
.coverage-meter {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coverage-bar {
    flex: 1;
    height: 16px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.coverage-fill {
    height: 100%;
    background: linear-gradient(to right, #27ae60, #2ecc71);
    transition: width 0.3s ease;
}

.coverage-text {
    min-width: 60px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* Legend */
.timeline-legend {
    display: flex;
    gap: 15px;
    margin-top: 11px;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
body.dark-mode .timeline-schedule-container {
    background: #2c3e50;
    color: #ecf0f1;
}

body.dark-mode .timeline-grid {
    background: #34495e;
    border-color: #4a5f7a;
}

body.dark-mode .timeline-hours {
    background: #2c3e50;
    border-color: #4a5f7a;
}

body.dark-mode .hour-marker {
    color: #bdc3c7;
    border-color: #4a5f7a;
}

body.dark-mode .schedule-overlay {
    background: rgba(52, 152, 219, 0.25);
}

body.dark-mode .coverage-bar {
    background: #34495e;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-grid {
        height: 160px;
    }
    
    .hour-marker {
        font-size: 10px;
        padding: 5px 0;
    }
    
    .timeline-legend {
        flex-wrap: wrap;
        gap: 10px;
    }
}