* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.95);
}

.canvas-container {
    position: relative;
    width: 600px;
    height: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.canvas-container:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.canvas-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#gridCanvas {
    z-index: 1;
}

#drawingCanvas {
    z-index: 2;
}

#cursorCanvas {
    z-index: 3;
    pointer-events: none;
}

.equation-container {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Complex Number Practice Styles */
.practice-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

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

.problem-display {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #495057;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.problem-display-large {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 32px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #495057;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.problem-display img {
    max-width: 100%;
    height: auto;
}

.answer-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.3s;
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.root-input {
    font-family: 'JetBrains Mono', monospace;
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.root-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"].root-input {
    text-align: center;
}

/* Feedback styles */
.text-red-600 {
    color: #dc3545;
}

.text-green-600 {
    color: #28a745;
}

.text-blue-800 {
    color: #0056b3;
}

.text-blue-900 {
    color: #003d82;
}

.text-purple-900 {
    color: #5a1a8f;
}

.bg-blue-50 {
    background-color: #e7f1ff;
}

.border-blue-200 {
    border-color: #90c9ff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .canvas-container {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
}