﻿/* wwwroot/css/dashboard.css */

:root {
    /* YOUR BRAND COLOR (The Logo) */
    --brand-color: #385A70;
    /* Dark Theme Palette */
    --bg-body: #0F172A; /* Deep Dark Navy/Black (Premium Feel) */
    --bg-sidebar: #1E293B; /* Dark Slate for Sidebar */
    --bg-card: #1E293B; /* Matching Card Background */
    /* Text Colors */
    --text-main: #F1F5F9; /* Off-white for readability */
    --text-muted: #94A3B8; /* Muted blue-grey */
    /* Borders */
    --border-color: #334155;
    /* Accents */
    --accent-gold: #D4AF37; /* Luxury Gold (Optional touches) */
    --danger-red: #EF4444;
    /* Dimensions */
    --sidebar-width: 280px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
}

/* ===========================
   1. LAYOUT & SIDEBAR
   =========================== */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    border-left: 1px solid var(--border-color); /* Subtle border */
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}

    #sidebar .sidebar-header {
        padding: 25px;
        background: rgba(0,0,0,0.2);
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    /* Menu Items */
    #sidebar ul.components {
        padding: 15px 0;
    }

    #sidebar ul li a {
        padding: 15px 25px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--text-muted);
        text-decoration: none;
        transition: 0.3s;
        border-right: 3px solid transparent;
    }

        #sidebar ul li a:hover {
            color: #fff;
            background: rgba(255,255,255,0.05);
        }

    /* Active State - Uses your Brand Color */
    #sidebar ul li.active > a {
        color: #fff;
        background: linear-gradient(270deg, rgba(56, 90, 112, 0.2) 0%, transparent 100%);
        border-right: 3px solid var(--brand-color);
    }

        #sidebar ul li.active > a i {
            color: var(--brand-color); /* Color the icon */
        }

/* MAIN CONTENT */
#content {
    width: 100%;
    margin-right: var(--sidebar-width);
    padding: 30px;
    transition: all 0.3s;
}

/* ===========================
   2. CARDS (Glassmorphism Lite)
   =========================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    color: var(--text-main);
}

/* ===========================
   3. FORMS (Dark Mode)
   =========================== */
label {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-control, .form-select, .input-group-text {
    background-color: #0F172A; /* Darker than card */
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
}

    .form-control:focus, .form-select:focus {
        background-color: #0F172A;
        color: #fff;
        border-color: var(--brand-color);
        box-shadow: 0 0 0 2px rgba(56, 90, 112, 0.3); /* Your brand glow */
    }

    .form-control::placeholder {
        color: #475569;
    }

.input-group-text {
    background-color: var(--bg-sidebar);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* ===========================
   4. BUTTONS
   =========================== */
.btn-primary {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    padding: 10px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .btn-primary:hover {
        background-color: #2c4759; /* Darker shade of brand */
        border-color: #2c4759;
        box-shadow: 0 4px 12px rgba(56, 90, 112, 0.4);
        transform: translateY(-1px);
    }

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

    .btn-secondary:hover {
        background-color: var(--border-color);
        color: #fff;
    }

/* ===========================
   5. SELECT2 DARK THEME OVERRIDES (Suhur)
   =========================== */

/* 1. صندوق الاختيار الأساسي (يتطابق مع .form-control الخاص بك) */
.select2-container--bootstrap-5 .select2-selection {
    background-color: #0F172A !important; /* نفس لون حقول الإدخال لديك */
    border: 1px solid var(--border-color) !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 0.2rem 0.5rem;
}

/* 2. لون النص المختار */
.select2-container--bootstrap-5 .select2-selection__rendered {
    color: #fff !important;
}

/* 3. القائمة المنسدلة (عند الفتح) */
.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bg-card) !important; /* نفس لون الكارد */
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* 4. مربع البحث داخل القائمة */
.select2-container--bootstrap-5 .select2-search .select2-search__field {
    background-color: #0F172A !important;
    border: 1px solid var(--border-color) !important;
    color: #fff !important;
    border-radius: 6px !important;
}

    .select2-container--bootstrap-5 .select2-search .select2-search__field:focus {
        box-shadow: 0 0 0 2px rgba(56, 90, 112, 0.3) !important;
        border-color: var(--brand-color) !important;
    }

/* 5. الخيارات العادية (العطور المعروضة) */
.select2-container--bootstrap-5 .select2-results__option {
    color: var(--text-main) !important;
}

/* 6. عند تمرير الماوس (Hover) على خيار معين */
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand-color) !important; /* لون البراند الخاص بك */
    color: #fff !important;
}

/* 7. الخيار المحدد مسبقاً (Selected) */
.select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: rgba(56, 90, 112, 0.3) !important; /* ظل خفيف من لون البراند */
    color: #fff !important;
}

/* 8. تأثير الـ Focus (التوهج) للصندوق الخارجي */
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--brand-color) !important;
    box-shadow: 0 0 0 2px rgba(56, 90, 112, 0.3) !important;
}

/* 9. سهم القائمة المنسدلة */
.select2-container--bootstrap-5 .select2-selection__indicator {
    filter: invert(1); /* تحويل السهم الأسود إلى أبيض */
    opacity: 0.5;
}


/* ===========================
   6. SWEETALERT2 DARK THEME OVERRIDES
   =========================== */

/* خلفية النافذة المنبثقة (نفس لون الكارد لديك) */
.swal2-popup {
    width: 40em !important; /* 👈 السطر الجديد: تكبير عرض النافذة بالكامل لترتاح العين */
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    color: var(--text-main) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* عنوان النافذة */
.swal2-title {
    color: var(--text-main) !important;
}

/* حقول الإدخال داخل النافذة */
.swal2-input {
    width: 90% !important; /* 👈 السطر الجديد: إجبار الحقل على أخذ 90% من مساحة النافذة */
    max-width: 100% !important; /* 👈 السطر الجديد: إلغاء الحد الأقصى الافتراضي المزعج */
    margin: 1em auto !important; /* 👈 السطر الجديد: توسيط الحقل بشكل مثالي */

    background-color: #0F172A !important;
    border: 1px solid var(--border-color) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

    .swal2-input:focus {
        border-color: var(--brand-color) !important;
        box-shadow: 0 0 0 2px rgba(56, 90, 112, 0.3) !important;
    }

    .swal2-input::placeholder {
        color: #475569 !important;
    }

/* رسالة الخطأ في حالة الـ Validation */
.swal2-validation-message {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger-red) !important;
    border: 1px solid var(--danger-red) !important;
}

/* أزرار النافذة */
.swal2-confirm {
    background-color: var(--brand-color) !important;
    border-radius: 6px !important;
    padding: 10px 25px !important;
}

.swal2-cancel {
    background-color: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    border-radius: 6px !important;
}

    .swal2-cancel:hover {
        background-color: var(--border-color) !important;
        color: #fff !important;
    }


/* Table */
/* تحسين شكل عناوين الجداول */
.table thead th {
    text-align: center; /* لتوسط النص أفقياً */
    vertical-align: middle; /* لتوسط النص عمودياً */
    font-size: 0.95rem; /* حجم خط مناسب */
    /*background-color: rgba(0,0,0,0.25);  خلفية داكنة قليلاً للعنوان */
    /*color: var(--accent-gold); /* (اختياري) لون ذهبي للنص ليتماشى مع الفخامة، أو استخدم #fff للأبيض */
    border-bottom: 2px solid var(--border-color);
    padding: 15px; /* مسافة داخلية مريحة */
    white-space: nowrap; /* منع التفاف النص لسطرين */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-right: calc(var(--sidebar-width) * -1);
    }

        #sidebar.active {
            margin-right: 0;
        }

    #content {
        margin-right: 0;
    }
}
