/* All CSS from the <style> tag in typing-test.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #f8f9fa;
    --primary-text: #444;
    --accent: #667eea;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --success-bg: #d4edda;
    --success-text: #155724;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --footer-text: #bbb;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--header-bg);
    min-height: 100vh;
    color: var(--primary-text);
    line-height: 1.6;
}

body.dark-mode {
    --primary-bg: #23272f;
    --primary-text: #f1f1f1;
    --accent: #a29bfe;
    --error-bg: #ff7675;
    --error-text: #2d3436;
    --success-bg: #00b894;
    --success-text: #dfe6e9;
    --header-bg: linear-gradient(135deg, #23272f 0%, #353b48 100%);
    --footer-text: #888;
    --panel-bg: rgba(30, 32, 38, 0.98);
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: none;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    background: none;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.stat-item {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--primary-text);
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-text);
}

.best-wpm {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

body.dark-mode .best-wpm {
    background: linear-gradient(135deg, #636363, #ffd86b);
    color: #23272f;
}

/* Test Area */
.test-area {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    flex-grow: 1;
}

.paragraph-container {
    margin-bottom: 25px;
}

.paragraph {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--primary-text);
    font-weight: 400;
    padding: 20px;
    background: var(--primary-bg);
    border-radius: 8px;
    min-height: 120px;
    user-select: none;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
}

.char {
    position: relative;
}

.char.correct {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.char.incorrect {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.char.current {
    background-color: var(--accent);
    color: white;
    animation: blink 1s infinite;
}

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

.input-container {
    position: relative;
}

.user-input {
    width: 100%;
    height: 120px;
    padding: 20px;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Inter', monospace;
    resize: none;
    outline: none;
    background: var(--primary-bg);
    color: var(--primary-text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.user-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.user-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.time-selector {
    display: flex;
    gap: 10px;
}

.time-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.time-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.time-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: rgba(255, 255, 255, 0.9);
}

.restart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.restart-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

/* Results */
.results {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.results.hidden {
    display: none;
}

.results-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.feedback {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 30px;
    padding: 15px;
    border-radius: 8px;
}

.feedback.excellent {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.feedback.good {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
}

.feedback.practice {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    padding: 25px;
    background: var(--accent);
    color: var(--primary-text);
    border-radius: 12px;
    text-align: center;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: none;
    border: none;
    color: var(--primary-text);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: color 0.2s;
    outline: none;
}
.dark-mode-toggle:focus {
    outline: 2px solid var(--accent);
}

/* Touch-friendly controls */
button, .time-btn, .restart-btn, .dark-mode-toggle {
    min-width: 44px;
    min-height: 44px;
}
.user-input {
    min-height: 44px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .test-area {
        padding: 20px;
    }
    
    .paragraph {
        font-size: 1.1rem;
        padding: 15px;
    }
    
    .user-input {
        height: 100px;
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .time-selector {
        order: 2;
    }
    
    .restart-btn {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .result-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .time-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .paragraph {
        font-size: 1rem;
        padding: 10px;
    }
    .user-input {
        font-size: 0.95rem;
        padding: 10px;
    }
    .header {
        font-size: 1rem;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .result-value {
        font-size: 1.2rem;
    }
}

.footer {
    text-align: center;
    color: var(--footer-text);
    font-size: 1rem;
    margin-top: 30px;
    padding: 16px 0 0 0;
    opacity: 0.8;
} 