/* benchmark.css - Typing Benchmark Page Styles */

/* ================= CSS VARIABLES ================= */
:root {
    /* Light Theme */
    --bg-primary: #f5f8ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-main: #ffffff;
    --bg-right: #ffffff;
    
    --text-primary: #1e2b3c;
    --text-secondary: #3a4b62;
    --text-muted: #6b7a8f;
    --text-inverse: #ffffff;
    
    --border-color: #d9e2ef;
    --border-strong: #a0b8d4;
    --border-focus: #2b6ed9;
    
    --accent-primary: #2b6ed9;
    --accent-secondary: #1e4b8c;
    --accent-light: #e8f0fe;
    --accent-hover: #4895ef;
    --accent-transparent: rgba(43, 110, 217, 0.1);
    --accent-success: #28a745;
    --accent-warning: #ffc107;
    --accent-danger: #dc3545;
    
    --shadow-color: rgba(0, 40, 100, 0.08);
    --shadow-hover: rgba(43, 110, 217, 0.15);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    
    /* Benchmark specific */
    --beginner: #28a745;
    --intermediate: #17a2b8;
    --advanced: #ffc107;
    --professional: #fd7e14;
    --expert: #dc3545;
    --elite: #6f42c1;
    
    --transition-speed: 0.3s;
}

/* ================= DARK THEME ================= */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-main: #1e293b;
    --bg-right: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --border-color: #334155;
    --border-strong: #475569;
    --border-focus: #3b82f6;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-light: #1e293b;
    --accent-hover: #2563eb;
    --accent-transparent: rgba(59, 130, 246, 0.15);
    --accent-success: #4ade80;
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;
    
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(59, 130, 246, 0.2);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    
    --beginner: #4ade80;
    --intermediate: #38bdf8;
    --advanced: #fbbf24;
    --professional: #fb923c;
    --expert: #f87171;
    --elite: #c084fc;
}

/* ================= BASE ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    transition: background-color var(--transition-speed) ease, 
                color var(--transition-speed) ease;
}

/* ================= DARK MODE TOGGLE ================= */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-strong);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
}

.theme-btn:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--shadow-hover);
}

/* ================= MAIN LAYOUT ================= */
.benchmark-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    overflow-x: hidden;
}

.benchmark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.site-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    transition: color var(--transition-speed) ease;
}

.site-title:hover {
    color: var(--accent-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.login-btn {
    background: transparent;
    border: 2px solid var(--border-strong);
    color: var(--text-primary);
    padding: 8px 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    font-size: 14px;
}

.login-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.mobile-menu-btn {
    display: none;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    order: 1;
}

/* ================= 3-COLUMN LAYOUT ================= */
.benchmark-layout {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 25px;
    margin-bottom: 40px;
}

/* ================= LEFT SIDEBAR ================= */
.benchmark-sidebar {
    background: var(--bg-sidebar);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 20px 15px;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--card-shadow);
}

.benchmark-sidebar:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.nav-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Navigation */
.benchmark-nav ul {
    list-style: none;
}

.benchmark-nav li {
    margin-bottom: 5px;
}

.benchmark-nav a {
    display: block;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.benchmark-nav li.active a {
    background: var(--accent-transparent);
    color: var(--accent-primary);
    font-weight: 600;
    border-left: 3px solid var(--accent-primary);
}

.benchmark-nav a:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
    transform: translateX(5px);
}

/* Home link */
.home-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-icon {
    font-size: 1.1rem;
}

/* Benchmark History */
.benchmark-history {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 20px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

.benchmark-history h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.history-item .date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-item .score {
    font-weight: 600;
    color: var(--accent-primary);
}

/* ================= MAIN CONTENT ================= */
.benchmark-main {
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 25px;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--card-shadow);
}

.benchmark-main:hover {
    border-color: var(--accent-primary);
    transform: scale(1.01);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.benchmark-main h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-weight: 700;
}

.benchmark-subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Benchmark Categories */
.benchmark-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.category-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 20px var(--shadow-hover);
}

.category-card h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.wpm-range {
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.card-stats {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.start-benchmark {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.start-benchmark:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

/* Test Area */
.benchmark-test-area {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin: 30px 0;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.test-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
}

.test-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Fira Code', monospace;
    min-width: 90px;
    text-align: center;
}

.test-progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.test-text {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 20px;
    font-family: 'Fira Code', monospace;
    max-height: 200px;
    overflow-y: auto;
}

.test-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Fira Code', monospace;
    resize: none;
    transition: all var(--transition-speed) ease;
}

.test-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.test-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.test-controls {
    text-align: center;
}

.cancel-btn {
    background: var(--accent-danger);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.cancel-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

/* Results Area */
.benchmark-results {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin: 30px 0;
    text-align: center;
}

.benchmark-results h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 5px;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.result-chart {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    height: 150px;
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
}

.chart-bar {
    width: 60px;
    background: linear-gradient(to top, var(--accent-primary), var(--accent-hover));
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.chart-bar .chart-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result-message {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 20px 0;
    padding: 15px;
    background: var(--accent-light);
    border-radius: 30px;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.retake-btn, .share-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.retake-btn {
    background: var(--accent-primary);
    color: white;
}

.share-btn {
    background: var(--accent-success);
    color: white;
}

.retake-btn:hover, .share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

/* Global Leaderboard */
.global-leaderboard {
    margin-top: 40px;
}

.global-leaderboard h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.leaderboard-list {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:hover {
    background: var(--accent-light);
}

.leaderboard-rank {
    font-weight: 700;
    color: var(--accent-primary);
    width: 50px;
}

.leaderboard-name {
    flex: 1;
    color: var(--text-primary);
}

.leaderboard-score {
    font-weight: 600;
    color: var(--text-primary);
}

/* ================= RIGHT SIDEBAR ================= */
.benchmark-right {
    background: var(--bg-right);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 20px;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--card-shadow);
}

.benchmark-right:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.info-card, .stats-card, .badge-card {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.info-card h3, .stats-card h3, .badge-card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li::before {
    content: "✓";
    color: var(--accent-success);
    font-weight: 600;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span:last-child {
    font-weight: 600;
    color: var(--accent-primary);
}

.progress-chart {
    height: 100px;
    margin: 15px 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
}

.chart-column {
    width: 20px;
    background: var(--accent-primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.badge-item {
    text-align: center;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

.badge-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

.badge-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.badge-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-item.unlocked .badge-icon {
    filter: none;
}

.badge-item.locked {
    opacity: 0.5;
    filter: grayscale(0.5);
}

/* ================= FOOTER ================= */
.test-footer {
    margin-top: 60px;
    padding: 0;
    border-top: 2px solid var(--border-color);
    width: 100%;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    padding: 40px 0;
    width: 100%;
}

/* LEFT SIDE: Logo + Copyright under logo */
.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 14px;
}

/* CENTER: 2 rows with 4 buttons each */
.footer-center {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-width: 300px;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 15px 25px;
    justify-content: center;
}

.footer-links-grid a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.footer-links-grid a:hover {
    color: var(--accent-primary);
}

/* RIGHT SIDE: Independent platform text with email */
.footer-right {
    flex: 1;
    text-align: right;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    min-width: 220px;
}

.footer-right p {
    margin-bottom: 5px;
}

.footer-right a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer-right a:hover {
    text-decoration: underline;
}

/* ================= ANIMATIONS ================= */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.benchmark-test-area, .benchmark-results {
    animation: slideIn 0.5s ease;
}

/* ================= RESPONSIVE ================= */
@media screen and (max-width: 1200px) {
    .benchmark-layout {
        grid-template-columns: 220px 1fr 240px;
        gap: 20px;
    }
    
    .benchmark-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .test-timer {
        font-size: 1.8rem;
        min-width: 80px;
    }
}

@media screen and (max-width: 992px) {
    .benchmark-layout {
        grid-template-columns: 1fr;
    }
    
    .benchmark-sidebar, 
    .benchmark-right {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .benchmark-header {
        padding: 10px 0;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .login-btn {
        padding: 6px 15px;
        font-size: 13px;
    }
    
    .mobile-menu-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-left, .footer-right {
        align-items: center;
        text-align: center;
    }
    
    .footer-links-grid {
        grid-template-columns: repeat(2, auto);
    }
}

@media screen and (max-width: 768px) {
    .benchmark-main {
        padding: 20px;
    }
    
    .benchmark-main h1 {
        font-size: 1.8rem;
    }
    
    .benchmark-subtitle {
        font-size: 1rem;
    }
    
    .benchmark-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-card h3 {
        font-size: 1.1rem;
    }
    
    .test-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .test-timer {
        font-size: 1.5rem;
        min-width: 70px;
    }
    
    .test-text {
        font-size: 1rem;
        padding: 15px;
        max-height: 150px;
    }
    
    .test-input {
        font-size: 1rem;
        padding: 12px;
    }
    
    .test-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .result-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-chart {
        height: 120px;
        gap: 15px;
    }
    
    .chart-bar {
        width: 40px;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .theme-toggle {
        bottom: 10px;
        right: 10px;
    }
    
    .theme-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .benchmark-main {
        padding: 15px;
    }
    
    .site-title {
        font-size: 1.1rem;
    }
    
    .login-btn {
        padding: 4px 10px;
        font-size: 11px;
        border-width: 1.5px;
    }
    
    .mobile-menu-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .benchmark-main h1 {
        font-size: 1.5rem;
    }
    
    .benchmark-subtitle {
        font-size: 0.9rem;
    }
    
    .benchmark-categories {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        width: 100%;
    }
    
    .test-header h2 {
        font-size: 1.1rem;
    }
    
    .test-timer {
        font-size: 1.3rem;
        min-width: 60px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .chart-bar {
        width: 30px;
    }
    
    .chart-bar .chart-label {
        font-size: 0.7rem;
    }
    
    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .footer-links-grid a {
        font-size: 12px;
    }
    
    .footer-left, .footer-right {
        width: 100%;
    }
    
    .footer-copyright {
        font-size: 12px;
    }
    
    .footer-right p {
        font-size: 12px;
    }
}

@media screen and (max-width: 360px) {
    .site-title {
        font-size: 1rem;
    }
    
    .login-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .mobile-menu-btn {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .benchmark-main h1 {
        font-size: 1.3rem;
    }
    
    .test-timer {
        font-size: 1.2rem;
        min-width: 50px;
    }
    
    .footer-links-grid {
        grid-template-columns: 1fr;
    }
}