/* Typing Interface - Tesla Modern Theme Integration */
.typing-exercise {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
    min-height: 300px;
    box-shadow: 0 8px 32px var(--shadow-light);
    transition: all 0.3s ease;
}

.typing-exercise:hover {
    box-shadow: 0 12px 40px var(--shadow-medium);
}

/* Title and description styling */
.typing-exercise h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.typing-exercise h3 .icon {
    margin-right: 0.8rem;
    font-size: 1.5rem;
    color: var(--accent-primary);
}

/* Settings area styling */
.typing-settings {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.8rem;
    border: 1px solid var(--border-color);
}

.settings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: space-between;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.setting-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.setting-group select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.7rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.85rem;
    padding-right: 2.5rem;
}

.setting-group select:hover, 
.setting-group select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    outline: none;
}

/* Text area styling */
.text-to-type {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.8rem;
    font-size: 1.2rem;
    line-height: 1.6;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-light);
    min-height: 120px;
    transition: all 0.3s ease;
}

.text-to-type:hover {
    border-color: var(--accent-primary);
}

/* Input field styling */
.typing-input {
    margin-bottom: 1.8rem;
}

.typing-input input {
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px var(--shadow-light);
}

.typing-input input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(62, 106, 225, 0.2);
}

.typing-input input::placeholder {
    color: var(--text-tertiary);
}

/* Stats area styling */
.typing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.8rem;
}

.stat-item {
    background: var(--bg-primary);
    padding: 1.2rem;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(62, 106, 225, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-item:hover::after {
    opacity: 1;
}

.stat-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.stat-item .icon {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
    color: var(--accent-primary);
}

.stat-item span:not(.icon) {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

/* WPM stat special styling */
#wpm {
    color: var(--success-color);
}

/* Accuracy stat special styling */
#accuracy {
    color: var(--info-color);
}

/* Errors stat special styling */
#errors {
    color: var(--error-color);
}

/* Button controls styling */
.typing-controls-bottom {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.typing-controls-bottom .btn {
    min-width: 120px;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.typing-controls-bottom .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.typing-controls-bottom .btn:hover::before {
    left: 100%;
}

.typing-controls-bottom .btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 16px rgba(4, 181, 84, 0.3);
}

.typing-controls-bottom .btn-success:hover {
    background: #039649;
    box-shadow: 0 8px 24px rgba(4, 181, 84, 0.4);
}

.typing-controls-bottom .btn-warning {
    background: var(--warning-color);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.3);
}

.typing-controls-bottom .btn-warning:hover {
    background: #e68900;
    box-shadow: 0 8px 24px rgba(255, 152, 0, 0.4);
}

.typing-controls-bottom .btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(62, 106, 225, 0.3);
}

.typing-controls-bottom .btn-primary:hover {
    background: #2f57d4;
    box-shadow: 0 8px 24px rgba(62, 106, 225, 0.4);
}

/* Additional styling for settings button */
#newTextBtn {
    background: var(--accent-secondary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(249, 1, 1, 0.3);
}

#newTextBtn:hover {
    background: #e00000;
    box-shadow: 0 8px 24px rgba(249, 1, 1, 0.4);
}

/* Text highlighting */
.text-to-type .current-char {
    background: var(--accent-primary);
    color: white;
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
}

.text-to-type .correct-char {
    background: var(--success-color);
    color: white;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

.text-to-type .error-char {
    background: var(--error-color);
    color: white;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Finger guide section */
.finger-guide-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px var(--shadow-light);
    transition: all 0.3s ease;
}

.finger-guide-container:hover {
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.finger-guide-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.finger-guide-title h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
}

.hand-icon {
    font-size: 1.8rem;
    color: var(--accent-primary);
}

.finger-guide-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* PDF Upload Section */
.pdf-upload-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px var(--shadow-light);
    transition: all 0.3s ease;
}

.pdf-upload-section:hover {
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.pdf-upload-section h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.pdf-upload-section h3 .icon {
    margin-right: 0.8rem;
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.upload-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Keyboard layout selector styling */
.keyboard-selector {
    margin-bottom: 15px;
}

.keyboard-selector label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 10px;
}

.keyboard-selector select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.keyboard-selector select:hover,
.keyboard-selector select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    .typing-exercise,
    .finger-guide-container,
    .pdf-upload-section {
        padding: 1.5rem;
    }
    
    .settings-grid {
        flex-direction: column;
    }
    
    .typing-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .upload-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .typing-stats {
        grid-template-columns: 1fr;
    }
    
    .text-to-type {
        padding: 1.5rem;
        font-size: 1rem;
    }
    
    .typing-input input {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .typing-controls-bottom {
        flex-direction: column;
        align-items: center;
    }
    
    .typing-controls-bottom .btn {
        min-width: 200px;
    }
}

/* Animation effects for modern typing interface */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Animations removed */

/* Animation classes */
.text-refreshing {
    animation: pulse 0.5s ease;
}

.stat-updated {
    animation: pulse 0.5s ease;
}

.input-focused {
    position: relative;
}

.input-focused::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 50%;
    height: 3px;
    background: var(--accent-primary);
    transform: translateX(-50%);
    border-radius: 3px;
}

/* Additional styles for better visual effects removed */

.typing-stats .stat-item {
    position: relative;
    overflow: hidden;
}

.typing-stats .stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--info-color), var(--success-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.typing-stats .stat-item:hover::before {
    transform: scaleX(1);
}

/* Custom cursor for text area */
.text-to-type {
    position: relative;
    cursor: text;
}
