/**
 * SiteSpeedLog - Main Styles
 * Classic developer theme - Professional, timeless, code editor inspired
 */

/* ===========================
   CSS Variables - Classic Developer Theme
   =========================== */
:root {
    /* Classic Developer Theme - Inspired by VS Code, Sublime, terminals */
    --accent-blue: #569cd6;
    --accent-cyan: #4ec9b0;
    --accent-purple: #c586c0;
    --accent-orange: #ce9178;
    --accent-yellow: #dcdcaa;
    --accent-red: #f48771;
    
    /* Primary Theme Colors */
    --primary-color: #569cd6;
    --primary-hover: #4a8bc2;
    --secondary-color: #4ec9b0;
    --success-color: #4ec9b0;
    --danger-color: #f48771;
    --warning-color: #dcdcaa;
    --info-color: #569cd6;
    
    /* Dark Backgrounds */
    --background: #1e1e1e;
    --surface: #252526;
    --surface-elevated: #2d2d30;
    --overlay: rgba(0, 0, 0, 0.85);
    
    /* Text Colors */
    --text-primary: #e4e4e4;
    --text-secondary: #9cdcfe;
    --text-muted: #a0a0a0;
    --text-white: #e4e4e4;
    
    /* Borders & Shadows */
    --border: #3e3e42;
    --border-light: #4e4e52;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.5);
    
    /* Score Colors */
    --score-good: #4ec9b0;
    --score-average: #dcdcaa;
    --score-poor: #f48771;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius - Sharp edges for 90's feel */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    
    /* Transitions */
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', 'Lucida Console', monospace;
    background: var(--background);
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    font-size: 15px;
}

/* Removed scanline effect for flat design */

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

a:hover {
    color: var(--secondary-color);
}

/* ===========================
   Loading Overlay
   =========================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 65, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: var(--spacing-lg);
    color: white;
    font-size: 1.1rem;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: 'Consolas', 'Monaco', monospace;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--background);
    border: 2px solid var(--primary-color);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 255, 255, 0.15);
}

.btn-danger {
    background: transparent;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 42, 109, 0.15);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--background);
    color: var(--primary-color);
}

/* ===========================
   Landing Page
   =========================== */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Auth Box - Top Right */
.auth-box {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 320px;
    background: var(--surface);
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.auth-box-header {
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-align: center;
}

.auth-box-content {
    padding: var(--spacing-md);
}

.auth-box .auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--spacing-md);
}

.auth-box .auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
}

.auth-box .auth-tab:last-child {
    border-right: none;
}

.auth-box .auth-tab:hover {
    color: var(--primary-color);
    background: rgba(86, 156, 214, 0.1);
}

.auth-box .auth-tab.active {
    background: rgba(86, 156, 214, 0.15);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.auth-box .auth-form {
    display: none;
}

.auth-box .auth-form.active {
    display: block;
}

.auth-box .form-group {
    margin-bottom: var(--spacing-md);
}

.auth-box .form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
}

.auth-box .form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    background: var(--background);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
}

.auth-box .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-elevated);
}

.auth-box .btn-block {
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

.auth-box .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    width: 100%;
    margin-bottom: var(--spacing-xs);
}

.auth-box .auth-divider {
    text-align: center;
    margin: var(--spacing-sm) 0;
    position: relative;
}

.auth-box .auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-box .auth-divider span {
    background: var(--surface);
    padding: 0 var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
}

.auth-box .oauth-buttons {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.auth-box .btn-oauth {
    flex: 1;
}

.auth-box .auth-message {
    margin-top: var(--spacing-md);
    font-size: 0.75rem;
}

/* Mobile: Auth box moves to bottom */
@media (max-width: 768px) {
    .auth-box {
        position: static;
        width: 100%;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* Hero Section */
.hero {
    background: var(--surface);
    border: 2px solid var(--border);
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    margin: 0.75rem;
    margin-bottom: 0.5rem;
    margin-right: 360px; /* Make room for auth box */
    flex: 0 0 auto; /* Don't grow, natural size */
}

@media (max-width: 768px) {
    .hero {
        margin-right: 1rem;
    }
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: block;
    text-align: left;
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border);
    background: rgba(0, 0, 0, 0.5);
}

.logo i {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: var(--spacing-sm);
}

.logo h1 {
    display: inline;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.15em;
    font-family: 'Consolas', 'Monaco', monospace;
    text-transform: uppercase;
}

.logo h1::before {
    content: '[ ';
    color: var(--secondary-color);
}

.logo h1::after {
    content: ' ]';
    color: var(--secondary-color);
}

.logo h1 a {
    color: var(--primary-color);
    text-decoration: none;
}

.tagline {
    font-size: 0.95rem;
    margin-bottom: var(--spacing-xs);
    color: var(--secondary-color);
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.05em;
    text-align: left;
    padding-left: var(--spacing-md);
}

.tagline::before {
    content: '> ';
    color: var(--primary-color);
}

.description {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-white);
    text-align: left;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.feature {
    background: rgba(0, 0, 0, 0.8);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border);
    border-left: 4px solid var(--secondary-color);
    transition: var(--transition);
}

.feature:hover {
    border-left-color: var(--primary-color);
    background: rgba(86, 156, 214, 0.05);
}

.feature i {
    font-size: 0.875rem;
    margin-right: var(--spacing-sm);
    color: var(--secondary-color);
}

.feature h3 {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline;
}

.feature h3::before {
    content: '[+] ';
    color: var(--secondary-color);
}

.feature p {
    color: var(--text-white);
    opacity: 0.95;
    font-size: 0.85rem;
    margin-top: var(--spacing-xs);
    padding-left: 1.5rem;
    line-height: 1.5;
}

/* Auth Section */
.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    background: #0f1419;
    padding: 0;
    border: 3px solid var(--primary-color);
    max-width: 500px;
    width: 100%;
    box-shadow: 5px 5px 0 rgba(0, 255, 65, 0.2);
}

.auth-container::before {
    content: '═══════════════════════════════════════════';
    display: block;
    color: var(--border);
    font-size: 0.6rem;
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.1em;
}

.auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    background: rgba(0, 0, 0, 0.5);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.auth-tab:last-child {
    border-right: none;
}

.auth-tab:hover {
    color: var(--primary-color);
    background: rgba(0, 255, 65, 0.05);
}

.auth-tab.active {
    background: rgba(0, 255, 65, 0.15);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    padding: var(--spacing-xl);
}

.auth-form h2 {
    margin-bottom: var(--spacing-lg);
    text-align: left;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--spacing-sm);
}

.auth-form h2::before {
    content: '>> ';
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-left: 4px solid var(--secondary-color);
    font-size: 0.875rem;
    transition: var(--transition);
    background: #000;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.form-group input:focus {
    outline: none;
    border-left-color: var(--primary-color);
    border-color: var(--primary-color);
    background: #000;
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider {
    text-align: center;
    margin: var(--spacing-lg) 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    background: var(--surface);
    padding: 0 var(--spacing-md);
    position: relative;
    color: var(--text-muted);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.btn-oauth {
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-white);
    border: 2px solid var(--border);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-oauth:hover {
    border-color: var(--primary-color);
    background: rgba(86, 156, 214, 0.1);
    color: var(--primary-color);
}

.btn-google:hover {
    border-color: #ea4335;
    color: #ea4335;
    background: rgba(234, 67, 53, 0.1);
}

.btn-github:hover {
    border-color: var(--text-white);
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
}

.btn-magic {
    width: 100%;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--warning-color);
    color: var(--warning-color);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.btn-magic:hover {
    background: rgba(220, 220, 170, 0.15);
}

.auth-links {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.auth-note {
    margin-top: var(--spacing-lg);
    text-align: center;
    color: var(--text-muted);
}

.auth-message {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
    box-shadow: var(--shadow-lg);
}

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

.auth-message.hidden {
    display: none;
}

.auth-message.success {
    background: rgba(78, 201, 176, 0.15);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.auth-message.error {
    background: rgba(244, 135, 113, 0.15);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.auth-message.info {
    background: rgba(86, 156, 214, 0.15);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}

/* Footer */
.footer {
    background: var(--surface);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    color: var(--text-muted);
    border-top: 2px solid var(--border);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    margin-top: auto; /* Push to bottom */
}

/* ===========================
   Dashboard
   =========================== */
.dashboard-page {
    background: var(--background);
}

/* API Warning Banner */
.api-warning-banner {
    background: var(--surface-elevated);
    border: 2px solid var(--warning-color);
    border-left: 4px solid var(--warning-color);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.api-warning-banner i {
    color: var(--warning-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.api-warning-banner strong {
    color: var(--warning-color);
}

.api-warning-banner a {
    color: var(--primary-color);
    text-decoration: underline;
}

.api-warning-banner a:hover {
    color: var(--primary-hover);
}

.dashboard-header {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: var(--spacing-md);
    margin: 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
}

.user-info i {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.dashboard-main {
    padding: var(--spacing-xl);
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Usage Stats */
.usage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--surface);
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    display: block;
    transition: var(--transition);
}

.stat-card:hover {
    border-left-color: var(--text-muted);
    background: var(--surface-elevated);
}

.stat-icon {
    display: inline-block;
    width: auto;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.stat-icon::before {
    content: '[';
    margin-right: 0.25rem;
}

.stat-icon::after {
    content: ']';
    margin-left: 0.25rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Consolas', 'Monaco', monospace;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
}

.stat-bar {
    height: 6px;
    background: var(--border);
    border-radius: 0;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: var(--text-muted);
    border-radius: 0;
    transition: width 0.3s ease;
}

/* Section Styles */
.add-site-section,
.sites-section {
    background: var(--surface);
    padding: 0;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    margin-bottom: var(--spacing-xl);
}

.section-header {
    margin-bottom: 0;
    padding: var(--spacing-md);
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Consolas', 'Monaco', monospace;
}

.section-header h2::before {
    content: '▶ ';
    color: var(--text-muted);
}

.add-site-section > *:not(.section-header),
.sites-section > *:not(.section-header) {
    padding: var(--spacing-lg);
}

/* Add Site Form */
.add-site-form .form-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr auto;
    gap: var(--spacing-md);
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.form-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

/* Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.site-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    padding: var(--spacing-md);
    transition: var(--transition);
    background: var(--surface-elevated);
}

.site-card:hover {
    border-left-color: var(--text-muted);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.site-card-header h3 {
    font-size: 1.2rem;
    flex: 1;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.site-card-body {
    margin-bottom: var(--spacing-md);
}

.site-url {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    word-break: break-all;
}

.site-card-score {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.site-card-footer {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
}

/* Score Badges */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.25rem 0.75rem;
    border: 2px solid currentColor;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.score-badge.score-good {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.score-badge.score-average {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.score-badge.score-poor {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-lg);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-xl);
}

.modal-large {
    max-width: 1200px;
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Courier New', monospace;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--background);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-xl);
}

/* Site Detail */
.site-detail-header {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
}

.site-detail-info h3 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
}

.site-detail-info .site-url {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.pagespeed-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
}

.site-detail-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Scores Grid */
.latest-scores {
    margin-bottom: var(--spacing-xl);
}

.latest-scores h3 {
    margin-bottom: var(--spacing-lg);
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-lg);
}

.score-card {
    text-align: center;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
}

.score-card.score-good {
    border-color: var(--border-light);
    background: var(--surface);
}

.score-card.score-average {
    border-color: var(--border-light);
    background: var(--surface);
}

.score-card.score-poor {
    border-color: var(--border-light);
    background: var(--surface);
}

.score-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.score-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Performance Insights */
.performance-insights {
    margin: var(--spacing-xl) 0;
}

.insights-header {
    margin-bottom: var(--spacing-lg);
}

.insights-header h3 {
    margin: 0 0 var(--spacing-xs) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.insights-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.performance-insights h3 {
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.performance-insights h4 {
    margin: var(--spacing-lg) 0 var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.section-header h4 {
    margin: 0;
}

.total-savings {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--primary-color);
}

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

.insight-card {
    background: var(--surface);
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    transition: var(--transition);
}

.insight-card.insight-good {
    border-left-color: var(--success-color);
}

.insight-card.insight-average {
    border-left-color: var(--warning-color);
}

.insight-card.insight-poor {
    border-left-color: var(--error-color);
}

.insight-card:hover {
    background: var(--surface-elevated);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.insight-header i {
    color: var(--text-muted);
}

.insight-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.insight-rating {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.insight-rating i {
    font-size: 0.75rem;
}

.insight-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.insight-description {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Opportunities Section */
.opportunities-section {
    margin-bottom: var(--spacing-lg);
}

.opportunities-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.opportunity-item {
    background: var(--surface);
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-color);
    transition: var(--transition);
    display: flex;
    gap: var(--spacing-md);
}

.opportunity-item:hover {
    background: var(--surface-elevated);
    border-left-color: var(--primary-hover);
}

.opportunity-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border: 2px solid var(--border);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.875rem;
}

.opportunity-content {
    flex: 1;
    min-width: 0;
}

.opportunity-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xs);
    gap: var(--spacing-sm);
}

.opportunity-title {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.priority-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--error-color);
    color: white;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.priority-badge.high {
    background: var(--warning-color);
    color: var(--background);
}

.opportunity-savings {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.opportunity-savings i {
    font-size: 0.7rem;
}

.opportunity-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.insight-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.insight-link:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

.insight-link i {
    font-size: 0.7rem;
    opacity: 0.7;
}

.insight-link:hover i {
    opacity: 1;
}

/* Resource Breakdown */
.resource-breakdown {
    margin-bottom: var(--spacing-lg);
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.breakdown-item {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface);
    border: 1px solid var(--border);
}

.breakdown-icon-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.breakdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
}

.breakdown-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.breakdown-bar-container {
    position: relative;
    height: 20px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    transition: width 0.3s ease;
    opacity: 0.8;
}

.breakdown-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: right;
    min-width: 60px;
}

.breakdown-count {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
    min-width: 50px;
}

/* Advanced Metrics Divider */
.advanced-metrics-divider {
    margin: var(--spacing-xl) 0 var(--spacing-lg);
    text-align: center;
    position: relative;
}

.advanced-metrics-divider::before,
.advanced-metrics-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.advanced-metrics-divider::before {
    left: 0;
}

.advanced-metrics-divider::after {
    right: 0;
}

.advanced-metrics-divider span {
    display: inline-block;
    padding: 0 var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--background);
}

/* Advanced Metric Sections */
.advanced-metric-section {
    background: var(--surface);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    margin-bottom: var(--spacing-lg);
}

.advanced-metric-section h4 {
    margin: 0 0 var(--spacing-md) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
}

.advanced-metric-section h4 i {
    color: var(--text-muted);
}

/* Metric Summary */
.metric-summary {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    margin-bottom: var(--spacing-md);
}

.metric-summary.metric-good {
    border-left: 3px solid var(--success-color);
}

.metric-summary.metric-average {
    border-left: 3px solid var(--warning-color);
}

.metric-summary.metric-poor {
    border-left: 3px solid var(--error-color);
}

/* Enhanced Metric Summary with Visual Gauge */
.metric-summary-enhanced {
    padding: var(--spacing-lg);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.metric-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.metric-gauge {
    margin: var(--spacing-lg) 0;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.gauge-label {
    text-align: center;
}

.gauge-label small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.gauge-label-mid {
    position: relative;
}

.gauge-track {
    position: relative;
    height: 32px;
    border: 1px solid var(--border);
    overflow: visible;
}

.gauge-zones {
    display: flex;
    height: 100%;
}

.gauge-zone {
    height: 100%;
}

.gauge-zone-good {
    background: linear-gradient(90deg, 
        rgba(76, 175, 80, 0.2) 0%, 
        rgba(76, 175, 80, 0.3) 100%);
}

.gauge-zone-average {
    background: linear-gradient(90deg, 
        rgba(255, 193, 7, 0.2) 0%, 
        rgba(255, 193, 7, 0.3) 100%);
}

.gauge-zone-poor {
    background: linear-gradient(90deg, 
        rgba(244, 67, 54, 0.2) 0%, 
        rgba(244, 67, 54, 0.3) 100%);
}

.gauge-indicator {
    position: absolute;
    top: -8px;
    transform: translateX(-50%);
    z-index: 10;
}

.gauge-needle {
    width: 3px;
    height: 48px;
    background: var(--text-primary);
    position: relative;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.gauge-needle::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--text-primary);
}

.gauge-needle::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
}

.metric-rating-badge {
    text-align: center;
    padding: var(--spacing-sm);
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid;
}

.metric-rating-badge.metric-rating-good {
    color: var(--success-color);
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.metric-rating-badge.metric-rating-average {
    color: var(--warning-color);
    border-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

.metric-rating-badge.metric-rating-poor {
    color: var(--error-color);
    border-color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-rating {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.metric-details {
    margin: var(--spacing-md) 0 var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Timeline */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.timeline-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.timeline-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.timeline-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.timeline-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transition: width 0.3s ease;
    border-right: 2px solid var(--text-primary);
}

.timeline-time {
    position: absolute;
    right: var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Script List */
.script-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.script-item {
    display: grid;
    grid-template-columns: 32px 1fr auto auto auto;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

.script-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.script-name {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.script-bar-container {
    position: relative;
    width: 100px;
    height: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.script-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    opacity: 0.7;
}

.script-time {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

.script-percentage {
    color: var(--text-muted);
    font-size: 0.75rem;
    min-width: 40px;
    text-align: right;
}

/* Thread Breakdown */
.thread-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.thread-item {
    display: grid;
    grid-template-columns: 150px 1fr 80px;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
}

.thread-category {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.thread-bar-container {
    position: relative;
    height: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.thread-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    opacity: 0.7;
}

.thread-percentage {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1;
}

.thread-time {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: right;
}

/* Third Party List */
.third-party-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.third-party-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
}

.third-party-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.third-party-stats {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* DOM Stats */
.dom-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.dom-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
}

.dom-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.dom-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dom-stat-value.dom-stat-good {
    color: var(--success-color);
}

.dom-stat-value.dom-stat-average {
    color: var(--warning-color);
}

.dom-stat-value.dom-stat-poor {
    color: var(--error-color);
}

.dom-rating {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Responsive adjustments for insights and advanced metrics */
@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .opportunity-item {
        flex-direction: column;
    }

    .opportunity-number {
        align-self: flex-start;
    }

    .opportunity-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .opportunity-title {
        min-width: auto;
    }

    .breakdown-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }

    .breakdown-bar-container {
        width: 100%;
    }

    .breakdown-value,
    .breakdown-count {
        text-align: left;
    }

    .script-item {
        grid-template-columns: 32px 1fr auto;
        gap: var(--spacing-xs);
    }

    .script-bar-container {
        display: none;
    }

    .script-percentage {
        display: none;
    }

    .thread-item {
        grid-template-columns: 1fr auto;
        gap: var(--spacing-xs);
    }

    .thread-bar-container {
        display: none;
    }

    .gauge-labels {
        font-size: 0.65rem;
    }

    .metric-value-large {
        font-size: 2rem;
    }

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

    .timeline-time {
        position: static;
        margin-left: var(--spacing-sm);
    }
}

/* ==================== PHASE 3: PERFORMANCE TRENDS ==================== */

.performance-trends {
    margin: var(--spacing-xl) 0;
}

.trends-header {
    margin-bottom: var(--spacing-lg);
}

.trends-header h3 {
    margin: 0 0 var(--spacing-xs) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.trends-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.trends-placeholder {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--surface);
    border: 2px dashed var(--border);
    color: var(--text-muted);
}

.trends-placeholder i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.trends-placeholder p {
    margin: var(--spacing-sm) 0;
}

/* Quick Comparison */
.quick-comparison {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-color);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.comparison-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.comparison-dates {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comparison-date {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.comparison-item {
    padding: var(--spacing-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
}

.comparison-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.comparison-values {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.comparison-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.diff-improvement {
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.diff-regression {
    color: var(--error-color);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Chart Sections */
.chart-section {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.chart-section h4 {
    margin: 0 0 var(--spacing-lg) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.chart-section canvas {
    max-height: 400px;
}

/* Responsive adjustments for charts */
@media (max-width: 768px) {
    .comparison-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .comparison-dates {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

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

    .chart-section canvas {
        max-height: 300px;
    }
}

/* Speed Logs Table */
.speed-logs-section h3 {
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-header-with-actions h3 {
    margin: 0;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-export:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--background);
}

.btn-export i {
    font-size: 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--background);
}

.data-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover {
    background: var(--background);
}

/* Toast */
.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 10001;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--danger-color);
    color: white;
}

.toast.info {
    background: var(--info-color);
    color: white;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        padding: var(--spacing-lg);
    }
    
    .header-container {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .add-site-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
    }
    
    .site-detail-header {
        flex-direction: column;
    }
    
    .site-detail-actions {
        width: 100%;
    }
    
    .site-detail-actions .btn {
        flex: 1;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: var(--spacing-sm);
    }
    
    .toast {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .dashboard-main {
        padding: var(--spacing-md);
    }
    
    .usage-stats {
        grid-template-columns: 1fr;
    }
}

