/* ============================================
   286 Builds Dashboard - Dark Theme Styling
   ============================================ */

/* CSS Variables - Dark Theme */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-primary: #58a6ff;
    --accent-secondary: #79c0ff;
    --accent-tertiary: #1f6feb;
    --border-color: #30363d;
    --success-color: #3fb950;
    --warning-color: #d29922;
    --error-color: #f85149;
    --chart-gradient: linear-gradient(135deg, #1f6feb 0%, #58a6ff 100%);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   Dashboard Container
   ============================================ */

.dashboard-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

/* ============================================
   Header Section
   ============================================ */

.dashboard-header {
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    animation: slideDownFade 0.6s ease-out;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--chart-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.stat-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.15);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* ============================================
   Dashboard Content Grid
   ============================================ */

.dashboard-content {
    display: grid;
    gap: 30px;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

.chart-row .full-width {
    grid-column: 1 / -1;
}

/* ============================================
   Chart Containers
   ============================================ */

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    transition: var(--transition-smooth);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-container:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 12px 24px rgba(88, 166, 255, 0.2);
}

.chart-container h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.chart-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

.skills-scrubber {
    margin-bottom: 16px;
}

.skills-scrubber input[type="range"] {
    width: 100%;
    accent-color: var(--accent-primary);
    margin-bottom: 6px;
}

.skills-scrubber #skills-scrubber-label {
    margin: 0;
    font-style: normal;
    color: var(--accent-secondary);
}

.chart {
    width: 100%;
    height: 400px;
    position: relative;
}

.chart.tall {
    height: 500px;
}

/* ============================================
   Loading & Error States
   ============================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    gap: 20px;
    animation: fadeIn 0.4s ease-out;
}

.loading p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 20px;
    color: #ff7b72;
    margin-bottom: 20px;
    animation: slideDownFade 0.4s ease-out;
}

.error p {
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

/* ============================================
   Footer
   ============================================ */

.dashboard-footer {
    margin-top: 60px;
    padding: 30px;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.dashboard-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.dashboard-footer a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.dashboard-footer p {
    margin: 8px 0;
}

/* ============================================
   Plotly & D3 Chart Styling
   ============================================ */

.plotly-graph-div {
    background: transparent !important;
}

.plotly {
    font-family: inherit !important;
}

/* Dark theme for Plotly charts */
.plotly .xtick text,
.plotly .ytick text,
.plotly .zticklabel text {
    fill: var(--text-secondary) !important;
}

.plotly .xgrid line,
.plotly .ygrid line {
    stroke: var(--border-color) !important;
    stroke-opacity: 0.3 !important;
}

/* D3 Chart Styling */
.d3-chart {
    background: transparent;
}

.d3-tooltip {
    position: absolute;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1200px) {
    .chart-row {
        grid-template-columns: 1fr;
    }

    .chart-row .full-width {
        grid-column: 1;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 20px 15px;
    }

    .dashboard-header {
        padding: 25px;
        margin-bottom: 30px;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    .dashboard-header .subtitle {
        font-size: 1rem;
    }

    .header-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .chart-container {
        padding: 20px;
    }

    .chart-container h2 {
        font-size: 1.1rem;
    }

    .chart {
        height: 300px;
    }

    .chart.tall {
        height: 400px;
    }

    .chart-row {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 15px 10px;
    }

    .dashboard-header {
        padding: 20px;
    }

    .dashboard-header h1 {
        font-size: 1.3rem;
    }

    .header-stats {
        grid-template-columns: 1fr;
    }

    .chart-container {
        padding: 15px;
        border-radius: 8px;
    }

    .chart-container h2 {
        font-size: 1rem;
    }

    .chart-description {
        font-size: 0.8rem;
    }

    .chart {
        height: 250px;
    }

    .chart.tall {
        height: 300px;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    transition: var(--transition-smooth);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   Selection & Focus Styles
   ============================================ */

::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
