@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Jersey+10&display=swap');

/* Modern Glass Theme */
:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-backdrop: blur(10px);
    --primary-color: #4f46e5;
    --secondary-color: #6366f1;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Jersey 10", sans-serif;
}

body, *:not(i):not([class^="fa"]):not([class*=" fa-"]) {
    font-family: 'Cairo', 'Jersey 10', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

body {
    background: url('background.gif') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: #fff;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Containers - Unified Design */
.containers {
    background: var(--glass-bg);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 500px;
    width: 90%;
    animation: fadeIn 0.5s ease-in-out;
    color: #fff;
}

.containers h2 {
    color: #fff;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

/* Form Field Styles */
.login-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.login-field label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.login-field input {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.login-field input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Button Styles */
#btn {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

#btn:hover {
    background: #45a049;
}

/* Link Styles */
.containers p {
    margin-top: 1rem;
    color: #666;
}

.containers a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.containers a:hover {
    text-decoration: underline;
}

/* Alert Styles */
.alert {
    border-radius: 5px;
    margin-bottom: 1rem;
    padding: 1rem;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Sound Control */
.sound {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sound i {
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.sound i:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Responsive Design */
@media (max-width: 480px) {
    .containers {
        margin: 1rem;
        padding: 1.5rem;
    }

    .containers h2 {
        font-size: 1.75rem;
    }

    .login-field input {
        padding: 10px 35px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.containers {
    animation: fadeIn 0.5s ease-in-out;
}

/* Icon Styles */
.login-field svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.password-toggle:hover {
    color: #333;
}

/* Form Validation Styles */
.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    text-align: left;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
}

.was-validated .form-control:valid {
    border-color: #198754;
}

/* Dashboard Styles */
.dashboard-container {
    width: 90%;
    max-width: 1400px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    margin: 2rem auto;
}

.admin-dashboard {
    background: rgba(248, 249, 250, 0.9);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* User Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.user-card-container {
    min-width: 350px;
    transition: transform 0.2s;
}

.user-card-container:hover {
    transform: translateY(-5px);
}

.user-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.user-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Form Elements in Dashboard */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.form-select, .form-control {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    font-size: 0.9rem;
}

.form-select:focus, .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn i {
    margin-right: 0.5rem;
}

/* Text Truncation */
.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 50rem;
    font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .dashboard-container {
        padding: 1.5rem;
    }
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .user-card-container {
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .user-card-container {
        min-width: 100%;
    }
    
    .dashboard-container {
        padding: 1rem;
        width: 95%;
    }
    
    .admin-dashboard {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .containers {
        width: 90vw;
        min-width: unset;
        padding: 20px;
    }
    
    .containers input {
        width: 100%;
    }
    
    .card-header, .card-body {
        padding: 0.75rem;
    }
    
    .dashboard-container {
        padding: 0.5rem;
    }
}

/* Sidebar Glassmorphism - No Gray/White, Responsive */
.sidebar {
    background: rgba(30, 30, 30, 0.05); /* شفافية شبه كاملة */
    box-shadow: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255,255,255,0.10);
    height: 100vh;
    position: fixed;
    width: 180px; /* تصغير العرض */
    z-index: 2000;
    transition: left 0.3s, background 0.3s, width 0.3s;
    left: 0;
    display: flex;
}

.sidebar .nav-link {
    color: #fff !important;
    font-weight: 600;
    border-radius: 8px;
    margin: 0.2rem 0;
    transition: background 0.2s, color 0.2s;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
    letter-spacing: 0.5px;
    background: transparent !important;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover,
.sidebar .nav-link:active {
    background: rgba(79, 70, 229, 0.18) !important; /* شفافية أعلى */
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    opacity: 0.7; /* شفافية عند التفاعل */
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2100;
    background: rgba(30,30,30,0.25);
    border: none;
    color: #fff;
    font-size: 2rem;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Responsive Sidebar */
@media (max-width: 992px) {
    .sidebar {
        left: -140px;
        width: 120px; /* عرض أصغر على الشاشات الصغيرة */
    }
    .sidebar.open {
        left: 0;
        width: 120px;
    }
    .sidebar-toggle {
        display: block;
    }
    body.sidebar-open {
        overflow: hidden;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(30,30,30,0.35);
        z-index: 1999;
        transition: opacity 0.3s;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}

/* Card Styles */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem;
}

/* Table Styles */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

.table th,
.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #e9ecef;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    transform: scale(1.02);
}

.btn-danger:active {
    background-color: #991b1b !important;
    border-color: #991b1b !important;
}

.btn-close {
    background-color: transparent !important;
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

/* Form Styles */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 4px;
}

/* Modal Styles */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
}

/* Animation Styles */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--glass-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Sound Control */
.sound-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.sound-control button {
    background-color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    height: 40px;
    width: 40px;
    transition: all 0.3s ease;
}

.sound-control button:hover {
    transform: scale(1.1);
}

/* Modern Search Bar */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-left: 3rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
}

/* Modern Table Design */
.table-container {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 2rem;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th,
.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid #e9ecef;
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
}

.table thead th {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    font-weight: 700;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(255,255,255,0.12) !important;
}

/* Modern Button Design */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Modern Form Design */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Modern Modal Design */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
}

/* Pagination Design */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination .page-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination .page-item:hover,
.pagination .page-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link {
    color: #fff; /* White text for links */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    transition: all 0.3s ease;
    margin: 0 2px; /* Add some space between buttons */
    border-radius: 8px !important; /* Rounded corners */
}

.pagination .page-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.pagination .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        margin: 1rem;
    }
    
    .search-input {
        font-size: 0.9rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
}

/* إصلاح مشكلة الخلفية الرمادية عند التفعيل أو الضغط */
.sidebar, .sidebar .nav-link, .sidebar .nav-link.active, .sidebar .nav-link:focus, .sidebar .nav-link:active {
    background: rgba(30, 30, 30, 0.08) !important; /* شفافية خفيفة دائماً */
    box-shadow: none !important;
}

/* إضافة قاعدة عامة لجعل جميع النصوص باللون الأبيض */
body, body * {
    color: #fff !important;
}

/* Glassmorphism for all cards, tables, and content boxes */
.card, .glass, .table, .modal-content, .dashboard-container, .admin-dashboard, .program-statistics, .recent-users, .expiring-subscriptions {
    background: rgba(20, 20, 30, 0.7) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.45) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1.5px solid rgba(255,255,255,0.22) !important;
}

/* Optional: Make table headers also glassy */
.table thead th {
    background: rgba(20, 20, 30, 0.85) !important;
    color: #fff !important;
    border-bottom: 2px solid rgba(255,255,255,0.22) !important;
    font-weight: bold;
}

/* تحسين وضوح الإدخالات */
input, select, textarea, button {
    color: #fff !important;
    background: rgba(30,30,40,0.85) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
}
input::placeholder, textarea::placeholder {
    color: #ccc !important;
    opacity: 1 !important;
}

/* الروابط */
a, .nav-link {
    color: #fff !important;
    text-decoration: underline dotted 1px rgba(255,255,255,0.3);
    transition: color 0.2s;
}
a:hover, .nav-link:hover {
    color: #00e6ff !important;
    text-decoration: underline solid 2px #00e6ff;
}

/* أزرار خاصة */
.btn, .btn-primary, .btn-danger, .btn-success, .btn-info, .btn-warning {
    color: #fff !important;
    border: none;
}

/* تباين أعلى للبطاقات */
.card-title, .card-header, .modal-title, h1, h2, h3, h4, h5, h6 {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* تظليل خفيف للصفوف */
.table tbody tr {
    background: rgba(30,30,40,0.45) !important;
}

/* تظليل أقوى للصف النشط أو عند التمرير */
.table tbody tr:hover, .table tbody tr.active {
    background: rgba(0,0,0,0.25) !important;
}

/* تحسين وضوح عناوين اللوحات */
.section-title, .panel-title, .list-title, .admins-list-title, .partners-list-title, .modal-title, .card-header, .card-title, h1, h2, h3, h4, h5, h6 {
    color: #fff !important;
    background: rgba(20, 20, 30, 0.45) !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
    border-radius: 12px;
    padding: 8px 18px;
    margin-bottom: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* إذا كان هناك div أو card خاص بالعناوين */
.admins-list, .partners-list, .panel-header, .list-header {
    background: rgba(20, 20, 30, 0.45) !important;
    border-radius: 14px !important;
    padding: 8px 18px;
    margin-bottom: 12px;
}

/* جعل لوحة عرض الأجهزة الحالية للمستخدم بنفس تصميم الزجاج الشفاف */
.modal-content, .modal-content .table, .modal-content .table-responsive {
    background: rgba(20, 20, 30, 0.7) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.45) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1.5px solid rgba(255,255,255,0.22) !important;
}

.modal-content .table thead th {
    background: rgba(20, 20, 30, 0.85) !important;
    color: #fff !important;
    border-bottom: 2px solid rgba(255,255,255,0.22) !important;
    font-weight: bold;
}

.modal-content .table tbody tr {
    background: rgba(30,30,40,0.45) !important;
}

.modal-content .table tbody tr:hover, .modal-content .table tbody tr.active {
    background: rgba(0,0,0,0.25) !important;
}

/* تحسين مظهر زر التفعيل والتعطيل */
.account-status-toggle {
    transform: scale(1.2);
    cursor: pointer;
}

.account-status-toggle:checked {
    background-color: #198754;
    border-color: #198754;
}

.account-status-toggle:not(:checked) {
    background-color: #dc3545;
    border-color: #dc3545;
}

.form-check-label i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.form-check-label i.fa-toggle-on {
    color: #198754 !important;
}

.form-check-label i.fa-toggle-off {
    color: #dc3545 !important;
}

/* تحسين مظهر حالة الحساب */
.fw-bold.text-success {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background-color: rgba(25, 135, 84, 0.1);
}

.fw-bold.text-danger {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background-color: rgba(220, 53, 69, 0.1);
}

/* تأثيرات حركية */
.account-status-toggle:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

.account-status-toggle:not(:checked):focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* تحسين مظهر البطاقة بناءً على حالة الحساب */
.user-card.active-account {
    border-left: 4px solid #198754;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.15);
}

.user-card.inactive-account {
    border-left: 4px solid #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
    opacity: 0.8;
}

.user-card.inactive-account:hover {
    opacity: 1;
}

/* تحسين مظهر البطاقة */
.user-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

.user-card .card-header .d-flex {
    gap: 0.5rem;
}

/* تأثيرات hover */
.account-status-toggle:hover {
    transform: scale(1.3);
}

.form-check-label i:hover {
    transform: scale(1.1);
}

/* مؤشر حالة الحساب */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.status-indicator i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.status-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* تحسين مظهر زر التفعيل والتعطيل */
.form-check.form-switch {
    display: flex;
    align-items: center;
    padding: 0;
}

/* تنسيق الزر الأساسي */
.form-check-input.account-status-toggle {
    width: 4rem;
    height: 2rem;
    margin: 0;
    cursor: pointer;
    border: none;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* حالة التعطيل (الافتراضية) - لون أحمر */
.form-check-input.account-status-toggle {
    background-color: #ef4444 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* حالة التفعيل - لون أخضر */
.form-check-input.account-status-toggle:checked {
    background-color: #22c55e !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* الدائرة المتحركة */
.form-check-input.account-status-toggle::before {
    content: '';
    position: absolute;
    width: 1.6rem;
    height: 1.6rem;
    background-color: white;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    left: 0.2rem;
}

/* حركة الدائرة عند التفعيل */
.form-check-input.account-status-toggle:checked::before {
    left: calc(100% - 1.8rem);
}

/* تأثيرات التحويم */
.form-check-input.account-status-toggle:hover {
    transform: scale(1.05);
}

/* تأثيرات التحويم حسب الحالة */
.form-check-input.account-status-toggle:checked:hover {
    background-color: #16a34a !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.form-check-input.account-status-toggle:not(:checked):hover {
    background-color: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* إزالة الحدود عند التركيز */
.form-check-input.account-status-toggle:focus {
    box-shadow: none;
    outline: none;
}

/* تنسيق البطاقة حسب الحالة */
.user-card.active-account {
    border-left: 4px solid #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.1);
}

.user-card.inactive-account {
    border-left: 4px solid #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
    opacity: 0.9;
}

.user-card.inactive-account:hover {
    opacity: 1;
}

/* تحسين تباين النصوص */
.card {
    color: #ffffff !important;
}

.card-body {
    color: #ffffff !important;
}

.modal-content {
    color: #ffffff !important;
    background: rgba(17, 25, 40, 0.95) !important;
}

.form-control {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.form-select {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.table {
    color: #ffffff !important;
}

.table thead th {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.table tbody td {
    color: #ffffff !important;
}

.modal-header, .modal-footer {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.modal-title {
    color: #ffffff !important;
}

/* تحسين قراءة النصوص في البطاقات */
.card-header h5 {
    color: #ffffff !important;
    font-weight: 600;
}

.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* تحسين ظهور التنبيهات */
.alert {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* تحسين ظهور الروابط */
a {
    color: #60a5fa !important;
    transition: color 0.3s ease;
}

a:hover {
    color: #93c5fd !important;
    text-decoration: none;
}

/* تحسين ظهور العناوين */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

/* تحسين ظهور البطاقات */
.glass {
    background: rgba(17, 25, 40, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.125) !important;
}

/* أزرار دائرية للأكشن */
.btn-action {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: background 0.2s, box-shadow 0.2s, color 0.2s, transform 0.2s;
    border: none;
    outline: none;
    margin: 0 2px;
}

.btn-action:active {
    transform: scale(0.96);
}

.btn-action.btn-enable {
    background: #22c55e;
    color: #fff;
}
.btn-action.btn-enable:hover {
    background: #16a34a;
    box-shadow: 0 4px 16px rgba(34,197,94,0.18);
}

.btn-action.btn-disable {
    background: #ef4444;
    color: #fff;
}
.btn-action.btn-disable:hover {
    background: #b91c1c;
    box-shadow: 0 4px 16px rgba(239,68,68,0.18);
}

.btn-action.btn-delete {
    background: #dc2626;
    color: #fff;
}
.btn-action.btn-delete:hover {
    background: #991b1b;
    box-shadow: 0 4px 16px rgba(220,38,38,0.18);
}

.btn-action.btn-close {
    background: #64748b;
    color: #fff;
}
.btn-action.btn-close:hover {
    background: #334155;
    box-shadow: 0 4px 16px rgba(100,116,139,0.18);
}

/* تحسين الجداول */
.table-glass {
    background: rgba(30, 41, 59, 0.85);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.13);
    overflow: hidden;
}
.table-glass th, .table-glass td {
    padding: 0.85rem 1.1rem;
    font-size: 1.05rem;
    vertical-align: middle;
}
.table-glass th {
    font-size: 1.12rem;
    font-weight: bold;
    color: #fff;
    background: rgba(30,41,59,0.95) !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
.table-glass tr {
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
}
.table-glass tr:last-child {
    border-bottom: none !important;
}
.table-glass tr:hover {
    background: rgba(34,197,94,0.10) !important;
}

/* تحسين النوافذ */
.modal-content {
    background: rgba(17, 25, 40, 0.92) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 32px 0 rgba(31,38,135,0.25) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
}
.modal-header {
    border-bottom: none !important;
    padding-bottom: 0.5rem !important;
}
.modal-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #fff !important;
}

/* Toggle Switch Button for devices */
.device-toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}
.device-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.device-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ef4444;
    border-radius: 24px;
    transition: background 0.3s;
}
.device-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.device-toggle-switch input:checked + .device-toggle-slider {
    background-color: #22c55e;
}
.device-toggle-switch input:checked + .device-toggle-slider:before {
    transform: translateX(24px);
}
.device-toggle-slider i {
    position: absolute;
    top: 3px;
    font-size: 16px;
    color: #fff;
    transition: color 0.3s;
}
.device-toggle-switch .icon-on {
    left: 8px;
    opacity: 0;
}
.device-toggle-switch .icon-off {
    right: 8px;
    opacity: 1;
}
.device-toggle-switch input:checked + .device-toggle-slider .icon-on {
    opacity: 1;
}
.device-toggle-switch input:checked + .device-toggle-slider .icon-off {
    opacity: 0;
}

/* تحسين النصوص والتباين في الجداول */
.table-glass th, .table-glass td {
    color: #fff !important;
    font-size: 1rem;
    font-weight: 500;
    background: transparent !important;
}
.table-glass th {
    background: rgba(30,41,59,0.85) !important;
    font-size: 1.05rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.table-glass tr:hover {
    background: rgba(34,197,94,0.10) !important;
}
.status-cell .badge {
    font-size: 0.95rem;
    padding: 0.4em 0.9em;
}

/* تحسين وضوح رقم الجهاز */
.device-serial {
    background: rgba(30,41,59,0.85);
    color: #fff !important;
    font-size: 1.08rem;
    font-weight: bold;
    border-radius: 8px;
    padding: 4px 14px;
    letter-spacing: 0.5px;
    display: inline-block;
    direction: ltr;
    white-space: nowrap;
    word-break: normal;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    max-width: 260px;
    overflow-x: auto;
}

/* سويتش تفعيل/تعطيل الحساب العصري */
.account-toggle-switch {
  display: inline-block;
  position: relative;
  width: 60px;
  height: 32px;
  vertical-align: middle;
}
.account-toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.account-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #e74c3c;
  border-radius: 32px;
  transition: background 0.3s;
}
.account-toggle-slider:before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  z-index: 2;
}
.account-toggle-slider .icon-on,
.account-toggle-slider .icon-off {
  position: absolute;
  top: 50%;
  font-size: 18px;
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
}
.account-toggle-slider .icon-on {
  left: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}
.account-toggle-slider .icon-off {
  right: 12px;
  color: #fff;
  opacity: 1;
  transition: opacity 0.3s;
}
.account-toggle-switch input[type="checkbox"]:checked + .account-toggle-slider {
  background: #27ae60;
}
.account-toggle-switch input[type="checkbox"]:checked + .account-toggle-slider:before {
  transform: translateX(28px);
}
.account-toggle-switch input[type="checkbox"]:checked + .account-toggle-slider .icon-on {
  opacity: 1;
}
.account-toggle-switch input[type="checkbox"]:checked + .account-toggle-slider .icon-off {
  opacity: 0;
}

/* إصلاح وضوح النص في القوائم المنسدلة */
select, .form-select {
  color: #fff !important;
  background: rgba(30,30,40,0.95) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
}
select:focus, .form-select:focus {
  color: #fff !important;
  background: rgba(30,30,40,1) !important;
  border-color: #4f46e5 !important;
}
option {
  color: #fff !important;
  background: #222 !important;
}
/* دعم متصفحات كروم/إيدج/سفاري */
select::-webkit-input-placeholder, .form-select::-webkit-input-placeholder {
  color: #fff !important;
}
select:-ms-input-placeholder, .form-select:-ms-input-placeholder {
  color: #fff !important;
}
select::placeholder, .form-select::placeholder {
  color: #fff !important;
}

/* إصلاح وضوح النص في نتائج البحث المنسدلة (autocomplete) */
.list-group-item, .list-group-item-action {
  color: #fff !important;
  background: #23243a !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}
.list-group-item-action:hover, .list-group-item-action:focus, .list-group-item.active {
  color: #fff !important;
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
}

/* New Stat Panels - Glassy */
.stat-panel-card {
    background: rgba(17, 25, 40, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 1.25rem;
    transition: all 0.3s ease-in-out;
    border-left-width: 5px;
    border-left-style: solid;
}

.stat-panel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.stat-panel-card .card-body {
    padding: 0; /* Remove default padding from card-body */
}

.stat-panel-card .text-content .text-xs {
    font-size: 0.9rem; /* Smaller title text */
    font-weight: 700 !important;
}

.stat-panel-card .text-content .text-xxs {
    font-size: 0.75rem;
    color: #858796 !important;
}

.stat-panel-card .text-content .h5 {
    font-size: 2rem; /* Larger number */
    font-family: 'Jersey 10', sans-serif !important; /* Force font */
}

.stat-panel-card .icon-container i {
    color: rgba(255, 255, 255, 0.5) !important; /* Icon color */
}

/* Border Colors */
.border-left-blue { border-left-color: #4e73df; }
.border-left-green { border-left-color: #1cc88a; }
.border-left-cyan { border-left-color: #36b9cc; }
.border-left-yellow { border-left-color: #f6c23e; }
.border-left-secondary { border-left-color: #858796; }
.border-left-red { border-left-color: #e74a3b; }
.border-left-purple { border-left-color: #6f42c1; }

/* Text Colors */
.text-blue { color: #4e73df !important; }
.text-green { color: #1cc88a !important; }
.text-cyan { color: #36b9cc !important; }
.text-yellow { color: #f6c23e !important; }
.text-secondary { color: #858796 !important; }
.text-red { color: #e74a3b !important; }
.text-purple { color: #6f42c1 !important; }

.text-gray-300 { color: #dddfeb !important; }
.text-gray-800 { color: #f8f9fa !important; } /* White text for numbers */