:root {
    --primary: #FF6719;
    --primary-hover: #E55A15;
    --text-primary: #191919;
    --text-secondary: #666666;
    --text-tertiary: #808080;
    --bg: #FFFFFF;
    --bg-secondary: #F7F7F7;
    --bg-page: #F5F5F5;
    --border: #E6E6E6;
}

/* Dark mode variables */
html.dark-mode,
html.dark-mode body {
    --primary: #FF6719;
    --primary-hover: #E55A15;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #94a3b8;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-page: #0f172a;
    --border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-content > div {
    flex: 1;
    text-align: center;
}

header h1 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: -0.03em;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.last-updated {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* GPU Selector */
.gpu-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.gpu-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.gpu-btn:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.gpu-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Stats Section */
.stats-section {
    margin-bottom: 1rem;
}

.stats-timestamp {
    text-align: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stats-timestamp span {
    font-weight: 600;
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background: transparent;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: none;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card[title] {
    cursor: help;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.125rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Chart Container */
.chart-container {
    background: transparent;
    padding: 2rem 0;
    border-radius: 0;
    border: none;
    margin-bottom: 3rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.time-range-selector {
    display: flex;
    gap: 0.375rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.smooth-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: help;
    user-select: none;
}

.smooth-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.smooth-toggle:hover {
    color: var(--text-primary);
}

.time-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: help;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.time-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 103, 25, 0.1);
}

.time-btn.active {
    background: var(--primary);
    color: white;
}

.chart-wrapper {
    position: relative;
    height: 500px;
}

/* Tables */
.table-container {
    background: transparent;
    padding: 2rem 0;
    border-radius: 0;
    border: none;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.table-container h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tbody tr:hover {
    background: var(--bg-secondary);
}

tbody tr:last-child td {
    border-bottom: none;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.spot-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.spot-yes {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.spot-no {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Error message */
.error-message {
    background: #ef4444;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    .header-content {
        align-items: flex-start;
        gap: 1rem;
    }

    .header-content > div {
        text-align: left;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        margin-top: 0.25rem;
    }

    .theme-icon {
        font-size: 1.1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .gpu-selector {
        gap: 0.5rem;
    }

    .gpu-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

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

    .chart-wrapper {
        height: 300px;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }
}
