/* Google Fonts - Cairo for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #f8f9fa;
}

/* Header Navbar Styling */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.navbar-brand img {
    transition: transform 0.3s ease;
}
.navbar-brand:hover img {
    transform: scale(1.1);
}


/* --- [NEW] Notification Dropdown Styles --- */
.notification-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}
.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    white-space: normal;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item .small {
    line-height: 1.3;
}


/* Professional Card Styling */
.card {
    border-radius: .75rem;
    border: 1px solid #e9ecef; /* Lighter border */
}
.card-header {
    font-weight: 700;
}
.page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,.1) !important;
    transition: all 0.2s ease-in-out;
}


/* --- Admin Panel Specific Styles --- */
.admin-body {
    background-color: #f1f2f7;
}

.admin-sidebar {
    background-color: #212529;
    color: #fff;
    min-height: 100vh;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.7);
    padding: .75rem 1rem;
    transition: all .2s ease;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}
.admin-sidebar .nav-link .bi {
    margin-left: .5rem; /* for RTL */
    width: 1.2em;
}

.admin-sidebar .sidebar-heading {
    font-size: .75rem;
}

main.admin-main-content {
    transition: margin-right .5s;
}

/* Sidebar toggled state */
body.sb-sidenav-toggled #sidebarMenu {
    margin-right: -250px;
}
body.sb-sidenav-toggled main {
    margin-right: 0;
}

@media (min-width: 768px) {
    .admin-sidebar {
        transition: margin-right .5s;
    }
}


/* Expired account row */
.account-expired-danger, .account-expired-danger .alert-link {
    color: #fff !important;
}

/* --- [تطوير] - تصميم شريط التقدم الاحترافي --- */
.progress-wrapper .progress {
    height: 20px !important;
    background-color: #e9ecef;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    padding: 2px;
}

.progress-wrapper .progress-bar {
    border-radius: 8px;
    position: relative;
    color: #fff;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    transition: width 0.5s ease-in-out, background-color 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-wrapper .progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

/* تدرجات لونية مميزة */
.progress-wrapper .progress-bar.bg-success {
    background-color: #198754 !important;
    background-image: linear-gradient(to top, #28a745, #218838);
}
.progress-wrapper .progress-bar.bg-warning {
    background-color: #ffc107 !important;
    background-image: linear-gradient(to top, #ffca2c, #ffbb00);
}
.progress-wrapper .progress-bar.bg-danger {
    background-color: #dc3545 !important;
    background-image: linear-gradient(to top, #e14d5b, #c82333);
}

.progress-wrapper .progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 4px;
    color: #495057;
    transition: color 0.3s ease;
}

/* --- [تطوير] - تحسينات على صفحة إدارة الصفحة --- */
.manage-page-section .card {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: none;
}
.manage-page-section .card-header h5 {
    color: #343a40;
}

.account-item {
    border: 1px solid #e9ecef;
    border-radius: .75rem !important;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    background-color: #fff;
    padding: 1rem;
    transition: all 0.3s ease;
}

/* [جديد] - تصميم الحساب غير المفعل */
.account-item.is-inactive {
    background-color: #f8f9fa;
    opacity: 0.6;
}
.account-item.is-inactive .form-check-input {
    cursor: pointer;
}


.account-item.is-currently-active {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.2);
}

.account-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reduced gap */
    flex-grow: 1;
    min-width: 0; /* Prevents flexbox overflow */
}
.account-name-wrapper h6 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-account-indicator {
    color: var(--bs-success);
    font-size: 1.5rem;
    line-height: 1;
}

.account-expiry-progress, .account-limit-progress {
    height: 6px !important;
    width: 80px;
    flex-shrink: 0; /* Prevent shrinking */
}
.account-limit-progress .progress-bar {
     background-color: #0dcaf0 !important;
}


.account-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.account-info-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.account-info-section .bi {
    font-size: 1.5rem;
    opacity: 0.6;
}

/* [جديد] - إصلاح مشكلة تعديل المدخلات */
.account-controls .input-group {
    position: relative;
}
.editable-account-field {
    font-size: 0.85rem !important;
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
}
.editable-account-field:focus {
    background-color: #fff !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 2px var(--bs-primary-bg-subtle) !important;
}
.saving-indicator {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
}

