:root {
    /* Dark theme colors */
    --bg-color: #0a0a23;
    --text-color: #ffffff;
    --caret-color: #a78bfa;
    --text-inactive: #6b7280;
    --text-correct: #d8b4fe;
    --text-error: #ff6b6b;
    --secondary-bg: rgba(31, 31, 56, 0.7);
    --accent-color: #8b5cf6;
    --wpm-color: #60a5fa;
    --accuracy-color: #34d399;
    --font-primary: 'JetBrains Mono', monospace;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --active-word-bg: rgba(139, 92, 246, 0.15);
    --active-word-border: rgba(139, 92, 246, 0.3);
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;
    --font-stats: 'Roboto', sans-serif;
}

/* Light theme colors */
[data-theme="light"] {
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --caret-color: #8b5cf6;
    --text-inactive: #6b7280;
    --text-correct: #7c3aed;
    --text-error: #dc2626;
    --secondary-bg: rgba(255, 255, 255, 0.8);
    --accent-color: #6d28d9;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-display);
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: background-color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 2rem;
    font-weight: 700;
}

.settings {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-bg);
    transition: 0.4s;
    border: 1px solid var(--glass-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: var(--accent-color);
    transition: 0.4s;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.select-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--glass-bg);
    border-radius: 1rem;
    padding: 0.25rem 1rem;
}

.time-options, .mode-options {
    padding: 0.75rem 1.5rem;
    background: var(--secondary-bg);
    border: 1.5px solid var(--accent-color);
    color: var(--text-color);
    border-radius: 1rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    margin-right: 0;
    appearance: none;
    box-shadow: none;
    outline: none;
    min-width: 90px;
    /* Custom arrow */
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
}

[data-theme="light"] .time-options, [data-theme="light"] .mode-options {
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.time-options:focus, .mode-options:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.time-options option, .mode-options option {
    background: var(--bg-color);
    color: var(--text-color);
}

.mode-label, .time-label {
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-display);
    font-weight: 500;
    margin-right: 0.5rem;
}

.test-area {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.test-area:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    border-radius: 1rem 1rem 0 0;
    transition: width 0.1s linear;
}

.text-display {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    line-height: 2.2rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-inactive);
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.5rem;
}

.text-display span.word {
    margin-right: 0;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.text-display span.word.active {
    background: var(--active-word-bg);
    box-shadow: 0 0 15px var(--active-word-border);
    color: var(--text-color);
}

.text-display span.char.correct {
    color: var(--text-correct);
    text-shadow: 0 0 8px rgba(216, 180, 254, 0.3);
}

.text-display span.char.incorrect {
    color: var(--text-error);
    background: rgba(255, 107, 107, 0.1);
    border-radius: 2px;
}

.text-input {
    opacity: 0;
    position: absolute;
}

.restart-btn {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 1rem;
    display: none;
}

.restart-btn:hover {
    background-color: #7c3aed;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.caret {
    position: absolute;
    width: 2px;
    height: 2rem;
    background-color: var(--accent-color);
    animation: blink 1s infinite;
    transition: all 0.1s ease;
    display: none;
}

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

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    font-family: var(--font-stats);
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box[data-tooltip]:hover:after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-bg);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1;
}

.wpm-box .stat-value {
    color: var(--wpm-color);
}

.accuracy-box .stat-value {
    color: var(--accuracy-color);
}

.stat-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-inactive);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.timer {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.counter {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.5rem;
}

.focus-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--secondary-bg);
    border: 2px solid var(--text-color);
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(100, 255, 218, 0.4));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header-text {
    display: flex;
    align-items: center;
}

.brand-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.2);
}

.subtitle {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--accent-color);
    margin: 0;
}

/* Add responsive styles */
@media (max-width: 768px) {
    .logo {
        height: 50px;
    }
    
    .brand-name {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .text-display {
        font-size: 1.2rem;
        line-height: 2rem;
    }

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

    .container {
        gap: 1rem;
    }

    .settings {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-box {
        padding: 0.75rem;
    }

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

/* Add subtle hover effects */
.time-options:hover, .theme-options:hover {
    border-color: var(--text-correct);
    cursor: pointer;
}

/* Add glow effect to active element */
.test-area:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.stat-value.animate {
    animation: scaleIn 0.3s ease;
}

.history-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1rem;
    backdrop-filter: blur(10px);
    margin-top: 0.5rem;
}

.history-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: var(--font-stats);
}

.history-list > * {
    animation: fadeIn 0.3s ease;
}

/* Add new font import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;600&family=Roboto:wght@400;500;700&display=swap');
/* filepath: z:\typing\styles.css */
.bottom-restart-btn {
    display: block;
    margin: 20px auto 0 auto;
    padding: 8px 24px;
    font-size: 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.bottom-restart-btn:hover {
    background: var(--accent-hover, #005fa3);
}