/* ==========================================================================
   1. GLOBAL STYLES & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: #f4f7f6;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* ==========================================================================
   2. NAVBAR & LOGO STYLES (Fixed Alignment)
   ========================================================================== */
.navbar {
    background-color: #0b3c5d;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* حاوية اللوغو: تجبر الصورة والنص على الظهور بجانب بعض أفقياً ومحاذاة بالمنتصف */
.logo {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer;
}

.nav-logo {
    height: 45px !important;
    width: auto !important;
    display: block !important;
    transition: transform 0.2s ease;
}

.logo:hover .nav-logo {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: #d9b310;
    white-space: nowrap !important;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links button {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    margin-left: 15px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.nav-links button:hover {
    background-color: #328cc1;
}

/* زر تفعيل الوضع الليلي الاحترافي */
#dark-mode-toggle {
    font-size: 1.3rem;
    margin-left: 20px;
    color: #d9b310;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

#dark-mode-toggle:hover {
    transform: scale(1.15);
    background: transparent;
}

/* ==========================================================================
   3. CONTAINERS & FLASHCARDS
   ========================================================================== */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    display: none;
}

.container.active {
    display: block;
}

#welcome-section {
    text-align: center;
    margin-top: 100px;
}

#category-title {
    color: #0b3c5d;
    margin-bottom: 20px;
    text-transform: capitalize;
    border-bottom: 2px solid #d9b310;
    padding-bottom: 10px;
}

.flashcard {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 6px solid #0b3c5d;
    margin-bottom: 20px;
}

.scenario-box h3 {
    color: #e95c20;
    margin-bottom: 10px;
}

.scenario-box p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* ==========================================================================
   4. REVEAL BUTTONS & CONTENT ANIMATION
   ========================================================================== */
.reveal-btn {
    display: block;
    width: 100%;
    text-align: start;
    background-color: #eef4f8;
    color: #0b3c5d;
    border: 1px solid #328cc1;
    padding: 12px 15px;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.reveal-btn:hover {
    background-color: #328cc1;
    color: white;
}

.reveal-content {
    background-color: #fafafa;
    border-left: 3px solid #d9b310;
    padding: 15px;
    margin-top: 5px;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 0 4px 4px 0;
}

.reveal-content:not(.hidden) {
    animation: fadeInSmooth 0.4s ease-in-out;
}

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

.hidden {
    display: none !important;
}

/* ==========================================================================
   5. CONTROLS & EMERGENCY FLOATING BUTTON
   ========================================================================== */
.controls {
    text-align: end;
}

.next-btn {
    background-color: #e95c20;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.next-btn:hover {
    background-color: #d14e19;
}

/* زر الدعم النفسي الطارئ العائم بالأحمر الطبي للتناسق والوضوح */
#funny-toggle {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1000;
    font-size: 0.95rem;
    font-weight: bold;
    background-color: #c0392b !important; /* أحمر طوارئ فخم */
    color: #ffffff !important;            /* نص أبيض ناصع للبروز */
    border: 2px solid #fff;
    border-radius: 20px;
    padding: 10px 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(192, 41, 43, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

#funny-toggle:hover {
    transform: scale(1.08);
    background-color: #a82c21 !important;
    box-shadow: 0 6px 20px rgba(192, 41, 43, 0.6);
}

/* ==========================================================================
   6. GRADUATION COUNTDOWN BOXES
   ========================================================================== */
.countdown-title {
    color: #0b3c5d;
    transition: color 0.3s;
}

.countdown-box {
    background: #0b3c5d;
    color: #d9b310;
    transition: background-color 0.3s, border-color 0.3s;
}

.box-label {
    color: #ffffff;
}

/* ==========================================================================
   7. STICKY FOOTER STYLES
   ========================================================================== */
.main-footer {
    background-color: #0b3c5d;
    color: #ffffff;
    text-align: center;
    padding: 15px 20px;
    font-size: 0.9rem;
    border-top: 3px solid #d9b310;
    margin-top: auto; /* دفع الفوتر للأسفل تماماً */
    width: 100%;
}

.main-footer p {
    margin: 0;
    font-weight: 400;
}

/* ==========================================================================
   8. DARK MODE STYLES
   ========================================================================== */
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-theme .logo-text {
    color: #d9b310;
}

/* الكروت في الوضع الليلي */
body.dark-theme .flashcard {
    background-color: #1e1e1e;
    border-color: #333;
    border-left-color: #d9b310;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* أزرار الكشف في الوضع الليلي */
body.dark-theme .reveal-btn {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-theme .reveal-btn:hover {
    background-color: #328cc1;
    color: white;
}

/* صناديق النصوص المكشوفة في الوضع الليلي */
body.dark-theme .reveal-content {
    background-color: #252525;
    color: #e0e0e0;
    border-left-color: #d9b310;
}

/* العداد في الوضع الليلي */
body.dark-theme .countdown-title {
    color: #d9b310;
}

body.dark-theme .countdown-box {
    background: #1e1e1e;
    border-color: #d9b310;
}

/* الفوتر في الوضع الليلي */
body.dark-theme .main-footer {
    background-color: #1a1a1a;
    border-top-color: #d9b310;
}

/* ==========================================================================
   9. CUSTOM MEDICAL ANIMATIONS (Icons & Heart)
   ========================================================================== */
/* لون وحركة أيقونات الطوارئ والإسعاف - تم تحويلها للأبيض لتباين فخم وثابت داخل الأزرار */
.emergency-icon {
    color: #ffffff !important;
    font-size: 1.1rem;
    animation: flash 0.8s infinite alternate;
    display: inline-block;
}

@keyframes flash {
    from { 
        opacity: 0.5; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1.15); 
    }
}

/* تأثير نبض القلب في الفوتر */
@keyframes beat {
    to { transform: scale(1.15); }
}

.main-footer i.fa-heart {
    display: inline-block;
    animation: beat 0.4s infinite alternate;
}
