/* Component-specific styles */

/* Upload Area Drag and Drop */
.upload-area.dragover {
    border-color: #EF4135;
    background: linear-gradient(135deg, rgba(0, 85, 164, 0.15), rgba(239, 65, 53, 0.15));
    transform: scale(1.02);
}

.upload-area.dragover .upload-icon {
    transform: scale(1.1);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0055A4;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Answer Button Animations */
.answer-btn {
    position: relative;
    overflow: hidden;
}

.answer-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;
}

.answer-btn:hover::before {
    left: 100%;
}

.answer-btn.correct {
    animation: correctPulse 0.6s ease-out;
}

.answer-btn.incorrect {
    animation: incorrectShake 0.6s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Progress Bar Animation */
.progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Feedback Animations */
.feedback-section {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-icon {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Animations */
.modal {
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: slideInDown 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Screen Transitions */
.screen {
    transition: opacity 0.3s ease-in-out;
}

.screen:not(.active) {
    opacity: 0;
    pointer-events: none;
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Completion Screen Animations */
.completion-icon {
    animation: celebration 1s ease-out;
}

@keyframes celebration {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

/* Keyboard Navigation Indicators */
.answer-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Error States */
.error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    color: #991b1b !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: '⚠️';
    font-size: 1rem;
}

/* Success States */
.success {
    border-color: #22c55e !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
}

.success-message {
    color: #22c55e;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message::before {
    content: '✅';
    font-size: 1rem;
}

/* Responsive Component Adjustments */
@media (max-width: 480px) {
    .answer-btn {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .question-section h2 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #app {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .upload-area {
        background: #334155;
        border-color: #64748b;
    }
    
    .answer-btn {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .answer-btn:hover {
        background: #475569;
    }
    
    .modal-content {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .example-section pre {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
}

/* Print Styles */
@media print {
    .btn,
    .answer-btn,
    .modal,
    #reset-btn {
        display: none !important;
    }
    
    #app {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
    }
} 