/* Custom Styles for Learn English App */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.lesson-card {
    animation: fadeIn 0.5s ease-out;
}

.lesson-card:hover {
    animation: pulse 0.6s ease-in-out infinite;
}

.word-card {
    animation: slideIn 0.3s ease-out;
}

.animate-modal {
    animation: slideIn 0.3s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #4F46E5;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4338CA;
}

/* Dark mode styles */
body.dark-mode {
    background: linear-gradient(to bottom right, #1a1a2e, #16213e);
}

body.dark-mode header {
    background: #0f3460;
}

body.dark-mode .bg-white {
    background: #16213e !important;
    color: white;
}

body.dark-mode .text-gray-800 {
    color: #e0e0e0 !important;
}

body.dark-mode .text-gray-600 {
    color: #b0b0b0 !important;
}

body.dark-mode .bg-gray-100 {
    background: #1a1a2e !important;
}

body.dark-mode .bg-gradient-to-r.from-gray-50 {
    background: linear-gradient(to right, #1a1a2e, #16213e) !important;
}

/* Quiz button states */
.quiz-option:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.quiz-option:not(:disabled):hover {
    transform: translateX(-5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .word-card {
        padding: 1rem;
    }
    
    .word-card h5 {
        font-size: 1.5rem;
    }
}

/* Loading spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions */
button, .lesson-card, .word-card, .quiz-option {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
button:focus, 
.quiz-option:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    header, button, .quiz-option {
        display: none;
    }
}

/* Success/Error animations */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

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

/* Gradient text */
.gradient-text {
    background: linear-gradient(to right, #4F46E5, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card hover effects */
.lesson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.lesson-card:hover::before {
    transform: translateX(100%);
}

/* Quiz progress bar animation */
@keyframes progress {
    from {
        width: 0%;
    }
}

.progress-bar {
    animation: progress 1s ease-out;
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

[data-tooltip]:hover::after {
    opacity: 1;
}
