﻿/* ==========================================================================
   أولاً: المتغيرات الأساسية للمظهر العصري (CSS Variables)
   ========================================================================== */
:root {
    --primary-color: #4f46e5;
    --primary-light: rgba(79, 70, 229, 0.1);
    --success-color: #10b981;
    --success-light: #ecfdf5;
    --warning-color: #f59e0b;
    --warning-light: #fffbeb;
    --danger-color: #ef4444;
    --danger-light: #fef2f2;
    --dark-color: #1f2937;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   ثانياً: تنسيقات النماذج وبطاقات الـ Wizard والـ Auth
   ========================================================================== */
.auth-section {
    padding: 40px 15px;
}

.auth-card, .wizard-card {
    width: 100%;
    margin: auto;
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

@media (min-width: 576px) {
    .auth-card {
        padding: 40px;
        max-width: 550px;
    }

    .wizard-card {
        padding: 40px;
        max-width: 800px;
    }
}

.auth-header, .wizard-header {
    text-align: center;
    margin-bottom: 30px;
}

    .auth-header h2, .wizard-step-title {
        font-weight: 700;
        color: var(--dark-color);
        font-size: 1.5rem;
    }

@media (min-width: 768px) {
    .auth-header h2, .wizard-step-title {
        font-size: 1.85rem;
    }
}

.custom-input {
    height: 52px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 15px;
    padding: 10px 16px;
    transition: var(--transition-base);
}

    .custom-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px var(--primary-light);
        outline: none;
    }

.custom-submit-btn, .modern-btn {
    height: 52px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .custom-submit-btn:hover, .modern-btn:hover {
        transform: translateY(-1px);
    }

.text-danger {
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.input-validation-error {
    border-color: var(--danger-color) !important;
    background-color: #fffafb;
}

.custom-alert {
    border-radius: var(--radius-md);
    padding: 16px;
    border: none;
}

/* عناصر الإدخال الخاصة بالنوع (الجنس) */
.gender-group {
    display: flex;
    gap: 20px;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.symptoms-textarea {
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    resize: vertical;
    min-height: 150px;
    font-size: 15px;
    line-height: 1.7;
}

/* ==========================================================================
   ثالثاً: تصميم لوحة التحكم وبطاقات الحالات (الهاتف أولاً)
   ========================================================================== */
.dashboard-title {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1.6rem;
}

.add-case-btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* شبكة تحكم مرنة تعتمد على الموبايل كخطوة أولى */
.cases-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .cases-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* بطاقة الحالة المطورة */
.case-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

    .case-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
        border-color: rgba(79, 70, 229, 0.2);
    }

.case-title {
    font-size: 1.15rem;
    color: var(--dark-color);
}

.case-number {
    font-size: 13px;
}

/* أوسمة الحالات الذكية وديناميكية الألوان */
.status-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f3f4f6;
    color: #4b5563;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #9ca3af;
}

/* التلوين التلقائي حسب المعرف الخاص بالحالة */
.status-badge.status-id-1, .status-badge.status-id-6 {
    background-color: var(--warning-light);
    color: #b45309;
}

    .status-badge.status-id-1 .status-dot, .status-badge.status-id-6 .status-dot {
        background-color: var(--warning-color);
    }

.status-badge.status-id-2 {
    background-color: var(--primary-light);
    color: black;
}

    .status-badge.status-id-2 .status-dot {
        background-color: var(--primary-color);
    }

.status-badge.status-id-3 {
    background-color: var(--success-light);
    color: #047857;
}

    .status-badge.status-id-3 .status-dot {
        background-color: var(--success-color);
    }

/* أشرطة التحميل الحديثة */
.modern-progress {
    height: 8px;
    border-radius: 10px;
    background-color: #f3f4f6;
    overflow: hidden;
}

    .modern-progress .progress-bar {
        background: linear-gradient(90deg, #34d399, var(--success-color));
        border-radius: 10px;
    }

/* تنسيق الملاحظات المرتجعة من التدقيق */
.review-notes {
    background-color: var(--warning-light);
    border-radius: var(--radius-md);
    border-right: 4px solid var(--warning-color);
    color: #92400e;
}

/* شاشات خلو البيانات (Empty state) */
.empty-cases {
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.empty-icon-wrapper {
    width: 70px;
    height: 70px;
    background-color: var(--light-bg);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #9ca3af;
}

.max-w-400 {
    max-width: 400px;
}

/* بطاقة الإعلانات والتنبيهات */
.announcement-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.announcement-title {
    color: var(--dark-color);
    font-size: 15px;
}
/* ==========================================================================
   إضافات خاصة بصفحة مراجعة البيانات والتدرجات الخضراء الحديثة
   ========================================================================== */

/* التدرج الأخضر المشرق اللطيف */
.btn-gradient-success {
    background: linear-gradient(135deg, #52c28d, #2fa369);
    border: none;
    color: green;
    transition: var(--transition-base);
}

    .btn-gradient-success:hover {
        background: linear-gradient(135deg, #5ed49d, #34b375);
        color: white;
        box-shadow: 0 6px 20px rgba(47, 163, 105, 0.3);
        transform: translateY(-1px);
    }

/* شبكة مراجعة البيانات المرنة المتجاوبة بالكامل */
.review-info-grid {
    display: grid;
    grid-template-columns: 1fr; /* عمود واحد للموبايل لعدم تداخل الحروف والأسماء طويلة */
    gap: 12px;
}

@media (min-width: 576px) {
    .review-info-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين للشاشات متوسطة الحجم تابلت */
    }
}

@media (min-width: 992px) {
    .review-info-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 أعمدة منسقة تماماً للديسك توب واللاب توب */
    }
}

/* تحسين عناصر المراجعة الفردية */
.info-field {
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.field-label {
    font-size: 12px;
    letter-spacing: 0.3px;
}

.field-value {
    font-size: 15px;
}

/* صندوق استعراض النص للأعراض */
.symptoms-preview-box {
    background-color: #fcfdfe !important;
    border: 1px solid var(--border-color);
}

.fs-15 {
    font-size: 15px;
}

/* تجميل صفوف الملفات المرفوعة */
.uploaded-file-row {
    transition: var(--transition-base);
}

    .uploaded-file-row:hover {
        border-color: #52c28d !important;
        background-color: rgba(82, 194, 141, 0.02) !important;
    }

.bg-success-light {
    background-color: #ecfdf5 !important;
}

.p-2\.5 {
    padding: 10px !important;
}

/* تكييف الترويسة للكتل */
.edit-section-btn {
    font-size: 13px !important;
    font-weight: 600;
}
/* ==========================================================================
   تنسيقات ترويسة معالج الخطوات الحديث (Wizard Header)
   ========================================================================== */

.wizard-step-title {
    font-size: 1.4rem;
    letter-spacing: -0.3px;
}

@media (min-width: 576px) {
    .wizard-step-title {
        font-size: 1.65rem;
    }
}

/* خلفية النسبة المئوية اللطيفة */
.bg-gradient-success-light {
    background: linear-gradient(135deg, rgba(82, 194, 141, 0.08), rgba(47, 163, 105, 0.12));
    border: 1px solid rgba(82, 194, 141, 0.15);
}

.wizard-progress-badge {
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

/* شريط التقدم الهيكلي والمعدل */
.wizard-modern-progress {
    height: 10px;
    border-radius: 50px;
    background-color: #f1f5f9 !important; /* خلفية رمادية ناعمة مريحة للعين */
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

    /* تطبيق التدرج الأخضر المشرق والأنيميشن الانسيابي */
    .wizard-modern-progress .progress-bar {
        background: linear-gradient(90deg, #52c28d, #2fa369) !important;
        border-radius: 50px;
        transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

/* إضافة تأثير حركة نبضية خفيفة للشريط لإضفاء طابع تفاعلي */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position-x: 1rem;
    }
}
/* ==========================================================================
   بطاقات الاختيار التفاعلية المخصصة (Custom Selection Cards)
   ========================================================================== */
/* ==========================================================================
   بطاقات الاختيار التفاعلية المخصصة (المطورة للتمييز البصري)
   ========================================================================== */

.custom-selection-grid {
    display: flex;
    gap: 16px;
    width: 100%;
}

.selection-card-wrapper {
    flex: 1;
    cursor: pointer;
    position: relative;
    display: block;
}

    /* المظهر الافتراضي للبطاقة (غير النشطة - الرمادية) */
    .selection-card-wrapper .selection-card {
        background-color: #f8fafc !important; /* خلفية رمادية باهتة */
        border: 2px solid #e2e8f0 !important; /* حواف رمادية */
        color: #64748b !important; /* نص رمادي */
        border-radius: 16px;
        padding: 20px 15px;
        transition: all 0.2s ease-in-out;
        position: relative;
    }

        .selection-card-wrapper .selection-card .icon-box i {
            color: #94a3b8 !important;
        }

    /* تأثير التمرير (Hover) فوق البطاقة غير النشطة */
    .selection-card-wrapper:hover .selection-card {
        border-color: #cbd5e1 !important;
        background-color: #f1f5f9 !important;
    }

    /* ==========================================================================
   الحالة النشطة: عندما يتم اختيار زر الراديو (المحدد - الأخضر)
   ========================================================================== */

    /* 1. تغيير ألوان البطاقة بالكامل وإبراز الحواف */
    .selection-card-wrapper input[type="radio"]:checked ~ .selection-card {
        border-color: #52c28d !important; /* حواف خضراء واضحة */
        background: linear-gradient(135deg, rgba(82, 194, 141, 0.06), rgba(47, 163, 105, 0.1)) !important; /* تدرج أخضر ناعم */
        color: #1e6b42 !important; /* نص أخضر غامق مقروء */
        box-shadow: 0 8px 20px rgba(47, 163, 105, 0.12) !important; /* ظل يعطي عمقاً */
    }

        /* 2. تغيير لون الأيقونة وتكبيرها داخل البطاقة المحددة */
        .selection-card-wrapper input[type="radio"]:checked ~ .selection-card .icon-box i {
            color: #2fa369 !important;
            transform: scale(1.15);
        }

    /* 3. إضافة علامة "صح" خضراء ديناميكية واضحة في زاوية البطاقة المحددة */
    .selection-card-wrapper .selection-card::after {
        content: "\F272"; /* كود أيقونة الصح من Bootstrap Icons */
        font-family: "bootstrap-icons" !important;
        position: absolute;
        top: 12px;
        left: 12px; /* ستظهر في أعلى اليسار في البيئة العربية */
        font-size: 20px;
        color: #2fa369;
        opacity: 0; /* مخفية في الحالة العادية */
        transform: scale(0);
        transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* إظهار علامة الصح فور تفعيل البطاقة */
    .selection-card-wrapper input[type="radio"]:checked ~ .selection-card::after {
        opacity: 1;
        transform: scale(1);
    }
/* ==========================================================================
   تنسيقات حقول الإدخال القياسية والحديثة (FamilyInfo Input Styles)
   ========================================================================== */

.custom-input {
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background-color: #f8fafc !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    color: #334155 !important;
    transition: all 0.25s ease-in-out !important;
}

    /* تأثير التنشيط (Focus) وتوهج الحواف باللون الأخضر المشرق */
    .custom-input:focus {
        background-color: #ffffff !important;
        border-color: #52c28d !important;
        box-shadow: 0 0 0 4px rgba(82, 194, 141, 0.1) !important;
        outline: none !important;
    }

    /* تعديل مظهر النصوص المساعدة المؤقتة */
    .custom-input::placeholder {
        color: #94a3b8 !important;
        font-size: 14px;
    }

/* حماية اتجاه كتابة رقم الهاتف لتبدأ من اليسار دائماً */
.text-start {
    text-align: left !important;
    direction: ltr !important;
}
/* ==========================================================================
   تحسينات التدرج اللوني وأدوات Kendo UI
   ========================================================================== */

/* الزر الأخضر المتدرج المشرق */
.btn-gradient-success {
    background: linear-gradient(135deg, #52c28d, #2fa369) !important;
    border: none !important;
    color: white !important;
}

.btn-gradient-success:hover {
    background: linear-gradient(135deg, #5ed49d, #34b375) !important;
    box-shadow: 0 6px 15px rgba(47, 163, 105, 0.25) !important;
    transform: translateY(-1px);
}

/* بطاقات اختيار النوع (Gender Cards) */
.custom-selection-grid {
    display: flex;
    gap: 15px;
}

.selection-card {
    background-color: #f8fafc !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.selection-card.active-card {
    border-color: #52c28d !important;
    background: linear-gradient(135deg, rgba(82, 194, 141, 0.05), rgba(47, 163, 105, 0.1)) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

/* إخفاء الراديو الأصلي */
.visual-hidden-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* علامة الصح للبطاقة النشطة */
.selection-card.active-card::after {
    content: "\F272";
    font-family: "bootstrap-icons";
    position: absolute;
    top: 10px;
    left: 10px;
    color: #2fa369;
    font-size: 18px;
}

/* تحسين Kendo DatePicker */
.k-datepicker .k-input-inner, 
.k-dropdownlist .k-input-inner {
    padding: 10px 15px !important;
    font-family: 'Cairo', sans-serif !important;
}

.k-picker, .k-dropdownlist {
    border-radius: 12px !important;
    border: 2px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
}

.k-state-focused, .k-focus {
    border-color: #52c28d !important;
    box-shadow: 0 0 0 3px rgba(82, 194, 141, 0.1) !important;
}
/* ==========================================================================
   تصميم شريط التنقل العلوي (Modern Navbar)
   ========================================================================== */

/* التدرج اللوني الموحد لشريط التنقل */
.navbar-custom-gradient {
    background: linear-gradient(135deg, #52c28d 0%, #2fa369 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* تنسيق الروابط العادية وحركة التمرير (Hover) */
.custom-nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .custom-nav-link:hover,
    .custom-nav-link.active {
        color: #ffffff !important;
        background-color: rgba(255, 255, 255, 0.15); /* خلفية شفافة عند التمرير */
        transform: translateY(-1px);
    }

/* تنسيق زر تسجيل الخروج الخاص */
.logout-btn {
    transition: all 0.3s ease;
}

    .logout-btn:hover {
        background-color: #f8fafc !important; /* لون رمادي فاتح جداً */
        color: #1e6b42 !important; /* أخضر داكن للنص */
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }
.uploaded-files {
    margin-bottom: 25px;
}

.uploaded-file-item {
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* تحسين شكل القائمة المنسدلة في الجوال */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.05);
        border-radius: 12px;
        padding: 10px;
        margin-top: 10px;
    }

    .logout-btn {
        width: 100%;
        justify-content: center;
    }
    
        .attachment-item {
            flex-direction: column;
            align-items: flex-start;
        }

        .attachment-actions {
            width: 100%;
        }
    
}
.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
}

.attachment-name {
    display: flex;
    align-items: center;
    word-break: break-word;
}

.attachment-actions {
    display: flex;
    gap: 8px;
}
