/**
 * timeline.css - Timeline Analysis Tool Styles
 *
 * Styles for the Time-Based Analysis Dashboard
 * Follows BPRboard design system with Catppuccin color palette
 *
 * CREATED: 2024-11-13
 */

/* Timeline Container */
.timeline-container {
    padding: 20px;
}

/* Time Range Overview */
.time-range-overview {
    margin: 20px 0;
    padding: 20px;
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border-color, #313244);
    border-radius: 8px;
}

.time-range-overview h3 {
    color: var(--text-primary, #f2f2ed);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* View Navigation */
.view-navigation {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background: rgba(30, 30, 46, 0.4);
    border-radius: 8px;
}

.nav-btn {
    flex: 1;
    padding: 10px 20px;
    background: rgba(137, 180, 250, 0.1);
    border: 1px solid rgba(137, 180, 250, 0.3);
    border-radius: 6px;
    color: var(--text-primary, #cdd6f4);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(137, 180, 250, 0.2);
    border-color: rgba(137, 180, 250, 0.5);
}

.nav-btn.active {
    background: var(--primary, #89b4fa);
    border-color: var(--primary, #89b4fa);
    color: #1e1e2e;
    font-weight: 600;
}

/* Timeline Visualization Container */
.timeline-viz-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border-color, #313244);
    border-radius: 8px;
    min-height: 400px;
}

/* Chart Container */
.chart-container {
    width: 100%;
    margin: 20px 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #313244);
}

.chart-header h3 {
    color: var(--text-primary, #f2f2ed);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.chart-hint {
    color: var(--text-muted, #a6adc8);
    font-size: 13px;
    margin: 5px 0 0 0;
}

.chart-controls {
    display: flex;
    gap: 10px;
}

.chart-control-select {
    padding: 6px 12px;
    background: rgba(49, 50, 68, 0.8);
    border: 1px solid var(--border-color, #313244);
    border-radius: 4px;
    color: var(--text-primary, #cdd6f4);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-control-select:hover {
    border-color: var(--primary, #89b4fa);
}

.chart-control-select:focus {
    outline: none;
    border-color: var(--primary, #89b4fa);
    box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.2);
}

/* Timeline Charts */
.timeline-chart-area {
    margin: 20px 0;
    padding: 20px;
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border-color, #313244);
    border-radius: 8px;
    min-height: 500px;
}

.timeline-chart {
    width: 100%;
    height: 400px;
    background: rgba(17, 17, 27, 0.4);
    border-radius: 6px;
}

.timeline-chart.gantt-chart {
    height: 600px;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(30, 30, 46, 0.4);
    border-radius: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #cdd6f4);
}

.legend-color {
    width: 20px;
    height: 12px;
    border-radius: 3px;
}

/* Peak Periods Section */
.peak-periods-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(30, 30, 46, 0.6);
    border: 1px solid var(--border-color, #313244);
    border-radius: 8px;
}

.peak-periods-section h3 {
    color: var(--text-primary, #f2f2ed);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.peak-periods-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.peak-period-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(49, 50, 68, 0.6);
    border: 1px solid var(--border-color, #313244);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.peak-period-card:hover {
    background: rgba(49, 50, 68, 0.8);
    border-color: var(--primary, #89b4fa);
    transform: translateY(-2px);
}

.peak-rank {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary, #89b4fa);
    min-width: 40px;
    text-align: center;
}

.peak-details {
    flex: 1;
}

.peak-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #f2f2ed);
    margin-bottom: 4px;
}

.peak-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary, #89b4fa);
    margin-bottom: 2px;
}

.peak-percentage {
    font-size: 12px;
    color: var(--text-muted, #a6adc8);
}

/* Tool Actions */
.tool-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: var(--primary, #89b4fa);
    color: #1e1e2e;
}

.action-btn.primary:hover {
    background: #74c7ec;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(137, 180, 250, 0.3);
}

.action-btn.secondary {
    background: rgba(137, 180, 250, 0.1);
    border: 1px solid rgba(137, 180, 250, 0.3);
    color: var(--text-primary, #cdd6f4);
}

.action-btn.secondary:hover {
    background: rgba(137, 180, 250, 0.2);
    border-color: rgba(137, 180, 250, 0.5);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Status Indicator */
.status-indicator {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.status-indicator.checking {
    background: rgba(249, 226, 175, 0.1);
    color: var(--warning, #f9e2af);
}

.status-indicator.success {
    background: rgba(166, 227, 161, 0.1);
    color: var(--success, #a6e3a1);
}

.status-indicator.warning {
    background: rgba(249, 226, 175, 0.1);
    color: var(--warning, #f9e2af);
}

.status-indicator.error {
    background: rgba(243, 139, 168, 0.1);
    color: var(--error, #f38ba8);
}

/* Settings Overrides for Timeline Tool */
#settingsContent .settings-group h3 {
    color: var(--text-primary, #f2f2ed);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

#settingsContent .setting-item {
    margin-bottom: 12px;
}

#settingsContent .setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #cdd6f4);
    font-size: 13px;
    cursor: pointer;
}

#settingsContent .setting-select,
#settingsContent .setting-input {
    width: 100%;
    padding: 6px 10px;
    background: rgba(49, 50, 68, 0.6);
    border: 1px solid var(--border-color, #313244);
    border-radius: 4px;
    color: var(--text-primary, #cdd6f4);
    font-size: 13px;
}

#settingsContent .setting-select:focus,
#settingsContent .setting-input:focus {
    outline: none;
    border-color: var(--primary, #89b4fa);
    box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .metric-row {
        grid-template-columns: 1fr;
    }

    .view-navigation {
        flex-direction: column;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-controls {
        width: 100%;
        flex-direction: column;
    }

    .chart-control-select {
        width: 100%;
    }

    .peak-periods-list {
        grid-template-columns: 1fr;
    }

    .timeline-chart {
        height: 300px;
    }

    .timeline-chart.gantt-chart {
        height: 400px;
    }
}

/* Dark Mode Support (BPRboard default) */
body.light-theme .timeline-container {
    background: #f5f5f5;
}

body.light-theme .time-range-overview,
body.light-theme .timeline-viz-container,
body.light-theme .timeline-chart-area,
body.light-theme .peak-periods-section {
    background: white;
    border-color: #e0e0e0;
}

body.light-theme .nav-btn {
    background: rgba(137, 180, 250, 0.05);
    border-color: rgba(137, 180, 250, 0.2);
    color: #11111b;
}

body.light-theme .nav-btn:hover {
    background: rgba(137, 180, 250, 0.1);
}

body.light-theme .nav-btn.active {
    background: var(--primary, #89b4fa);
    color: white;
}

body.light-theme .chart-header h3,
body.light-theme .peak-periods-section h3,
body.light-theme .peak-date {
    color: #11111b;
}

body.light-theme .chart-hint,
body.light-theme .peak-percentage {
    color: #6c7086;
}

body.light-theme .timeline-chart {
    background: #fafafa;
}

body.light-theme .peak-period-card {
    background: #f9f9f9;
    border-color: #e0e0e0;
}

body.light-theme .peak-period-card:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.peak-period-card {
    animation: fadeIn 0.3s ease-out forwards;
}

.peak-period-card:nth-child(1) { animation-delay: 0s; }
.peak-period-card:nth-child(2) { animation-delay: 0.1s; }
.peak-period-card:nth-child(3) { animation-delay: 0.2s; }
.peak-period-card:nth-child(4) { animation-delay: 0.3s; }
.peak-period-card:nth-child(5) { animation-delay: 0.4s; }
