/**
 * Timeline Theme - Professional Dark Timeline Layout
 * Target: Clean timeline visualization with professional dark aesthetics
 * Format: Enhanced table with timeline visual elements
 * Colors: Dark professional palette with timeline-specific accents
 */

:root {
    /* Dark Timeline Professional Palette */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-surface: #21262d;
    --bg-header: #000000;
    --bg-timeline: #1f2937;
    --border-color: #30363d;
    --border-light: #373e47;
    --border-accent: #58a6ff;

    /* Timeline Dark Typography */
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --text-accent: #58a6ff;
    --text-timeline: #7d8590;

    /* Timeline Status Colors (Dark Optimized) */
    --status-completed: #3fb950;
    --status-progress: #f85149;
    --status-planned: #58a6ff;
    --status-hold: #8b949e;

    /* Timeline Visual Elements */
    --timeline-line: #30363d;
    --timeline-active: #58a6ff;
    --timeline-completed: #3fb950;
    --timeline-progress: #f85149;
    --shadow-timeline: 0 8px 16px -4px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --border-radius: 8px;
    --timeline-height: 4px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Timeline Typography */
    --font-primary: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* Timeline Dark Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: var(--font-size-sm);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Dark Timeline Header */
.header {
    background: linear-gradient(135deg, #000000 0%, #161b22 100%);
    color: white;
    padding: var(--spacing-2xl);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-2xl);
    text-align: center;
    box-shadow: var(--shadow-timeline);
    border: 1px solid #21262d;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--status-completed) 0%,
        var(--status-progress) 50%,
        var(--status-planned) 100%
    );
    border-radius: 2px;
}

.header h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.header .subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.8;
    color: var(--text-secondary);
}

/* Timeline Category Sections */
.category-section {
    margin-bottom: var(--spacing-2xl);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-timeline);
    border: 1px solid var(--border-color);
    position: relative;
}

.category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.category-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--timeline-active);
    border-radius: 1px;
}

.category-icon {
    font-size: var(--font-size-xl);
    color: var(--text-accent);
}

.category-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    flex: 1;
}

.project-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    font-weight: var(--font-weight-medium);
}

/* Clean Timeline Table */
.category-table-container {
    background: var(--bg-timeline);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
}

/* Timeline connecting line */
.category-table-container::before {
    content: '';
    position: absolute;
    top: 60px;
    left: 250px;
    right: var(--spacing-lg);
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--timeline-line) 0%,
        var(--timeline-active) 30%,
        var(--timeline-active) 70%,
        var(--timeline-line) 100%
    );
    border-radius: 2px;
    z-index: 1;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    position: relative;
    z-index: 2;
}

/* Timeline Headers */
.projects-table th {
    background: linear-gradient(135deg, #000000 0%, #161b22 100%);
    color: var(--text-primary);
    padding: var(--spacing-lg);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    border-right: 1px solid var(--border-color);
    position: relative;
    font-size: var(--font-size-sm);
}

.projects-table th:last-child {
    border-right: none;
}

.projects-table th.next-quarter {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    position: relative;
}

.projects-table th.next-quarter::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #1d4ed8;
    border: 2px solid var(--bg-timeline);
    border-radius: 50%;
    z-index: 3;
}

.projects-table th.past-quarter {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    color: #d1d5db;
    opacity: 0.8;
}

.projects-table th.past-quarter::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #6b7280;
    border: 2px solid var(--bg-timeline);
    border-radius: 50%;
    z-index: 3;
}

.project-header {
    width: 250px;
    min-width: 250px;
    text-align: left;
    background: linear-gradient(135deg, #000000 0%, #1a1f24 100%) !important;
}

/* Timeline Project Rows */
.project-row {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    transition: background-color 0.2s ease;
}

.project-row:hover {
    background: #2d3748;
}

.project-row:last-child {
    border-bottom: none;
}

.project-info {
    padding: var(--spacing-lg);
    border-right: 1px solid var(--border-color);
    vertical-align: top;
    background: linear-gradient(135deg, var(--bg-surface) 0%, #2d3748 100%);
}

.project-name {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-md);
    line-height: 1.3;
}

.project-name a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.project-name a:hover {
    color: var(--text-accent);
}

.project-name .issue-arrow {
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

.project-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Timeline Quarter Cells */
.quarter-cell {
    padding: var(--spacing-lg);
    border-right: 1px solid var(--border-color);
    vertical-align: top;
    position: relative;
    width: 200px;
    background: var(--bg-surface);
}

.quarter-cell:last-child {
    border-right: none;
}

.quarter-cell.next-quarter {
    background: linear-gradient(135deg, #21262d 0%, #2d3748 100%);
    border-left: 3px solid var(--status-planned);
    position: relative;
}

.quarter-cell.past-quarter {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-left: 3px solid var(--border-color);
    opacity: 0.8;
}

.quarter-cell.empty {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    padding: var(--spacing-2xl);
    background: var(--bg-timeline);
    border-style: dashed;
    border-left: 3px dashed var(--border-light);
}

/* Timeline Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.completed {
    background: rgba(63, 185, 80, 0.2);
    color: var(--status-completed);
    border: 1px solid rgba(63, 185, 80, 0.4);
}

.status-badge.in-progress {
    background: rgba(248, 81, 73, 0.2);
    color: var(--status-progress);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.status-badge.planned {
    background: rgba(88, 166, 255, 0.2);
    color: var(--status-planned);
    border: 1px solid rgba(88, 166, 255, 0.4);
}

.status-badge.on-hold {
    background: rgba(139, 148, 158, 0.2);
    color: var(--status-hold);
    border: 1px solid rgba(139, 148, 158, 0.4);
}

.status-badge.no-info {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Timeline Quarter Content */
.quarter-content {
    position: relative;
}

.quarter-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    font-size: var(--font-size-sm);
}

.quarter-details {
    margin-bottom: var(--spacing-md);
}

.detail-item {
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    padding-left: var(--spacing-sm);
    position: relative;
    line-height: 1.4;
    font-size: var(--font-size-xs);
}

.detail-item::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--text-accent);
    font-weight: var(--font-weight-bold);
}

/* Timeline Extra Info */
.extra-info {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.extra-info > div {
    margin-bottom: var(--spacing-sm);
}

.extra-info > div:last-child {
    margin-bottom: 0;
}

.progress-info,
.metrics-info,
.risks-info,
.objectives-info,
.dependencies-info {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.4;
}

.progress-info strong,
.metrics-info strong,
.risks-info strong,
.objectives-info strong,
.dependencies-info strong {
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
}

/* Dark Timeline Metrics */
.metrics-section {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-timeline);
    border: 1px solid var(--border-color);
}

.metrics-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.metrics-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.kpis-list,
.risks-section {
    background: var(--bg-surface);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.kpis-list h3,
.risks-section h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.kpis-list h3::before {
    content: '📊';
}

.risks-section h3::before {
    content: '⚠️';
}

.kpi-item,
.risk-item {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

/* Dark Timeline Legend */
.legend-section {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-timeline);
    border: 1px solid var(--border-color);
}

.legend-section h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    text-align: center;
    color: var(--text-primary);
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    background: var(--bg-surface);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

.legend-status {
    width: 16px;
    height: 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-status.completed {
    background: var(--status-completed);
}

.legend-status.in-progress {
    background: var(--status-progress);
}

.legend-status.planned {
    background: var(--status-planned);
}

.legend-status.on-hold {
    background: var(--status-hold);
}

.next-quarters-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Timeline Responsive */
@media (max-width: 1400px) {
    .container {
        padding: var(--spacing-md);
    }

    .quarter-cell {
        width: 180px;
    }

    .project-header {
        width: 220px;
        min-width: 220px;
    }

    .category-table-container::before {
        left: 220px;
    }
}

@media (max-width: 1024px) {
    .quarter-cell {
        width: 150px;
    }

    .project-header {
        width: 200px;
        min-width: 200px;
    }

    .category-table-container::before {
        left: 200px;
    }

    .metrics-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .quarter-cell {
        width: 120px;
    }

    .project-header {
        width: 150px;
        min-width: 150px;
    }

    .category-table-container::before {
        display: none;
    }

    .legend-grid {
        grid-template-columns: 1fr;
    }
}
