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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

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

.stats {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.shortcut-tracker {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.shortcut-tracker h3 {
    margin-bottom: 15px;
    color: #2d3748;
    text-align: center;
}

.shortcut-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7fafc;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    min-width: 100px;
    transition: all 0.3s ease;
}

.shortcut-item.used {
    border-color: #48bb78;
    background: #f0fff4;
    transform: scale(1.05);
}

.shortcut-key {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: bold;
    background: #4a5568;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.shortcut-desc {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-bottom: 5px;
}

.shortcut-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #48bb78;
    background: #c6f6d5;
    padding: 2px 8px;
    border-radius: 50%;
    min-width: 24px;
    text-align: center;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a5568;
}

.exercise-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.exercise-info {
    margin-bottom: 25px;
}

.exercise-info h2 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.exercise-info p {
    color: #666;
    font-size: 1rem;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.target-code, .typing-area {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.target-code h3, .typing-area h3 {
    background: #f7fafc;
    padding: 10px 15px;
    margin: 0;
    font-size: 0.9rem;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.target-code {
    border-color: #4299e1;
}

.typing-area {
    border-color: #48bb78;
}

.target-code h3 {
    background: #ebf8ff;
    color: #2b6cb0;
}

.typing-area h3 {
    background: #f0fff4;
    color: #276749;
}

#target-editor, #typing-editor {
    height: 400px;
    width: 100%;
}

.feedback {
    min-height: 40px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.feedback.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.feedback.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.feedback.info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 140px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
}

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

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-hint {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.btn-hint:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.3);
}

.progress-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(135deg, #48bb78, #38a169);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Monaco Editor customizations */
.monaco-editor {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important;
    font-size: 14px !important;
}

/* Visual diff highlighting */
.monaco-editor .completed-text {
    color: #48bb78 !important;
    font-weight: bold !important;
}

.monaco-editor .completed-inline {
    color: #48bb78 !important;
    font-weight: bold !important;
}

/* Shortcut suggestion popup */
.shortcut-suggestion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
    z-index: 1000;
    max-width: 350px;
    display: none;
    animation: slideInRight 0.3s ease-out;
}

.shortcut-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 12px;
}

.shortcut-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.shortcut-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 500;
}

.shortcut-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.shortcut-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    #target-editor, #typing-editor {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stat {
        flex: 1;
        min-width: 120px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    #target-editor, #typing-editor {
        height: 250px;
    }
    
    .exercise-container {
        padding: 20px;
    }
}
