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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 40px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

/* Test Wrapper */
.test-wrapper {
    border: 4px solid #ddd;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    background: #fafafa;
}

.test-wrapper.correct {
    border-color: #4CAF50;
}

.test-wrapper.incorrect {
    border-color: #f44336;
}

.test-wrapper.typing {
    border-color: #2196F3;
}

.test-wrapper.complete {
    border-color: #4CAF50;
    background: #e8f5e9;
}

/* Origin Text */
#origin-text {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#origin-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    font-family: 'Courier New', monospace;
}

/* Textarea */
#test-area {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.3s ease;
    line-height: 1.8;
}

#test-area:focus {
    outline: none;
    border-color: #2196F3;
}

#test-area::placeholder {
    color: #999;
}

/* Progress Bar */
.progress-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    transition: width 0.3s ease;
}

/* Meta Section */
.meta {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.btn-reset {
    padding: 20px 35px;
    background: #ff5722;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
}

.btn-reset:hover {
    background: #f4511e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.5);
}

.btn-reset:active {
    transform: translateY(0);
}

/* High Scores */
.high-scores {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 12px;
}

.high-scores h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#score-list {
    list-style: none;
    counter-reset: score-counter;
}

#score-list li {
    background: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    counter-increment: score-counter;
}

#score-list li::before {
    content: counter(score-counter);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

#score-list li.no-scores {
    color: #999;
    font-style: italic;
    justify-content: center;
}

#score-list li.no-scores::before {
    display: none;
}

.score-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.score-wpm {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .meta {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
    }

    .btn-reset {
        width: 100%;
    }

    #test-area {
        min-height: 120px;
        font-size: 1rem;
    }

    #origin-text p {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.complete {
    animation: pulse 0.5s ease;
}
.btn-pause {
    padding: 20px 35px;
    background: #FFC107;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.btn-pause:hover {
    background: #FFB300;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.btn-pause:active {
    transform: translateY(0);
}
