/* منصة حرف لتدريب نافس - التنسيقات المخصصة */

:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #dcfce7;
    --navy: #0f172a;
    --gold: #f59e0b;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* بطاقات الخيارات التفاعلية في الاختبار */
.option-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    transform: translateY(-2px);
    border-color: #10b981;
    background-color: #f0fdf4;
}

.option-card.selected {
    border-color: #059669;
    background-color: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.option-card.correct-highlight {
    border-color: #10b981 !important;
    background-color: #dcfce7 !important;
    color: #065f46 !important;
}

.option-card.incorrect-highlight {
    border-color: #f43f5e !important;
    background-color: #ffe4e6 !important;
    color: #9f1239 !important;
}

/* شارة حرف الخيار (أ ، ب ، ج ، د) */
.option-letter-badge {
    transition: all 0.2s ease;
}
.option-card:hover .option-letter-badge {
    background-color: #059669;
    color: white;
}
.option-card.selected .option-letter-badge {
    background-color: #059669;
    color: white;
    transform: scale(1.05);
}

/* أزرار خريطة الأسئلة في المحاكي */
.question-nav-btn {
    transition: all 0.15s ease;
}
.question-nav-btn.active {
    outline: 2px solid #059669;
    outline-offset: 2px;
    font-weight: 800;
}
.question-nav-btn.answered {
    background-color: #059669;
    color: white;
}
.question-nav-btn.flagged {
    border-color: #f59e0b;
    color: #d97706;
    background-color: #fef3c7;
}

/* صندوق المعلم الذكي التفاعلي */
.tutor-box {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* تأثير النبض للمؤقت عندما يقل عن 5 دقائق */
.timer-pulse-danger {
    animation: timerPulse 1s infinite alternate;
}
@keyframes timerPulse {
    from {
        color: #e11d48;
        transform: scale(1);
    }
    to {
        color: #be123c;
        transform: scale(1.06);
    }
}

/* فقاعة كلام المعلم الذكي */
.speech-bubble {
    position: relative;
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
}
.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 32px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #ffffff transparent;
    display: block;
    width: 0;
}

/* مؤشر التقدم الدائري */
.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* شريط تمرير أنيق */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* طباعة نتائج الاختبار */
@media print {
    header, footer, .no-print {
        display: none !important;
    }
    body {
        background: white !important;
    }
    .print-card {
        border: none !important;
    }
}

/* ==========================================================================
   منظومة الثيمات التفاعلية (5 ثيمات مبتكرة بمؤثرات بصرية)
   ========================================================================== */

/* 1. الثيم الليلي الملكي (Royal Dark Mode) */
body.theme-dark {
    background-color: #0b1120 !important;
    color: #e2e8f0 !important;
}
body.theme-dark header {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: #1e293b !important;
}
body.theme-dark .bg-white {
    background-color: #131d32 !important;
    color: #e2e8f0 !important;
    border-color: #1e293b !important;
}
body.theme-dark .bg-slate-50,
body.theme-dark .bg-slate-100 {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
body.theme-dark .text-slate-900,
body.theme-dark .text-slate-800 {
    color: #f8fafc !important;
}
body.theme-dark .text-slate-700,
body.theme-dark .text-slate-600 {
    color: #cbd5e1 !important;
}
body.theme-dark .border-slate-200,
body.theme-dark .border-slate-100 {
    border-color: #1e293b !important;
}
body.theme-dark .option-card {
    background-color: #17233d !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
body.theme-dark .option-card:hover {
    background-color: #1e293b !important;
    border-color: #10b981 !important;
}

/* 2. ثيم المستقبل النيوني (Cyber Neon) */
body.theme-neon {
    background-color: #05050f !important;
    color: #e0e7ff !important;
}
body.theme-neon header {
    background: rgba(10, 10, 26, 0.95) !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2) !important;
}
body.theme-neon .bg-white {
    background-color: #0f0f2d !important;
    border-color: #3730a3 !important;
    color: #e0e7ff !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1) !important;
}
body.theme-neon .bg-slate-50,
body.theme-neon .bg-slate-100 {
    background-color: #09091e !important;
    border-color: #312e81 !important;
}
body.theme-neon .text-slate-900,
body.theme-neon .text-slate-800 {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}
body.theme-neon .text-slate-700,
body.theme-neon .text-slate-600 {
    color: #c7d2fe !important;
}
body.theme-neon .border-slate-200 {
    border-color: #3730a3 !important;
}
body.theme-neon .option-card {
    background-color: #131338 !important;
    border-color: #4338ca !important;
    color: #e0e7ff !important;
}
body.theme-neon .option-card:hover {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4) !important;
    border-color: #a855f7 !important;
}

/* 3. ثيم الأصيل الدافئ (Sunset Amber Gold) */
body.theme-amber {
    background-color: #fffbeb !important;
}
body.theme-amber header {
    background: rgba(254, 243, 199, 0.95) !important;
    border-color: #fde68a !important;
}
body.theme-amber .option-card:hover {
    background-color: #fef3c7 !important;
    border-color: #d97706 !important;
}
body.theme-amber .option-card.selected {
    background-color: #fde68a !important;
    border-color: #b45309 !important;
}

/* 4. ثيم المرح الطفولي للمرحلة الابتدائية (Playful Kids / Candy) */
body.theme-kids {
    background-color: #fdf4ff !important;
    font-family: 'Tajawal', 'Cairo', cursive, sans-serif !important;
}
body.theme-kids header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 3px solid #f472b6 !important;
}
body.theme-kids .rounded-2xl,
body.theme-kids .rounded-3xl {
    border-radius: 1.75rem !important;
}
body.theme-kids .option-card {
    border-width: 2.5px !important;
    border-radius: 1.5rem !important;
}

/* ==========================================================================
   الأيقونات الاحترافية التفاعلية (Micro-Interactions & Animations)
   ========================================================================== */

.icon-interactive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    user-select: none;
}

.icon-interactive:hover {
    transform: translateY(-3px) scale(1.1);
}

.icon-interactive:active {
    transform: translateY(1px) scale(0.95);
}

/* تأثير الدوران المرح */
.icon-rotate-hover:hover {
    transform: rotate(15deg) scale(1.15);
}

/* تأثير الارتداد الحيوي */
.icon-bounce-hover:hover {
    animation: iconBounce 0.6s cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px) scale(1.15); }
    50% { transform: translateY(0) scale(1.05); }
    70% { transform: translateY(-3px) scale(1.08); }
}

/* تأثير التذبذب الخفيف */
.icon-wiggle:hover {
    animation: iconWiggle 0.5s ease-in-out;
}

@keyframes iconWiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-12deg) scale(1.1); }
    75% { transform: rotate(12deg) scale(1.1); }
}

/* التوهجات الضوئية للأيقونات والشارات */
.glow-emerald {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
}
.glow-amber {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
}
.glow-purple {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.45);
}
.glow-rose {
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.45);
}

/* تأثير التموج السينمائي عند تبديل الثيم */
.theme-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: normal;
    transition: opacity 0.4s ease;
}

/* بطاقة مصيدة نافس */
.trap-card {
    border: 2px dashed #f43f5e;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    position: relative;
    overflow: hidden;
}
body.theme-dark .trap-card {
    background: linear-gradient(135deg, #38111a 0%, #200810 100%);
    border-color: #fb7185;
}

/* بطاقات رحلة نافس والمستويات */
.journey-path {
    position: relative;
}
.journey-node {
    transition: all 0.3s ease;
}
.journey-node:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
}

