/* 🎯 Quiz Mode - Enhanced Styles with SVG Icons */

/* Quiz Layout - Two Column Design */
.quiz-main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 25px 0;
    align-items: start;
}

/* Quiz Word Card - Left Column */
.quiz-word-card {
    width: 500px;
    height: 500px;
    background: #ffffff;
    border-radius: 20px;
    border: 2px solid #E2E8F0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
}

.quiz-word-section {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.quiz-word-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 0;
    justify-content: center;
    flex-wrap: nowrap;
    min-height: auto;
}

.quiz-word-icon {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    flex-shrink: 0;
    order: -1; /* Put icon above text */
}

.quiz-word-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

.quiz-word-icon svg {
    width: 60px;
    height: 60px;
    color: #ffffff;
    stroke-width: 2;
    flex-shrink: 0;
}

.quiz-word-icon .word-emoji {
    font-size: 55px;
    line-height: 1;
}

.quiz-word-content {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 200px;
}

.quiz-word {
    font-size: 48px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
}

.quiz-pronunciation {
    font-size: 20px;
    color: #64748B;
    font-style: italic;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
}

.tts-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.tts-question-btn {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%) !important;
    border: none !important;
    color: white !important;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3);
}

.tts-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%) !important;
}

.tts-question-btn i {
    margin-right: 8px;
}

/* Quiz Options Column - Right Side */
.quiz-options-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-self: center;
    width: 100%;
    max-width: 450px;
}

.quiz-options-container {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    margin: 0;
    background: #ffffff;
    border: 3px solid #E2E8F0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    position: relative;
    overflow: hidden;
    min-height: 80px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-option:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.quiz-option.selected {
    border-color: #3B82F6;
    background: #EFF6FF;
    color: #1E40AF;
}

.quiz-option.correct {
    border-color: #10B981;
    background: #ECFDF5;
    color: #047857;
}

.quiz-option.incorrect {
    border-color: #EF4444;
    background: #FEF2F2;
    color: #DC2626;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #F1F5F9;
    color: #64748B;
    border-radius: 12px;
    font-weight: 700;
    font-size: 20px;
    margin-left: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.quiz-option:hover .option-letter {
    background: #3B82F6;
    color: white;
}

.quiz-option.selected .option-letter,
.quiz-option.correct .option-letter {
    background: #10B981;
    color: white;
}

.quiz-option.incorrect .option-letter {
    background: #EF4444;
    color: white;
}

.option-text {
    flex: 1;
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    font-size: 18px;
    line-height: 1.4;
}

/* Feedback Section */
.quiz-feedback {
    margin: 25px 0;
    padding: 20px;
    border-radius: 12px;
    animation: slideInUp 0.5s ease-out;
}

.quiz-feedback.correct {
    background: #ECFDF5;
    border: 1px solid #10B981;
}

.quiz-feedback.incorrect {
    background: #FEF2F2;
    border: 1px solid #EF4444;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.feedback-icon {
    font-size: 24px;
}

.feedback-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.feedback-title.correct {
    color: #047857;
}

.feedback-title.incorrect {
    color: #DC2626;
}

.feedback-content {
    color: #374151;
    line-height: 1.6;
}

.correct-answer {
    font-weight: 600;
    color: #047857;
}

/* Progress Section Enhanced */
.quiz-progress-section {
    background: #F8FAFC;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #E2E8F0;
}

.quiz-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
}

.category-text {
    font-size: 14px;
    color: #64748B;
    font-weight: 500;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #059669);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.quiz-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
}

.quiz-stats span {
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
}

/* Completion Screen */
.quiz-completion {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border-radius: 16px;
    margin: 20px 0;
}

.completion-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.completion-score {
    font-size: 48px;
    font-weight: 800;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.completion-stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    backdrop-filter: blur(10px);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    opacity: 0.9;
}

.stat-value {
    font-weight: 700;
}

.correct-text {
    color: #10B981;
}

.incorrect-text {
    color: #F87171;
}

.completion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: #3B82F6;
    color: white;
}

.btn-primary:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .quiz-main-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .quiz-word-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .quiz-options-column {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .quiz-word-card {
        width: 100%;
        height: 400px;
        padding: 25px;
    }
    
    .quiz-word-container {
        gap: 20px;
    }
    
    .quiz-word-icon {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
    }
    
    .quiz-word-icon svg {
        width: 50px;
        height: 50px;
    }
    
    .quiz-word-icon .word-emoji {
        font-size: 45px;
    }
    
    .quiz-word {
        font-size: 36px;
    }
    
    .quiz-pronunciation {
        font-size: 18px;
    }
    
    .quiz-option {
        padding: 18px 20px;
        min-height: 70px;
        font-size: 16px;
    }
    
    .option-letter {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-left: 15px;
    }
    
    .option-text {
        font-size: 16px;
    }
    
    .quiz-stats {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .completion-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-action {
        min-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .quiz-word-card {
        height: 350px;
        padding: 20px;
    }
    
    .quiz-word-container {
        gap: 15px;
    }
    
    .quiz-word-icon {
        width: 80px;
        height: 80px;
        min-width: 80px;
        min-height: 80px;
        border-radius: 20px;
    }
    
    .quiz-word-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .quiz-word-icon .word-emoji {
        font-size: 35px;
    }
    
    .quiz-word {
        font-size: 28px;
    }
    
    .quiz-pronunciation {
        font-size: 16px;
    }
    
    .quiz-option {
        padding: 15px 18px;
        min-height: 60px;
        font-size: 15px;
    }
    
    .option-letter {
        width: 35px;
        height: 35px;
        font-size: 16px;
        margin-left: 12px;
    }
    
    .option-text {
        font-size: 15px;
    }
}

/* Quiz Control Buttons - Enhanced Modern Design */
.quiz-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    position: relative;
}

.quiz-control-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
    text-decoration: none;
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
}

.quiz-control-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;
}

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

.quiz-control-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.quiz-control-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.quiz-control-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.quiz-control-btn:hover i {
    transform: scale(1.2);
}

/* Previous Button Specific Styling */
.quiz-control-btn[data-action="previous"] {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3);
}

.quiz-control-btn[data-action="previous"]:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 10px 30px rgba(100, 116, 139, 0.4);
}

/* Next Button Specific Styling */
.quiz-control-btn[data-action="next"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.quiz-control-btn[data-action="next"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

/* Hint Button Specific Styling */
.quiz-control-btn.hint-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.quiz-control-btn.hint-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

/* Disabled State */
.quiz-control-btn:disabled {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: none;
}

.quiz-control-btn:disabled::before {
    display: none;
}

.quiz-control-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Mobile Responsive Controls */
@media (max-width: 768px) {
    .quiz-controls {
        gap: 15px;
        margin: 25px auto;
        padding: 15px;
        max-width: 90%;
    }
    
    .quiz-control-btn {
        padding: 14px 24px;
        font-size: 15px;
        min-width: 120px;
        gap: 10px;
    }
    
    .quiz-control-btn i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .quiz-controls {
        flex-direction: column;
        gap: 12px;
        padding: 20px 15px;
    }
    
    .quiz-control-btn {
        width: 100%;
        max-width: 200px;
        padding: 16px 20px;
        min-width: auto;
    }
}

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

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

@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    }
}

.quiz-word-icon:hover {
    animation: pulse 2s infinite;
}

.quiz-control-btn:not(:disabled):hover {
    animation: buttonGlow 2s infinite;
}