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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
}

.section h2 {
    margin-bottom: 1.5rem;
    color: #4a5568;
    font-size: 1.5rem;
}

/* Timer Section */
.timer-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.timer-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.timer-select:focus {
    outline: none;
    border-color: #667eea;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.start-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stop-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(229, 62, 62, 0.4);
}

/* Reference Prompt */
.reference-prompt {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem 0;
    text-align: center;
}

.prompt-content h3 {
    color: #d68910;
    margin-bottom: 1rem;
}

.prompt-content p {
    color: #8c6a00;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.compare-btn {
    background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compare-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.prompt-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.prompt-note {
    font-size: 0.9rem;
    color: #8c6a00;
    font-style: italic;
}

.timer-display {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    font-family: 'Courier New', monospace;
    margin-top: 1rem;
}

/* Text Input Tabs */
.text-input-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: #718096;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Elements */
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea:disabled {
    background-color: #f7fafc;
    cursor: not-allowed;
}

/* Disabled states for inputs during practice */
.tab-btn:disabled {
    color: #a0aec0;
    cursor: not-allowed;
    border-bottom-color: transparent;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #edf2f7;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-types {
    font-size: 0.9rem;
    color: #718096;
    margin-top: 0.5rem;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    color: #667eea;
    font-weight: 600;
}

.hidden {
    display: none;
}

/* Practice Section */
.practice-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    font-weight: 600;
}

.word-counter, .time-remaining {
    color: #667eea;
}

/* Results Section */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Mistake Breakdown */
.mistake-breakdown {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.mistake-breakdown h3 {
    margin-bottom: 1rem;
    color: #4a5568;
}

.mistake-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.mistake-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mistake-icon {
    font-size: 1.2rem;
}

.mistake-label {
    flex: 1;
    font-weight: 600;
}

.mistake-count {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

/* Text Comparison */
.comparison-section {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.comparison-section h3 {
    margin-bottom: 1rem;
    color: #4a5568;
}

.comparison-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.legend-item {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.legend-item.correct {
    background: #c6f6d5;
    color: #22543d;
}

.legend-item.missing {
    background: #fed7d7;
    color: #742a2a;
}

.legend-item.misspelled {
    background: #feebc8;
    color: #744210;
}

.legend-item.wrong {
    background: #feb2b2;
    color: #822727;
}

.legend-item.extra {
    background: #bee3f8;
    color: #2a4365;
}

.comparison-texts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.comparison-text h4 {
    margin-bottom: 1rem;
    color: #4a5568;
    font-size: 1.1rem;
}

.text-comparison {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 1rem;
    min-height: 200px;
    border: 1px solid #e2e8f0;
}

/* Text Comparison Highlighting */
.word-correct {
    background: #c6f6d5;
    color: #22543d;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    margin: 0.1rem;
}

.word-missing {
    background: #fed7d7;
    color: #742a2a;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    margin: 0.1rem;
    text-decoration: line-through;
}

.word-misspelled {
    background: #feebc8;
    color: #744210;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    margin: 0.1rem;
    border-bottom: 2px wavy #d69e2e;
}

.word-wrong {
    background: #feb2b2;
    color: #822727;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    margin: 0.1rem;
    text-decoration: line-through;
}

.word-extra {
    background: #bee3f8;
    color: #2a4365;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    margin: 0.1rem;
    text-decoration: underline;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .timer-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .mistake-types {
        grid-template-columns: 1fr;
    }
    
    .comparison-texts {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .timer-display {
        font-size: 2rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
}
