/* ==========================================================================
   🌟 Noor Academy SaaS Engine - Unified Master Stylesheet 🌟
   File: system/assets/css/dashboard_style.css
   يغذي: لوحة القيادة (Admin) + بوابة الدخول (Login) + بوابة الخروج (Logout)
   ========================================================================== */

[x-cloak] { 
    display: none !important; 
}

/* ==========================================================================
   1. المتغيرات اللونية الافتراضية (Multi-Tenant CSS Variables)
   ========================================================================== */
:root {
    --primary-color: #f5a623;
    --primary-hover: #d98b14;
    --primary-rgb: 245, 166, 35;
    --secondary-gold: #1eb6cc;
    --gold-rgb: 30, 182, 204;
    --bg-color: #0a1626;
    --bg-rgb: 10, 22, 38;
    --bg-dark: #050b14;
    --sidebar-color: #07101d;
    --card-color: #102238;
    --card-rgb: 16, 34, 56;
}

/* ==========================================================================
   2. الإعدادات العامة للخلفية والنصوص (Global Base & Typography)
   ========================================================================== */
body {
    background: radial-gradient(circle at 50% 0%, var(--card-color) 0%, var(--bg-color) 45%, var(--bg-dark) 100%) !important;
    color: #ffffff !important;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: 'Tajawal', sans-serif;
    transition: background 0.35s ease;
}

/* تفتيح النصوص الفرعية لضمان أعلى درجات التباين فوق الخلفيات الداكنة */
.text-slate-400, 
.text-slate-300, 
.text-gray-400 {
    color: #e2e8f0 !important;
}

/* الشبكة الهندسية الخلفية الناعمة */
.ambient-luxury-grid {
    background-image: 
        radial-gradient(rgba(var(--primary-rgb), 0.14) 1px, transparent 1px),
        radial-gradient(rgba(var(--gold-rgb), 0.10) 1px, transparent 1px);
    background-size: 32px 32px, 16px 16px;
    background-position: 0 0, 16px 16px;
}

/* حاضنة اللوجو المضيئة لإبراز شعارات الأكاديميات بوضوح فائق */
.noor-logo-showcase,
.noor-logo-pod {
    background: radial-gradient(circle, #ffffff 0%, #f1f5f9 75%, #e2e8f0 100%) !important;
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.35), 
                0 0 15px rgba(var(--gold-rgb), 0.25), 
                inset 0 0 12px rgba(255, 255, 255, 0.9) !important;
}

/* ==========================================================================
   3. كلاسات الهوية الديناميكية (Dynamic Brand Utility Classes)
   ========================================================================== */
.bg-brand-bg { background-color: var(--bg-color) !important; }
.bg-brand-bg\/80 { background-color: rgba(var(--bg-rgb), 0.88) !important; }
.bg-brand-bg\/90 { background-color: rgba(var(--bg-rgb), 0.95) !important; }
.bg-brand-card { background-color: var(--card-color) !important; }
.bg-brand-sidebar { background-color: var(--sidebar-color) !important; }
.bg-brand-dark { background-color: var(--bg-dark) !important; }

.text-brand-accent { color: var(--primary-color) !important; }
.text-brand-gold { color: var(--secondary-gold) !important; }
.text-brand-bg { color: var(--bg-dark) !important; }

.bg-brand-accent { background-color: var(--primary-color) !important; }
.bg-brand-accentHover { background-color: var(--primary-hover) !important; }
.bg-brand-accent\/10 { background-color: rgba(var(--primary-rgb), 0.12) !important; }
.bg-brand-accent\/15 { background-color: rgba(var(--primary-rgb), 0.18) !important; }
.bg-brand-accent\/20 { background-color: rgba(var(--primary-rgb), 0.24) !important; }

.border-brand-accent { border-color: var(--primary-color) !important; }
.border-brand-accentHover { border-color: var(--primary-hover) !important; }
.border-brand-accent\/10 { border-color: rgba(var(--primary-rgb), 0.12) !important; }
.border-brand-accent\/20 { border-color: rgba(var(--primary-rgb), 0.22) !important; }
.border-brand-accent\/25 { border-color: rgba(var(--primary-rgb), 0.28) !important; }
.border-brand-accent\/30 { border-color: rgba(var(--primary-rgb), 0.35) !important; }
.border-brand-accent\/35 { border-color: rgba(var(--primary-rgb), 0.38) !important; }
.border-brand-accent\/40 { border-color: rgba(var(--primary-rgb), 0.45) !important; }
.border-brand-accent\/45 { border-color: rgba(var(--primary-rgb), 0.48) !important; }
.border-brand-accent\/50 { border-color: rgba(var(--primary-rgb), 0.55) !important; }

.dynamic-primary-bg { background-color: var(--primary-color) !important; color: var(--bg-dark) !important; }
.dynamic-primary-text { color: var(--primary-color) !important; }
.dynamic-primary-border { border-color: var(--primary-color) !important; }

/* ==========================================================================
   4. البطاقات الزجاجية وحقول الإدخال الموحدة (Glassmorphism & Inputs)
   ========================================================================== */
.glass-panel, 
.glass-card {
    background: linear-gradient(145deg, rgba(var(--card-rgb), 0.92) 0%, rgba(var(--bg-rgb), 0.98) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--primary-rgb), 0.28) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 20px 45px rgba(var(--primary-rgb), 0.22);
}

.glass-input { 
    background-color: var(--bg-dark, #050b14) !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; 
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5) !important; 
    color: #ffffff !important; 
    transition: all 0.25s ease;
}

.glass-input:focus { 
    background-color: var(--sidebar-color, #07101d) !important; 
    border-color: var(--primary-color, #f5a623) !important; 
    box-shadow: 0 0 0 1px var(--primary-color, #f5a623), inset 0 2px 6px rgba(0, 0, 0, 0.5) !important; 
    outline: none !important;
}

/* حماية قوائم الاختيار وحقول التاريخ في الوضع الليلي */
.noor-dark-select,
select, 
input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark !important;
    background-color: var(--bg-dark, #050b14) !important;
    color: #ffffff !important;
}

.noor-dark-select option,
.noor-dark-select optgroup,
select option,
select optgroup {
    background-color: var(--bg-dark, #050b14) !important;
    color: #ffffff !important;
    font-weight: 700;
    padding: 10px;
}

/* ==========================================================================
   5. أشرطة التمرير الموحدة (Unified Scrollbars)
   ========================================================================== */
.premium-scroll { 
    scroll-behavior: smooth; 
}

::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar,
.premium-scroll::-webkit-scrollbar,
.tree-scroll::-webkit-scrollbar,
.modal-scroll::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
}

::-webkit-scrollbar-track,
.custom-scroll::-webkit-scrollbar-track,
.premium-scroll::-webkit-scrollbar-track,
.tree-scroll::-webkit-scrollbar-track,
.modal-scroll::-webkit-scrollbar-track { 
    background: var(--bg-dark, #050b14); 
    border-radius: 10px; 
}

::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb,
.premium-scroll::-webkit-scrollbar-thumb,
.tree-scroll::-webkit-scrollbar-thumb,
.modal-scroll::-webkit-scrollbar-thumb { 
    background: rgba(var(--primary-rgb, 245, 166, 35), 0.45); 
    border-radius: 10px; 
}

::-webkit-scrollbar-thumb:hover,
.custom-scroll::-webkit-scrollbar-thumb:hover,
.premium-scroll::-webkit-scrollbar-thumb:hover,
.premium-scroll:hover::-webkit-scrollbar-thumb,
.tree-scroll::-webkit-scrollbar-thumb:hover,
.modal-scroll::-webkit-scrollbar-thumb:hover { 
    background: var(--primary-color, #f5a623); 
}

.nav-no-scrollbar::-webkit-scrollbar,
.scrollbar-hide::-webkit-scrollbar { 
    display: none; 
}

.nav-no-scrollbar,
.scrollbar-hide { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

/* ==========================================================================
   6. مكونات خاصة (Tree Branches, Stories Ring, Print Invoice & Summernote)
   ========================================================================== */
.tree-branch { 
    position: relative; 
}
.tree-branch::before {
    content: ''; 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    right: 22px; 
    width: 2px;
    background: linear-gradient(to bottom, rgba(var(--primary-rgb), 0.55), rgba(var(--gold-rgb), 0.15)); 
    z-index: 0;
}
[dir="ltr"] .tree-branch::before { 
    right: auto; 
    left: 22px; 
}

.story-ring-active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-gold), var(--primary-color));
    box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.35);
}

@media print {
    body * { visibility: hidden; }
    #invoice-print-area, #invoice-print-area * { visibility: visible; }
    #invoice-print-area { 
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 100%; 
        min-height: 100vh;
        margin: 0 !important; 
        padding: 0 !important;
        background-color: #ffffff !important; 
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important; 
        border: none !important;
    }
    .print-hide { display: none !important; }
    @page { margin: 0; size: A4 portrait; }
}

.note-editor.note-frame { 
    border: 1px solid rgba(var(--primary-rgb, 245, 166, 35), 0.3) !important; 
    border-radius: 18px !important; 
    background: var(--bg-dark, #050b14) !important; 
    overflow: hidden; 
}
body:has(.note-editor.fullscreen) .glass-panel, 
body:has(.note-editor.fullscreen) [x-transition] { 
    transform: none !important; 
    backdrop-filter: none !important; 
    -webkit-backdrop-filter: none !important; 
    overflow: visible !important; 
}
.note-editor.note-frame.fullscreen { 
    position: fixed !important; 
    top: 0 !important; 
    left: 0 !important; 
    width: 100vw !important; 
    height: 100vh !important; 
    z-index: 9999999 !important; 
    background: var(--sidebar-color, #07101d) !important; 
    border-radius: 0 !important; 
    margin: 0 !important; 
}
.note-editor.fullscreen .note-editing-area { 
    height: calc(100vh - 60px) !important; 
    background: var(--bg-dark, #050b14) !important; 
}
.note-editor.fullscreen .note-editable { 
    height: 100% !important; 
    overflow-y: auto !important; 
}
.note-editor .note-toolbar { 
    background: var(--sidebar-color, #07101d) !important; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important; 
    padding: 12px !important; 
    border-radius: 18px 18px 0 0; 
}
.note-editor .note-editing-area .note-editable { 
    padding: 25px !important; 
    min-height: 350px; 
    font-size: 15px; 
    line-height: 1.8; 
    color: #ffffff !important; 
    background-color: var(--bg-dark, #050b14) !important; 
}
.note-editor .note-statusbar { 
    background: var(--sidebar-color, #07101d) !important; 
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important; 
    border-radius: 0 0 18px 18px; 
}
.note-btn { 
    background: rgba(255, 255, 255, 0.08) !important; 
    color: #ffffff !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; 
    border-radius: 8px !important; 
    margin: 2px !important; 
    transition: all 0.25s ease; 
}
.note-btn:hover { 
    background: var(--primary-color, #f5a623) !important; 
    color: #050b14 !important; 
    border-color: var(--primary-color, #f5a623) !important; 
    transform: translateY(-1px); 
}
.note-dropdown-menu { 
    background: var(--sidebar-color, #07101d) !important; 
    border: 1px solid rgba(var(--primary-rgb, 245, 166, 35), 0.35) !important; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.85) !important; 
    border-radius: 12px !important; 
    padding: 10px !important; 
    min-width: 180px; 
    z-index: 1000 !important; 
}
.note-dropdown-item, 
.note-dropdown-menu a { 
    color: #ffffff !important; 
    transition: all 0.2s; 
    display: block; 
    padding: 6px 10px; 
    border-radius: 6px; 
    font-weight: 700; 
}
.note-dropdown-item:hover, 
.note-dropdown-menu a:hover { 
    background: var(--primary-color, #f5a623) !important; 
    color: #050b14 !important; 
}

/* ==========================================================================
   7. أنماط بوابات المصادقة الموحدة عالية الأداء (Login & Logout - Zero Lag)
   ========================================================================== */
body.noor-auth-body {
    margin: 0 !important;
    min-height: 100dvh !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* حاوية الخلفية المعزولة لمنع أي تمدد أو مسافة زائدة أسفل الصفحة */
.auth-bg-stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: 0;
    contain: strict;
}

/* هالات إضاءة خفيفة جداً على كارت الشاشة بدون filter: blur ثقيل */
.auth-glow-top {
    position: absolute;
    top: -20%;
    right: -15%;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--gold-rgb, 30, 182, 204), 0.22) 0%, rgba(var(--gold-rgb, 30, 182, 204), 0.05) 45%, transparent 70%);
    will-change: transform;
}

.auth-glow-bottom {
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 42rem;
    height: 42rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-rgb, 245, 166, 35), 0.20) 0%, rgba(var(--primary-rgb, 245, 166, 35), 0.04) 45%, transparent 70%);
    will-change: transform;
}

/* الكارت الزجاجي لبوابتي الدخول والخروج (أداء فائق بدون لاج) */
.auth-card { 
    background: linear-gradient(160deg, rgba(var(--card-rgb, 16, 34, 56), 0.96) 0%, rgba(var(--bg-rgb, 10, 22, 38), 0.98) 65%, var(--bg-dark, #050b14) 100%);
    border: 1.5px solid rgba(var(--primary-rgb, 245, 166, 35), 0.38);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.12); 
    position: relative; 
    z-index: 10; 
    transform: translateZ(0);
}

.auth-card::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; right: 0; 
    height: 3px; 
    background: linear-gradient(90deg, transparent, var(--primary-color, #f5a623), var(--secondary-gold, #1eb6cc), var(--primary-color, #f5a623), transparent); 
    opacity: 0.95;
}

/* ==========================================================================
   8. الحركات والأنيميشن الشاملة (Animations & Keyframes)
   ========================================================================== */
@keyframes sweepBrandGradient {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}
.animate-sweep-gradient { 
    animation: sweepBrandGradient 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; 
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { 
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}

@keyframes scaleFadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.animate-card-in {
    animation: scaleFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes drift-up {
    0% { transform: translate3d(0, 100vh, 0) scale(0.6); opacity: 0; }
    20% { opacity: 0.65; }
    80% { opacity: 0.65; }
    100% { transform: translate3d(0, -15vh, 0) scale(1.2); opacity: 0; }
}
.particle { 
    position: absolute; 
    top: 0;
    background: var(--primary-color, #f5a623); 
    border-radius: 50%; 
    animation: drift-up linear infinite; 
    will-change: transform, opacity;
}

@keyframes wave { 
    0%, 100% { transform: rotate(0deg); } 
    25% { transform: rotate(-20deg); } 
    50% { transform: rotate(12deg); } 
    75% { transform: rotate(-10deg); } 
}
.animate-wave { 
    animation: wave 2s ease-in-out infinite; 
    display: inline-block; 
    transform-origin: 70% 70%; 
}