

#typing-test-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Lexend Deca', sans-serif;
    border-radius: var(--border-radius);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--text-secondary);
}

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

.time-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.time-btn.active,
.time-btn:hover {
    background: var(--text-correct);
    color: var(--bg-primary);
}

.test-stats {
    display: flex;
    gap: 30px;
}

.stat {
    text-align: center;
}

.stat .label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat .value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-correct);
}

.test-content {
    margin-bottom: 30px;
}

/* Words Container */
.words-container {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    min-height: 216px; /* 6 rows * 36px line-height */
    font-size: 22px;
    line-height: 1.8;
    letter-spacing: 0.5px;
    position: relative;
    font-family: 'Roboto Mono', monospace;
    transition: opacity 0.15s ease;
    overflow: hidden;
}
.words-container.changing {
    opacity: 0.7;
}

.word-row {
    display: block;
    margin-bottom: 8px;
    position: relative;
    min-height: 36px;
    transition: opacity 0.3s ease;
}

.word {
    display: inline-block;
    margin-right: 20px;
    position: relative;
    white-space: nowrap;
    transition: background-color 0.1s ease;
}

.letter {
    color: var(--text-untyped);
   transition: color 0.125s ease;
    position: relative;
}

.letter.correct {
    color: var(--text-typed);
}

.letter.incorrect {
    color: var(--text-error);
    background: rgba(202, 71, 84, 0.2);
    border-radius: 2px;
}

.letter.extra {
    color: var(--text-error);
    text-decoration: underline;
}

.current-word {
  /*  background: rgba(226, 183, 20, 0.1); */
    border-radius: 3px;
    transition: all 0.1s ease;
    transition: background-color 0.1s ease;
}

/* Consistent Caret */
.caret {
    position: absolute;
    width: 2px;
    background: var(--text-caret);
    height: 1.4em;
    margin-top: 0.2em;
    transition: transform 0.1s ease, opacity 0.1s ease;
    animation: caret-blink 1s ease-in-out infinite;
    pointer-events: none;
    border-radius: 1px;
    z-index: 10;
}

.caret.idle {
    animation: none;
}

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

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

#typing-input {
    opacity: 0.01;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 5;
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--text-secondary);
    border-radius: var(--border-radius);
    color: transparent;
    font-size: 18px;
    outline: none;
    transition: border-color 0.3s ease;
    caret-color: transparent;
}

#typing-input:focus {
    border-color: var(--text-correct);
}

.restart-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    color: var(--text-correct);
    background: rgba(226, 183, 20, 0.1);
}

.test-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.setting-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.setting-btn:hover {
    color: var(--text-primary);
    background: rgba(100, 102, 105, 0.3);
}

.setting-btn.active {
    background: var(--text-correct);
    color: var(--bg-primary);
}

/* Enhanced Result Modal */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 700px;
    width: 90%;
    border: 2px solid var(--text-correct);
}

.modal-content h3 {
    color: var(--text-correct);
    margin-bottom: 30px;
    font-size: 24px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.result-item.highlight {
    border-color: var(--text-correct);
    background: rgba(226, 183, 20, 0.1);
    transform: scale(1.05);
    grid-column: span 2;
}

.result-item.highlight .result-main {
    color: var(--text-correct);
    font-size: 42px;
    font-weight: bold;
}

.result-main {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.result-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    text-align: left;
}

.detail-item {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.detail-value {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: bold;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.try-again-btn,
.new-test-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.try-again-btn {
    background: var(--text-correct);
    color: var(--bg-primary);
}

.new-test-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
}

.try-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(226, 183, 20, 0.3);
}

.new-test-btn:hover {
    background: var(--text-secondary);
    color: var(--bg-primary);
}

/* Row indicator */
.row-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .test-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .words-container {
        font-size: 18px;
        padding: 20px;
        min-height: 194px;
    }
    
    .test-stats {
        gap: 20px;
    }
    
    .stat .value {
        font-size: 20px;
    }
    
    .word {
        margin-right: 15px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-item.highlight {
        grid-column: span 1;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    #typing-input {
        font-size: 16px;
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .result-actions {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .letter {
        transition: all 0.06s ease;
    }
    
    .caret {
        transition: all 0.06s cubic-bezier(0.4, 0, 0.2, 1);
    }
}













/* MonkeyType Style Results */
.result-modal .modal-content {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    border: 2px solid var(--text-correct);
}

.result-main-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.main-stat {
    text-align: center;
    flex: 1;
}

.main-stat.wpm {
    flex: 2;
}

.main-stat-value {
    font-size: 42px;
    font-weight: bold;
    color: var(--text-correct);
    line-height: 1;
}

.main-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.result-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 5px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.detail-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.result-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.result-btn.primary {
    background: var(--text-correct);
    color: var(--bg-primary);
}

.result-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
}

.result-btn:hover {
    transform: translateY(-1px);
}

.result-btn.primary:hover {
    box-shadow: 0 3px 10px rgba(226, 183, 20, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .result-main-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-stat.wpm {
        flex: 1;
    }
    
    .main-stat-value {
        font-size: 36px;
    }
    
    .result-details-grid {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
}









/* Add these to your existing CSS */
.smooth-transition {
    transition: all 0.1s ease-in-out;
}

.word-row {
    transition: opacity 0.2s ease-in-out;
}

.page-transition .word-row {
    opacity: 0.7;
}

.caret {
    transition: left 0.1s ease-out, top 0.1s ease-out, opacity 0.1s ease-in-out;
}

.letter {
    transition: color 0.1s ease-in-out, background-color 0.1s ease-in-out;
}

/* Smooth number transitions for stats */
#wpm, #accuracy, #result-wpm, #result-accuracy, #result-raw, #result-consistency, #result-time, #result-keystroke-speed {
    transition: all 0.3s ease-in-out;
}