
/* CLEAN PROFESSIONAL ARABIC TYPOGRAPHY (RESTORED ORIGINAL FONTS) */
body, html, input, select, textarea, button, table, td, th, h1, h2, h3, h4, h5, h6, label, p, a, code {
  font-family: 'CoconNextArabic', 'DG3asomy', 'RHZak', 'Vexa', 'Cairo', sans-serif !important;
}

div:not([class*="fa"]):not([class*="fa-"]),
span:not([class*="fa"]):not([class*="fa-"]) {
  font-family: 'CoconNextArabic', 'DG3asomy', 'RHZak', 'Vexa', 'Cairo', sans-serif;
}

/* 100% BULLETPROOF PROTECTION FOR FONT AWESOME ICONS & PSEUDO-ELEMENTS */
i, i *, i::before, i::after,
.fa, .fa *, .fa::before, .fa::after,
.fas, .fas *, .fas::before, .fas::after,
.far, .far *, .far::before, .far::after,
.fab, .fab *, .fab::before, .fab::after,
[class^="fa-"], [class*=" fa-"],
[class^="fa-"]::before, [class*=" fa-"]::before,
[class^="fa-"]::after, [class*=" fa-"]::after {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-style: normal !important;
}

.fab, .fab *, .fab::before, .fab::after {
  font-family: "Font Awesome 6 Brands" !important;
}



:root {
    --primary-color: #4f46e5;
    --secondary-color: #0f172a;
    --accent-color: #d4af37;
    --bg-light: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --sidebar-width: 250px;
    --transition-speed: 0.3s;
    --sidebar-bg: #ffffff;
    --sidebar-text: #1e293b;
    --sidebar-header-border: rgba(0, 0, 0, 0.05);
    --sidebar-link-text: #475569;
    --sidebar-link-active-text: #ffffff;
}

[data-bs-theme="dark"] {
    --primary-color: #6366f1;
    --secondary-color: #0f172a;
    --bg-light: #111827;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-text: #ffffff;
    --sidebar-header-border: rgba(255, 255, 255, 0.05);
    --sidebar-link-text: #94a3b8;
    --sidebar-link-active-text: #ffffff;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    border-radius: 8px;
}

.btn-primary:hover {
    background-color: #4338ca;
    border-color: #4338ca;
    color: #fff;
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    border-radius: 8px;
}

.btn-accent:hover {
    background-color: #bfa033;
    color: #fff;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    overflow-x: hidden;
    transition: all var(--transition-speed);
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
/* #sidebar width handled by index.css */

/* #sidebar.collapsed handled by index.css */

#sidebar .sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--sidebar-header-border);
}

#sidebar ul.components {
    padding: 20px 15px;
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    color: var(--sidebar-link-text);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
}

#sidebar ul li a:hover,
#sidebar ul li.active>a {
    color: var(--sidebar-link-active-text);
    background: var(--primary-color);
}

#sidebar ul li a i {
    margin-left: 15px;
    width: 20px;
    text-align: center;
}

/* Fixed sidebar footer for logout */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--sidebar-header-border);
    background: var(--sidebar-bg);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 1.05em;
    color: #dc3545;
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.sidebar-footer a:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.sidebar-footer a i {
    margin-left: 15px;
    width: 20px;
    text-align: center;
}

/* Mobile Sidebar off-canvas styling */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-speed) ease-in-out;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* Content */
#content {
    width: 100%;
    padding: 20px 30px 0;
    transition: all var(--transition-speed) ease-in-out;
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#contentMain {
    flex: 1 0 auto;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] #content {
    background-color: var(--bg-light);
    color: var(--text-color);
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #334155;
    --bs-table-color: #f8fafc;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

[data-bs-theme="dark"] .btn-light {
    background-color: #334155;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

[data-bs-theme="dark"] #chatMessages {
    background-color: #0f172a !important;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .card {
    border-color: rgba(255, 255, 255, 0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Navbar */
.top-navbar {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .top-navbar {
    border-color: rgba(255, 255, 255, 0.05);
}

.fade-in {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

.profile-upload-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translate(-15%, 15%);
}

.profile-remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    background: #dc3545;
    color: #fff;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translate(15%, -15%);
    z-index: 2;
}

.profile-remove-btn:hover {
    background: #bb2d3b;
}

.custom-footer {
    background-color: #1e293b;
    color: #ffffff;
    position: relative;
    width: 100%;
    z-index: 10;
}

.dashboard-footer {
    flex-shrink: 0;
    margin-top: auto;
    margin-left: -30px;
    margin-right: -30px;
    margin-bottom: 0;
    width: calc(100% + 60px);
}

.auth-footer {
    position: relative;
    margin-top: auto;
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
}

.footer-top-strip {
    background-color: #f1b32b;
    height: 5px;
    width: 100%;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    position: relative;
    min-height: 50px;
}

.footer-logo {
    position: absolute;
    left: 30px;
    top: -35px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.footer-text {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 160px);
}

.chat-channel-item {
    color: var(--primary-color) !important;
}

.chat-channel-item.active {
    color: #ffffff !important;
    background-color: var(--primary-color) !important;
}

@media (max-width: 768px), (max-height: 576px) {
    .footer-logo {
        left: 10px;
        width: 60px;
        height: 60px;
        top: -25px;
    }

    .footer-text {
        font-size: 0.8rem;
        padding: 0;
        width: calc(100% - 140px);
    }
}

@media (max-width: 768px), (max-height: 576px) {
    /* #sidebar width handled by index.css */
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 10px auto;
    }
    
    /* Footer */
    .dashboard-footer {
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }
    
    .footer-logo {
        left: 8px;
        width: 50px;
        height: 50px;
        top: -20px;
    }
    
    .footer-text {
        font-size: 0.75rem;
        width: calc(100% - 120px);
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    #sidebar {
        right: -260px;
        width: 260px;
    }
    
    .avatar-display-sidebar {
        width: 60px !important;
        height: 60px !important;
    }
    
    .servant-name-sidebar {
        font-size: 0.95rem !important;
    }
    
    .osra-name-sidebar {
        font-size: 0.8rem !important;
    }
    
    .top-navbar {
        padding: 10px 12px;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th {
        padding: 6px 2px;
        font-size: 0.7rem;
    }
    
    .table tbody td {
        padding: 6px 2px;
        font-size: 0.75rem;
    }
    
    .btn-circle-40 {
        width: 32px !important;
        height: 32px !important;
    }
    
    .form-control,
    .form-select {
        font-size: 0.85rem;
        padding: 5px 6px;
    }
}

@media (max-height: 600px) {
    /* Short screens */
    #sidebar .sidebar-header {
        padding: 15px 12px;
    }
    
    #sidebar ul.components {
        padding: 10px 8px;
    }
    
    #sidebar ul li a {
        padding: 8px 12px;
        font-size: 0.9em;
        margin-bottom: 3px;
    }
    
    .top-navbar {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    
    #content {
        padding: 10px 10px 0 !important;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    #sidebar .sidebar-header {
        padding: 10px 12px;
    }
    
    .avatar-display-sidebar {
        width: 50px !important;
        height: 50px !important;
    }
    
    .servant-name-sidebar {
        font-size: 0.9rem !important;
        margin-top: 5px !important;
    }
    
    .osra-name-sidebar {
        font-size: 0.75rem !important;
    }
    
    #sidebar ul li a {
        padding: 6px 12px;
        font-size: 0.85em;
        margin-bottom: 2px;
    }
    
    .top-navbar {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    
    #content {
        padding: 8px 8px 0 !important;
    }
}

[data-bs-theme="dark"] .received-chat-bubble {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .received-chat-bubble .text-muted {
    color: #cbd5e1 !important;
}

