/* ===== AI Content Modals ===== */

.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ai-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.ai-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.ai-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.ai-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-modal-body {
    padding: 2rem;
}

/* Loading Modal */
.loading-modal {
    text-align: center;
    padding: 3rem 2rem;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.loading-hint {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ===== Flashcards ===== */

.flashcards-container {
    max-width: 600px;
    margin: 0 auto;
}

.flashcard-viewer {
    text-align: center;
}

.flashcard-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.flashcard {
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    border-radius: 12px;
    padding: 3rem 2rem;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.flashcard:hover {
    transform: translateY(-4px);
}

.flashcard-front,
.flashcard-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.flashcard-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

.flashcard-content {
    font-size: 1.25rem;
    font-weight: 500;
    color: white;
    line-height: 1.6;
}

.flashcard-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1rem;
}

.flashcard-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.flashcard-controls button {
    min-width: 150px;
}

/* ===== Quiz ===== */

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
}

.quiz-question {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.quiz-question-header {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    border-color: #2563EB;
    background: #EAF0FF;
}

.quiz-option input[type="radio"] {
    cursor: pointer;
}

.quiz-option.correct-answer {
    border-color: #10b981;
    background: #ecfdf5;
}

.quiz-option.wrong-answer {
    border-color: #ef4444;
    background: #fef2f2;
}

.quiz-explanation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
}

.explanation-correct {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid #10b981;
    padding: 1rem;
}

.explanation-wrong {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
    padding: 1rem;
}

.quiz-controls {
    text-align: center;
    margin: 2rem 0;
}

.quiz-results {
    margin-top: 2rem;
}

.quiz-score {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    color: white;
    border-radius: 12px;
}

.quiz-score h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.quiz-score .score-message {
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ===== Test ===== */

.test-instructions {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.test-container {
    max-width: 700px;
    margin: 0 auto;
}

.test-question {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.test-question-header {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.test-answer-area {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.test-answer-area:focus {
    outline: none;
    border-color: #2563EB;
}

.test-sample-answer {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 4px solid #0ea5e9;
}

.test-sample-answer h4 {
    margin: 0 0 0.75rem 0;
    color: #0369a1;
    font-size: 0.95rem;
}

.test-sample-answer p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.test-sample-answer ul {
    margin: 0;
    padding-left: 1.5rem;
}

.test-sample-answer li {
    margin-bottom: 0.5rem;
}

.test-controls {
    text-align: center;
    margin: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .ai-modal-header {
        padding: 1rem;
    }
    
    .ai-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .ai-modal-body {
        padding: 1rem;
    }
    
    .flashcard {
        padding: 2rem 1rem;
        min-height: 200px;
    }
    
    .flashcard-content {
        font-size: 1.1rem;
    }
    
    .flashcard-controls {
        flex-direction: column;
    }
    
    .flashcard-controls button {
        width: 100%;
    }
}
