/* assets/css/style.css — نظام التصميم الموحد والفاخر لمنصة UHBM */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #d32f2f 0%, #8e0000 100%);
    --bg-gradient: linear-gradient(135deg, #fdf8f8 0%, #f5e4e4 100%);
    --dark-bg: #2b0b0b;
    --dark-panel: rgba(43, 11, 11, 0.9);
    --glass-panel: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(211, 47, 47, 0.2);
    --text-primary: #3c1515;
    --text-muted: #9e7a7a;
    --accent-color: #d32f2f;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #d32f2f;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    margin: 0;
    overflow-x: hidden;
}

/* تخطيط الصفحة الرئيسي */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* الشريط الجانبي الفاخر */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-bg);
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    position: fixed;
    height: 100vh;
    right: 0;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    padding: 24px;
    font-size: 1.4rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar Menu to match premium styling */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 4px solid transparent;
}

.sidebar-menu li a:hover, .sidebar-menu li.active a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-right-color: #d32f2f;
}

.sidebar-menu li a i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

/* محتوى التطبيق الرئيسي */
.main-content {
    margin-right: var(--sidebar-width);
    flex-grow: 1;
    padding: 40px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
}

/* لوحات زجاجية بلورية (Glassmorphism Cards) */
.glass-card {
    background: var(--glass-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.06);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.12);
}

.card-title {
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

/* ترويسة لوحة التحكم */
.page-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-weight: 700;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* إحصائيات سريعة (Stats Widget) */
.stat-card {
    border-radius: 16px;
    padding: 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.stat-card:hover {
    transform: scale(1.03);
}

.stat-card.primary { background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); }
.stat-card.success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.stat-card.warning { background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%); }
.stat-card.danger { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
}

.stat-icon {
    font-size: 2.8rem;
    opacity: 0.35;
}

/* الجداول الحديثة والسلسة */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--glass-border);
}

.table-custom {
    margin-bottom: 0;
    background: transparent;
}

.table-custom th {
    background: rgba(0, 0, 0, 0.03) !important;
    font-weight: 700;
    padding: 16px 20px;
    border-bottom: 2px solid rgba(0,0,0,0.06) !important;
}

.table-custom td {
    padding: 14px 20px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.table-custom tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.45);
}

/* أزرار مخصصة (Custom Buttons) */
.btn-primary-custom {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.4);
    opacity: 0.95;
    color: white;
}

/* النماذج الفاخرة (Forms) */
.form-control-custom {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.15);
    border-color: #2575fc;
    outline: none;
}

/* التسميات وحالة البطاقات (Badges) */
.badge-custom {
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* شاشة تسجيل الدخول */
.login-bg {
    background: linear-gradient(135deg, #2b0b0b 0%, #d32f2f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-glass-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    color: #ffffff;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.login-glass-card .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.login-glass-card .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #2575fc;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.25);
}

.login-glass-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* تبديل واجهات تسجيل الدخول */
.login-tabs {
    display: flex;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
}

.login-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-tab-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* الهواتف والشاشات الصغيرة */
@media (max-width: 991.98px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .sidebar.show {
        width: var(--sidebar-width);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 20px;
    }
}

/* Custom List Group Item styling for dark overlays and autocompletes */
.list-group-item-dark-custom {
    background-color: #2c3e50 !important;
    border-color: #34495e !important;
    color: #ffffff !important;
}
.list-group-item-dark-custom:hover, 
.list-group-item-dark-custom:focus, 
.list-group-item-dark-custom.active {
    background-color: #34495e !important;
    color: #ffffff !important;
}

/* شاشات الجوال الصغيرة جداً */
@media (max-width: 575.98px) {
    .main-content {
        padding: 15px 10px !important;
    }
    .glass-card {
        padding: 15px !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
    }
    .page-title {
        font-size: 1.35rem !important;
    }
    .table th, .table td {
        padding: 8px 5px !important;
        font-size: 0.85rem !important;
    }
    .btn {
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* ==========================================
   LTR Layout Styles (for English & French)
   ========================================== */
html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
}

html[dir="ltr"] .sidebar-menu li a {
    border-right: none;
    border-left: 4px solid transparent;
}

html[dir="ltr"] .sidebar-menu li a:hover, 
html[dir="ltr"] .sidebar-menu li.active a {
    border-left-color: #2575fc;
    border-right-color: transparent;
}

html[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
}

@media (max-width: 991.98px) {
    html[dir="ltr"] .main-content {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ==========================================
   Dark Mode Theme Overrides (الوضع الليلي)
   ========================================== */
body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #150909 0%, #200d0d 100%);
    --dark-bg: #100505;
    --dark-panel: rgba(16, 5, 5, 0.95);
    --glass-panel: rgba(36, 19, 19, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f9f1f1;
    --text-muted: #b89494;
}

body.dark-mode .module-title {
    color: #ffffff !important;
}

body.dark-mode .text-dark {
    color: #ffffff !important;
}

body.dark-mode .form-label, 
body.dark-mode .form-text, 
body.dark-mode .text-muted,
body.dark-mode .text-muted-custom {
    color: #94a3b8 !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .form-control-custom {
    background-color: rgba(9, 7, 16, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus,
body.dark-mode .form-control-custom:focus {
    background-color: rgba(9, 7, 16, 0.8) !important;
    border-color: #2575fc !important;
    color: #ffffff !important;
}

body.dark-mode .table {
    color: #e2e8f0 !important;
}

body.dark-mode .table-light {
    --bs-table-bg: #1e1b2e !important;
    --bs-table-color: #ffffff !important;
}

body.dark-mode .table th, 
body.dark-mode .table td {
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .list-group-item {
    background-color: rgba(22, 19, 36, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

body.dark-mode .modal-content {
    background-color: #151222 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

body.dark-mode .alert-info {
    background-color: rgba(13, 202, 240, 0.1) !important;
    border-color: rgba(13, 202, 240, 0.2) !important;
    color: #0dcaf0 !important;
}


