/* Progress Dashboard Styles */

/* Override map page body constraints so dashboard scrolls */
body {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
}

.header-page-title {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.header-timestamp {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Milestone banner */
.milestone-banner {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: #fff;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.milestone-current {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.milestone-goal {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.milestone-previous {
    font-size: 0.75rem;
    opacity: 0.65;
}

body.dark .milestone-banner {
    background: linear-gradient(135deg, #0d1a3a 0%, #1a2744 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main layout — override map page main styles */
.dashboard-main {
    display: block !important;
    flex: none !important;
    overflow: visible !important;
    max-width: 1400px;
    margin: 0 auto;
    padding: 72px 2rem 3rem;
}

/* Summary cards grid */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 3px solid #1a237e;
    transition: box-shadow 0.2s, transform 0.2s;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a237e;
    line-height: 1.2;
}

.card-label {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

/* Sections */
.dashboard-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
}

.section-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a237e;
    margin: 0 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #e8eaf6;
}

/* Charts side-by-side on wide screens */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}

.charts-row .dashboard-section {
    margin-bottom: 0;
}

.subsection-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1rem;
}

/* Tables */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.dashboard-table th {
    text-align: left;
    padding: 0.65rem 1rem;
    background: #f8f9fe;
    color: #1a237e;
    font-weight: 600;
    border-bottom: 2px solid #e8eaf6;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dashboard-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.dashboard-table tbody tr:nth-child(even) {
    background: #fafbff;
}

.dashboard-table tbody tr:hover {
    background: #f0f2ff;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.failed {
    background: #ffebee;
    color: #c62828;
}

.status-badge.rollback {
    background: #fff8e1;
    color: #f57f17;
}

.target-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #e8eaf6;
    color: #1a237e;
}

/* Requirement status icons */
.req-done {
    color: #4caf50;
    font-weight: bold;
}

.req-pending {
    color: #bdbdbd;
}

/* Two-column layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Blocker and todo lists */
.blocker-list,
.todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blocker-list li,
.todo-list li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: #444;
    line-height: 1.4;
    border-bottom: 1px solid #f5f5f5;
}

.blocker-list li:last-child,
.todo-list li:last-child {
    border-bottom: none;
}

.blocker-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f44336;
}

.todo-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff9800;
}

.empty-message {
    color: #999;
    font-style: italic;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Requirements summary */
.requirements-summary {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 1rem;
}

/* Error state */
.dashboard-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #c62828;
}

.dashboard-error h2 {
    margin: 0 0 0.5rem;
}

.dashboard-error p {
    color: #666;
    font-size: 0.9rem;
}

/* Theme toggle button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==============================
   DARK MODE
   ============================== */
body.dark {
    background-color: #0f1117 !important;
}

body.dark header {
    background-color: #161b2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .dashboard-card {
    background: #1a1f2e;
    border-top-color: #5c6bc0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .dashboard-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.dark .card-number {
    color: #9fa8da;
}

body.dark .card-label {
    color: #8891a5;
}

body.dark .dashboard-section {
    background: #1a1f2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .section-heading {
    color: #9fa8da;
    border-bottom-color: #2a3045;
}

body.dark .subsection-heading {
    color: #c5cae9;
}

body.dark .dashboard-table th {
    background: #1e2438;
    color: #9fa8da;
    border-bottom-color: #2a3045;
}

body.dark .dashboard-table td {
    color: #b0b8cc;
    border-bottom-color: #242a3d;
}

body.dark .dashboard-table tbody tr:nth-child(even) {
    background: #1e2235;
}

body.dark .dashboard-table tbody tr:hover {
    background: #252b42;
}

body.dark .status-badge.success {
    background: #1b3a1b;
    color: #66bb6a;
}

body.dark .status-badge.failed {
    background: #3a1b1b;
    color: #ef5350;
}

body.dark .status-badge.rollback {
    background: #3a351b;
    color: #ffca28;
}

body.dark .target-badge {
    background: #252b42;
    color: #9fa8da;
}

body.dark .req-done {
    color: #66bb6a;
}

body.dark .req-pending {
    color: #555e75;
}

body.dark .blocker-list li,
body.dark .todo-list li {
    color: #b0b8cc;
    border-bottom-color: #242a3d;
}

body.dark .empty-message {
    color: #606878;
}

body.dark .requirements-summary {
    color: #8891a5;
}

body.dark .dashboard-error {
    color: #ef5350;
}

body.dark .dashboard-error p {
    color: #8891a5;
}

body.dark .header-link {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive: tablet */
@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }

    .dashboard-main {
        padding: 64px 0.75rem 1.5rem;
    }
}

/* Responsive: mobile */
@media (max-width: 480px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .card-number {
        font-size: 1.5rem;
    }

    .dashboard-section {
        padding: 1rem;
    }

    .chart-container {
        height: 200px;
    }

    .dashboard-table {
        font-size: 0.8rem;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 0.4rem 0.5rem;
    }
}
