/* ===== Typing Speed Test Styles ===== */


/* Main Card */
.tt-section { margin-top: -80px; padding-bottom: 80px; position: relative; z-index: 2; }
.tt-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.15);
    overflow: hidden;
    max-width: 960px;
    margin: 0 auto;
}
[data-theme="dark"] .tt-card { background: #1a1a2e; box-shadow: 0 40px 80px rgba(0,0,0,0.5); }

/* Config Bar */
.tt-config {
    padding: 20px 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
[data-theme="dark"] .tt-config { border-bottom-color: #2d2d44; }

.tt-select {
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid #e0e7ff;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4f46e5;
    background: white;
    cursor: pointer;
}
[data-theme="dark"] .tt-select { background: #16213e; color: #d1d5db; border-color: #2d2d44; }
.tt-select:focus { outline: none; border-color: #6366f1; }

.tt-start-btn {
    padding: 10px 28px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.tt-start-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.tt-start-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Stats Bar */
.tt-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px 30px;
    background: rgba(99,102,241,0.03);
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
[data-theme="dark"] .tt-stats { background: rgba(99,102,241,0.05); border-bottom-color: #2d2d44; }

.tt-stat {
    text-align: center;
    min-width: 80px;
}
.tt-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}
.tt-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Reference Text */
.tt-reference {
    padding: 30px;
    min-height: 160px;
    font-size: 1.15rem;
    line-height: 2;
    font-family: 'Mangal', 'Noto Sans Devanagari', sans-serif;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    user-select: none;
}
[data-theme="dark"] .tt-reference { color: #94a3b8; border-bottom-color: #2d2d44; }

.tt-reference .char {
    display: inline;
    transition: all 0.1s;
}
.tt-reference .char.correct {
    color: #10b981;
}
.tt-reference .char.incorrect {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
    border-radius: 2px;
}
.tt-reference .char.current {
    border-bottom: 3px solid #6366f1;
    color: #1e293b;
    font-weight: 600;
}
[data-theme="dark"] .tt-reference .char.current { color: #f8fafc; }

/* Input Area */
.tt-input-area {
    padding: 20px 30px;
}
.tt-input {
    width: 100%;
    min-height: 80px;
    border: 2px solid #e0e7ff;
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.15rem;
    line-height: 1.8;
    font-family: 'Mangal', 'Noto Sans Devanagari', sans-serif;
    color: #1e293b;
    outline: none;
    resize: none;
    transition: border-color 0.3s;
    background: transparent;
}
[data-theme="dark"] .tt-input { color: #e2e8f0; border-color: #2d2d44; }
.tt-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.tt-input::placeholder { color: #cbd5e1; }
.tt-input:disabled { background: #f8fafc; cursor: not-allowed; }
[data-theme="dark"] .tt-input:disabled { background: #16213e; }

/* Timer animation */
.tt-timer-ring {
    display: inline-block;
    width: 50px;
    height: 50px;
    position: relative;
}
.tt-timer-ring svg {
    transform: rotate(-90deg);
}
.tt-timer-ring circle {
    fill: none;
    stroke-width: 4;
}
.tt-timer-ring .bg { stroke: #e0e7ff; }
[data-theme="dark"] .tt-timer-ring .bg { stroke: #2d2d44; }
.tt-timer-ring .fg {
    stroke: #4f46e5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

/* Results Modal */
.tt-results-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}
.tt-results-overlay.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tt-results-card {
    background: white;
    border-radius: 28px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 40px 80px rgba(0,0,0,0.3);
    text-align: center;
    animation: scaleIn 0.3s ease;
}
[data-theme="dark"] .tt-results-card { background: #1a1a2e; }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tt-results-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tt-results-subtitle { color: #94a3b8; margin-bottom: 24px; }

.tt-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.tt-result-item {
    background: rgba(99,102,241,0.04);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(99,102,241,0.1);
}
[data-theme="dark"] .tt-result-item { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.15); }
.tt-result-value {
    font-size: 2rem;
    font-weight: 800;
    color: #4f46e5;
}
.tt-result-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Accuracy bar */
.tt-accuracy-bar {
    height: 8px;
    background: #e0e7ff;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}
[data-theme="dark"] .tt-accuracy-bar { background: #2d2d44; }
.tt-accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #ec4899);
    border-radius: 4px;
    transition: width 1s ease;
}

.tt-results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
