/* ============= IMPORTS & FONT SETTINGS ============= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=fallback&text=ابتثجحخدذرزسشصضطظعغفقكلمنهوي٠١٢٣٤٥٦٧٨٩');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Fallback font loading strategy */
@font-face {
    font-family: 'Arabic Fallback';
    src: local('Arial');
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* ============= ROOT VARIABLES ============= */
:root {
    /* Define design system variables */
    --primary-color: #008080;
    --primary-dark: #00674b;
    --primary-color-rgb: 0, 128, 128;
    
    /* Theme colors - will be overridden by theme-specific variables */
    --background-color: #212121;
    --background-muted: #2d2d2d;
    --text-color: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --text-overflow: #f5f5f5;
    --border-color: #3d3d3d;
    --bg-light: #2a2a2a;
    --card-bg: #2d2d2d;
    --input-bg: #333333;
    --dropdown-bg: #2d2d2d;
    --box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    
    /* Non-theme specific colors */
    --primary-light: #008B8B;
    --secondary-color: #0f172a;
    --accent-color: hsl(0, 0%, 73%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.5rem;
    --transition: 0.3s ease;
    
    /* Navigation variables */
    --sidebar-width: 240px;
    --sidebar-transition: all 0.3s ease;
    --mobile-header-height: 60px;
    --mobile-footer-height: 60px;
    
    /* Font stack with fallbacks */
    --font-family-sans-serif: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-arabic: 'Noto Sans Arabic', 'Arial Unicode MS', system-ui, sans-serif;
    --theme-transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;

    /* Footer styling */
    --footer-bg: #212121;
    --footer-text: #ecf0f1;
    --footer-link: #008080;
    --footer-link-hover: #008080;
    --footer-divider: #7f8c8d;
    /* Button specific variables */
    --btn-primary-bg: var(--primary-color);
    --btn-primary-border: var(--primary-color);
    --btn-primary-color: var(--white);
    --btn-primary-hover-bg: var(--primary-dark);
    --btn-primary-hover-border: var(--primary-dark);
    --btn-primary-hover-color: var(--white);
    --btn-primary-active-bg: #005652;
    --btn-primary-active-border: #005652;
    --btn-primary-active-color: var(--white);
    --btn-primary-disabled-bg: rgba(0, 179, 167, 0.65);
    --btn-primary-disabled-border: rgba(0, 179, 167, 0.65);
    --btn-primary-disabled-color: var(--white);
    --btn-primary-shadow: 0 4px 6px -1px rgba(0, 179, 167, 0.2), 0 2px 4px -1px rgba(0, 179, 167, 0.1);
    --btn-transition: all 0.3s ease;
}

/* No transition on initial page load to prevent flash */
html:not(.fonts-loaded) {
    --theme-transition: none;
}

/* Dark theme (medium contrast) */
[data-theme="dark"] {
    --background-color: #292929;
    --background-color-rgb: 41, 41, 41;
    --background-muted: #383838;
    --text-color: #e0e0e0;
    --text-secondary: #e0e0e0;
    --text-muted: hsl(0, 0%, 62%);
    --text-overflow: #d0d0d0;
    --border-color: #4a4a4a;
    --bg-light: #333333;
    --card-bg: #383838;
    --accent-color: lab(36.15% 0 0);
    --input-bg: #404040;
    --dropdown-bg: #383838;
    --primary-light: hsl(164, 100%, 34%);
    --box-shadow: 0 5px 20px rgba(0,0,0,0.20);
    
    /* Notification item backgrounds */
    --notification-bg: #383838;
    --notification-hover: #444444;
    --notification-unread: #2d3c43;
    --notification-unread-hover: #34454c;
    
    /* Footer styling for dark theme */
    --footer-bg: #212121;
    --footer-text: #ecf0f1;
    --footer-link: #008080;
    --footer-link-hover: lab(63.96% -37.75 12.22);
    --footer-divider: #4a5a68;
}

/* Light theme (medium contrast) */
[data-theme="light"] {
    --background-color: #f5f5f5;
    --background-color-rgb: 255, 255, 255;
    --background-muted: #eaeaea;
    --text-color: #444444;
    --text-secondary: hwb(0 35% 65%);
    --text-muted: hsl(0, 0%, 59%);
    --text-overflow: #666666;
    --border-color: #cacaca;
    --accent-color: hwb(0 82% 17%);
    --bg-light: #efefef;
    --card-bg: #f9f9f9;
    --input-bg: lab(82.76% 0 -0.01);
    --dropdown-bg: #f8f8f8;
    --primary-light: #008080;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    
    /* Notification item backgrounds */
    --notification-bg: #f8f8f8;
    --notification-hover: #efefef;
    --notification-unread: #e9f0f1;
    --notification-unread-hover: #e0ebec;
    
    /* Footer styling for light theme */
    --footer-bg: #f8f9fa;
    --footer-text: #343a40;
    --footer-link: #008080;
    --footer-link-hover: #008080;
    --footer-divider: #6c757d;
}

/* ============= BASE STYLES ============= */
/* Base layout adjustments for sidebar */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.5;
    background-color: var(--background-color);
    color: var(--text-color);
    padding-top: 0 !important; /* Remove default navbar padding */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--theme-transition);
}

/* Main content positioning with sidebar */
.main-content-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    flex: 1;
    transition: var(--sidebar-transition);
}
/* RTL layout main-content-wrapper fixes */

/* Normal state (sidebar expanded) */
html[dir="rtl"] .main-content-wrapper {
    margin-left: 0 !important;
    margin-right: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    transition: var(--sidebar-transition);
}

/* Collapsed state (sidebar collapsed) */
html[dir="rtl"] .main-content-collapsed {
    margin-right: 70px !important;
    margin-left: 0 !important;
    width: calc(100% - 70px) !important;
}

/* Mobile view (sidebar hidden) */
@media (max-width: 991.98px) {
    html[dir="rtl"] .main-content-wrapper,
    html[dir="rtl"] .main-content-collapsed {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
}
/* ============= RTL SUPPORT ============= */
/* RTL-specific font settings */
html[dir="rtl"] body {
    font-family: var(--font-family-arabic), 'Arabic Fallback';
    line-height: 1.6; /* Better line height for Arabic */
}

/* Improve readability of Arabic text */
html[dir="rtl"] h1, 
html[dir="rtl"] h2, 
html[dir="rtl"] h3, 
html[dir="rtl"] h4, 
html[dir="rtl"] h5, 
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] button,
html[dir="rtl"] .btn,
html[dir="rtl"] .nav-link,
html[dir="rtl"] .dropdown-item {
    font-family: var(--font-family-arabic);
    letter-spacing: 0; /* Remove letter spacing for Arabic */
}

/* Fix for forms in RTL */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
    direction: rtl;
    font-family: var(--font-family-arabic);
}

/* Auto-direction for input fields */
input[type="text"],
textarea {
    unicode-bidi: plaintext;
}

/* Button Styles */
.btn-primary {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: var(--btn-primary-color);
    transition: var(--btn-transition);
    box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 179, 167, 0.25);
}

.btn-primary:active,
.btn-primary:focus {
    background-color: var(--btn-primary-active-bg) !important;
    border-color: var(--btn-primary-active-border) !important;
    color: var(--btn-primary-active-color);
    box-shadow: 0 2px 4px rgba(0, 179, 167, 0.15) !important;
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: var(--btn-primary-disabled-bg);
    border-color: var(--btn-primary-disabled-border);
    color: var(--btn-primary-disabled-color);
    opacity: 0.7;
}
/* Outline Primary Button Style */
.btn-outline-primary {
    color: var(--primary-color);
    background-color: transparent;
    border: 1px solid var(--primary-color);
    font-weight: 500;
    transition: var(--btn-transition);
    box-shadow: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-outline-primary:hover {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 179, 167, 0.2);
}

.btn-outline-primary:active,
.btn-outline-primary:focus {
    color: white !important;
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 2px 4px rgba(0, 179, 167, 0.15) !important;
    transform: translateY(0);
    outline: none !important;
}

.btn-outline-primary:disabled {
    color: rgba(0, 179, 167, 0.5);
    background-color: transparent;
    border-color: rgba(0, 179, 167, 0.5);
    opacity: 0.7;
}

/* RTL support for outline primary button */
html[dir="rtl"] .btn-outline-primary {
    font-family: var(--font-family-arabic);
}
/* ============= SIDE MENU (DESKTOP) ============= */
.side-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--background-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: var(--sidebar-transition);
    overflow-y: auto;
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.1);
}

/* Improved side menu logo positioning with collapse toggle */

/* Adjust the side-menu-logo to account for the toggle button */
.side-menu-logo {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-top: 10px; /* Add space above logo for the toggle button */
    position: relative;
}

/* Side menu brand styling */
.side-menu-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    transition: color 0.2s ease;
}

/* Brand text styling */
.side-menu-brand .brand-text {
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

/* Adjust the collapse toggle positioning */
.side-menu-collapse-toggle {
    position: absolute;
    top: 10px;
    right: -12px;
    width: 24px;
    height: 24px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1040;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

/* Adjustments for collapsed state */
.side-menu.collapsed .side-menu-logo {
    padding: 1.5rem 0.5rem;
    margin-top: 10px; /* Maintain consistent spacing */
}

/* Ensure the toggle button doesn't overlap with logo */
.side-menu-logo::after {
    content: '';
    display: block;
    clear: both;
}

/* RTL support */
html[dir="rtl"] .side-menu-collapse-toggle {
    left: -12px;
    right: auto;
}

html[dir="rtl"] .side-menu-brand .brand-text {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Specially handle logo in collapsed state */
.side-menu.collapsed .side-menu-logo {
    overflow: hidden;
}

.side-menu.collapsed .side-menu-brand {
    justify-content: center;
    width: 100%;
}

/* Add a transition effect for smoother collapsing */
.side-menu-logo,
.side-menu-brand,
.side-menu-brand .brand-text {
    transition: all 0.3s ease;
}

/* Sidebar navigation items */
.side-menu-items {
    padding: 0.75rem 0;
    overflow-y: auto;
    flex: 1;
}

.side-menu-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.side-menu-item:hover, 
.side-menu-item.active {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.side-menu-item i {
    font-size: 1.2rem;
    margin-right: 1rem;
    min-width: 24px;
    text-align: center;
}

/* Sidebar badge (notifications, cart count) */
.side-menu-badge {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
}

/* Danger-themed menu item */
.side-menu-item-danger {
    color: var(--danger-color);
}

.side-menu-item-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.side-menu-item-success {
    color: var(--success-color);
}

.side-menu-item-sucess:hover {
    background-color: rgba(68, 239, 134, 0.1);
    color: var(--success-color);
}

/* Separator line in menu */
.side-menu-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 1.5rem;
    opacity: 0.5;
}

/* Footer section of sidebar */
.side-menu-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Add these styles for the collapsible sidebar */

/* Collapsed state styling */
.side-menu.collapsed {
    width: 70px;
    overflow: visible;
}

.side-menu.collapsed .side-menu-logo {
    padding: 1.5rem 0.5rem;
}

.side-menu.collapsed .side-menu-brand .brand-text {
    display: none;
}

.side-menu.collapsed .side-menu-item span,
.side-menu.collapsed .side-menu-separator,
.side-menu.collapsed .language-selector-container,
.side-menu.collapsed .side-menu-footer {
    display: none;
}

.side-menu.collapsed .side-menu-item {
    padding: 0.85rem;
    justify-content: center;
}

.side-menu.collapsed .side-menu-item i {
    margin-right: 0;
    font-size: 1.4rem;
}

/* Toggle button styling */
.side-menu-collapse-toggle {
    position: absolute;
    top: 1rem;
    right: -12px;
    width: 24px;
    height: 24px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1040;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.side-menu-collapse-toggle:hover {
    background-color: var(--primary-light);
    color: white;
}

.side-menu.collapsed .side-menu-collapse-toggle i {
    transform: rotate(180deg);
}

/* Main content adjustments for collapsed sidebar */
.main-content-collapsed {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
}

/* Tooltip for sidebar items when collapsed */
.side-menu.collapsed .side-menu-item {
    position: relative;
}

.side-menu.collapsed .side-menu-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--dropdown-bg);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: var(--shadow);
    z-index: 1050;
    border: 1px solid var(--border-color);
}

/* RTL support for collapsed sidebar */
html[dir="rtl"] .side-menu-collapse-toggle {
    left: -12px;
    right: auto;
}

html[dir="rtl"] .side-menu.collapsed .side-menu-item i {
    margin-left: 0;
}

html[dir="rtl"] .side-menu.collapsed .side-menu-item:hover::after {
    right: 70px;
    left: auto;
}

html[dir="rtl"] .main-content-collapsed {
    margin-right: 70px !important;
    margin-left: 0 !important;
}
/* Scrollbar styling for side menus */
.side-menu-items,
.mobile-side-menu-items,
.mobile-language-options {
    /* Enable smooth scrolling */
    scroll-behavior: smooth;
    /* Hide default scrollbar in Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Custom scrollbar styling for Webkit browsers (Chrome, Safari, Edge) */
.side-menu-items::-webkit-scrollbar,
.mobile-side-menu-items::-webkit-scrollbar,
.mobile-language-options::-webkit-scrollbar {
    width: 5px;
}

.side-menu-items::-webkit-scrollbar-track,
.mobile-side-menu-items::-webkit-scrollbar-track,
.mobile-language-options::-webkit-scrollbar-track {
    background: transparent;
}

.side-menu-items::-webkit-scrollbar-thumb,
.mobile-side-menu-items::-webkit-scrollbar-thumb,
.mobile-language-options::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
    border: 2px solid transparent;
}

/* Show scrollbar on hover for better UX */
.side-menu-items:hover::-webkit-scrollbar-thumb,
.mobile-side-menu-items:hover::-webkit-scrollbar-thumb,
.mobile-language-options:hover::-webkit-scrollbar-thumb {
    background-color: rgba(var(--primary-color-rgb), 0.5);
}

/* RTL support for scrollbars */
html[dir="rtl"] .side-menu-items,
html[dir="rtl"] .mobile-side-menu-items,
html[dir="rtl"] .mobile-language-options {
    scrollbar-width: thin;
    direction: rtl;
}

/* Add padding to scrollable areas to prevent content from being hidden behind scrollbar */
.side-menu-items,
.mobile-side-menu-items {
    padding-right: 5px;
}

html[dir="rtl"] .side-menu-items,
html[dir="rtl"] .mobile-side-menu-items {
    padding-right: 0;
    padding-left: 5px;
}
/* Prevent horizontal scrolling in side menus */
.side-menu,
.mobile-side-menu,
.side-menu-items,
.mobile-side-menu-items,
.mobile-language-options {
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Ensure menu items don't overflow horizontally */
.side-menu-item,
.mobile-side-menu-item {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make sure long text doesn't cause overflow */
.side-menu-item span,
.mobile-side-menu-item span,
.mobile-user-name,
.mobile-language-option span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix RTL horizontal scroll issues */
html[dir="rtl"] .side-menu,
html[dir="rtl"] .mobile-side-menu,
html[dir="rtl"] .side-menu-items,
html[dir="rtl"] .mobile-side-menu-items,
html[dir="rtl"] .mobile-language-options {
    overflow-x: hidden;
}
/* Desktop Top Navbar Styles */
.desktop-top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--background-color);
    z-index: 1020;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

/* the desktop navigation brand */
.desktop-top-navbar-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 1rem;
}

.desktop-top-navbar-brand {
    width: 20%;  /* Reduce width from 25% */
    display: flex;
    align-items: center;
}

.desktop-top-navbar-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding-right: 1rem; /* Add some padding to the right */
}

.desktop-top-navbar-brand .brand-text {
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--primary-color);
}

.desktop-top-navbar-search {
    width: 60%;  /* Increase width from 50% */
    max-width: 600px;  /* Increase max-width from 500px */
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.desktop-top-navbar-actions {
    width: 20%;  /* Reduce width from 25% */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

/* Update RTL support for the centered search bar */
html[dir="rtl"] .desktop-top-navbar-search {
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .desktop-top-navbar-brand {
        width: 20%;
    }
    
    .desktop-top-navbar-search {
        width: 60%;
    }
    
    .desktop-top-navbar-actions {
        width: 20%;
    }
}

/* Additional RTL fixes for desktop navbar content */
html[dir="rtl"] .desktop-top-navbar-content {
    justify-content: flex-start; /* In RTL, this will position items from the right */
    direction: rtl;
}

/* Ensure proper spacing and alignment in RTL */
html[dir="rtl"] .desktop-notification-toggle,
html[dir="rtl"] .desktop-message-toggle {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Make sure the last item in RTL has no margin */
html[dir="rtl"] .desktop-top-navbar-actions > *:first-child {
    margin-right: 0;
}


.search-input-group {
    display: flex;
    position: relative;
    width: 100%;
}

.search-input {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.6rem 1rem;  /* Slightly increase padding */
    width: 100%;
    color: var(--text-color);
    font-size: 0.95rem;  /* Slightly larger font */
    padding-right: 40px;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.15);
    width: 100%;
}
.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    border: none;
    background: none;
    color: var(--text-color-secondary);
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.search-button:hover {
    color: var(--primary-color);
}

.desktop-top-navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Ensure the brand stays centered on smaller desktop screens */
@media (max-width: 1200px) and (min-width: 992px) {
    .desktop-top-navbar-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

.desktop-language-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.desktop-language-toggle:hover {
    background-color: var(--hover-bg);
}

/* Adjust spacing for the side menu and content */
.side-menu {
    top: 60px;
    height: calc(100vh - 60px);
}

.main-content-wrapper {
    margin-top: 60px;
}

/* RTL Support */
html[dir="rtl"] .search-input {
    padding-right: 1rem;
    padding-left: 40px;
}

html[dir="rtl"] .search-button {
    right: auto;
    left: 0;
    border-radius: 20px 0 0 20px;
}
/* Desktop top navbar actions styling */
.desktop-top-navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.desktop-notification-toggle,
.desktop-message-toggle {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.desktop-notification-toggle:hover,
.desktop-message-toggle:hover {
    background-color: var(--hover-bg);
}

.desktop-notification-toggle i,
.desktop-message-toggle i {
    font-size: 1.15rem;
    color: var(--text-color-secondary);
}

.desktop-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.desktop-user-avatar:hover {
    transform: scale(1.05);
}

.desktop-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.desktop-user-avatar i {
    font-size: 1.8rem;
    color: var(--text-color-secondary);
}

.desktop-user-avatar .paid-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

/* Notification badge styling - already defined elsewhere but repeated here for context */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* RTL support */
html[dir="rtl"] .notification-badge {
    right: auto;
    left: -5px;
}

html[dir="rtl"] .desktop-user-avatar .paid-badge {
    right: auto;
    left: 0;
}

/* ============= MOBILE TOP BAR ============= */
.mobile-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile menu toggle */
.menu-toggle, 
.mobile-notifications {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-notifications {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-notifications:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.mobile-logo {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.5rem;
}

.mobile-logo a {
    color: var(--primary-color);
    text-decoration: none;
    display: block;
}

.mobile-logo a .brand-text {
    display: inline-block;
    font-size: 1.4rem;
    color: var(--primary-color);
}

/* ============= MOBILE SIDE MENU ============= */
.mobile-side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-side-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--background-color);
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.mobile-side-menu.show {
    left: 0;
}

.mobile-side-menu-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.mobile-side-menu-close {
    align-self: flex-end;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

.mobile-side-menu-close:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.mobile-user-info {
    display: flex;
    align-items: center;
    margin-top: 1rem;
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;
}

.mobile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-user-avatar i {
    font-size: 2rem;
    color: var(--text-muted);
}

.mobile-user-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.mobile-side-menu-items {
    padding: 1rem 0;
    overflow-y: auto;
    flex: 1;
}

.mobile-side-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-side-menu-item:hover, 
.mobile-side-menu-item.active {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
}

.mobile-side-menu-item i {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.mobile-side-menu-badge {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
}

/* Mobile menu theme toggle and language selector */
.mobile-side-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 0;
}

/* Theme toggle in mobile menu */
.mobile-side-menu .theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.mobile-side-menu .theme-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mobile-side-menu .theme-toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
}

.mobile-side-menu .theme-toggle-label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.mobile-side-menu .theme-toggle-input:checked + .theme-toggle-label {
    background-color: var(--primary-color);
}

.mobile-side-menu .theme-toggle-input:checked + .theme-toggle-label:before {
    transform: translateX(20px);
}

/* RTL support for theme toggle */
html[dir="rtl"] .mobile-side-menu .theme-toggle-label:before {
    left: auto;
    right: 2px;
}

html[dir="rtl"] .mobile-side-menu .theme-toggle-input:checked + .theme-toggle-label:before {
    transform: translateX(-20px);
}

/* Mobile language dropdown */
.mobile-language-dropdown {
    position: fixed;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 1061;
    transition: left 0.3s ease, right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-language-dropdown.show {
    left: 0;
}

/* RTL support for language dropdown */
html[dir="rtl"] .mobile-language-dropdown {
    left: auto;
    right: 100%;
}

html[dir="rtl"] .mobile-language-dropdown.show {
    right: 0;
    left: auto;
}

.mobile-language-dropdown-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-language-dropdown-header i {
    margin-right: 10px;
    cursor: pointer;
}

html[dir="rtl"] .mobile-language-dropdown-header i {
    margin-right: 0;
    margin-left: 10px;
    transform: scaleX(-1);
}

.mobile-language-options {
    flex: 1;
    overflow-y: auto;
}

.mobile-language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
}

.mobile-language-option.active {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.mobile-language-option:hover {
    background-color: var(--hover-bg);
}
/* ============= BOTTOM NAVIGATION (MOBILE) ============= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-footer-height);
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    display: none;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}
/* Improve bottom navigation item hover and active states */
.bottom-nav-item:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* RTL support for active indicator */
html[dir="rtl"] .bottom-nav-item.active::after {
    left: 25%;
    right: auto;
}
.bottom-nav-badge {
    position: absolute;
    top: 8px;
    right: calc(50% - 14px);
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============= THEME TOGGLE ============= */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: var(--text-overflow);
    padding: 0.4rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative;
    margin: 0 5px;
}

.theme-toggle:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    color: white;
}

.theme-toggle i {
    font-size: 1.2rem;
}

/* ============= LANGUAGE SELECTOR ============= */
.language-selector-container {
    position: relative;
}

.language-selector-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.language-selector-toggle:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.language-options {
    position: absolute;
    bottom: 100%; /* Position above the toggle instead of below */
    right: 0;
    width: 220px;
    background-color: var(--dropdown-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    overflow: hidden;
    display: none;
    margin-bottom: 10px; /* Add margin to bottom instead of top */
    border: 1px solid var(--border-color);
}

/* RTL support for language options */
html[dir="rtl"] .language-options {
    right: auto;
    left: 0;
}

.language-options.show {
    display: block;
}

.language-option {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.language-option:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.language-option.active {
    background-color: rgba(var(--primary-color-rgb), 0.15);
    font-weight: 500;
}

.language-option .lang-code {
    font-weight: 600;
    margin-right: 10px;
    min-width: 30px;
}

.language-option .lang-name {
    color: var(--text-color);
}

/* ============= FOOTER ============= */
.footer {
    padding: 20px 0;
    margin-top: 40px;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

.footer-links {
    margin-bottom: 10px;
}

.footer-link {
    color: var(--footer-link);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--footer-link-hover);
    text-decoration: underline;
}

.footer-divider {
    margin: 0 10px;
    color: var(--footer-divider);
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============= RESPONSIVE ADJUSTMENTS ============= */
@media (max-width: 991.98px) {
    /* Mobile layout */
    body {
        padding-top: var(--mobile-header-height);
        padding-bottom: var(--mobile-footer-height);

    }

    .main-content-wrapper {
        margin-left: 0;
        width: 100%;
        margin-bottom: var(--mobile-footer-height); /* Add bottom margin for mobile navigation */
    }
    
    .side-menu {
        display: none;
    }
    
    .mobile-top-bar,
    .bottom-nav {
        display: flex;
    }
    
    /* Adjust notification position for mobile */
    .sidebar-notification {
        top: var(--mobile-header-height);
        left: auto;
        right: 10px;
        width: 90%;
        max-width: 350px;
    }
}

@media (max-width: 380px) {
    .mobile-notifications {
        gap: 2px;
    }
}

/* ============= RTL SUPPORT ============= */
html[dir="rtl"] .side-menu {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -1px 0 10px rgba(0, 0, 0, 0.1);
}

html[dir="rtl"] .main-content-wrapper {
    margin-left: 0;
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

html[dir="rtl"] .side-menu-item i,
html[dir="rtl"] .mobile-side-menu-item i {
    margin-right: 0;
    margin-left: 1rem;
}

html[dir="rtl"] .side-menu-badge,
html[dir="rtl"] .mobile-side-menu-badge {
    right: auto;
    left: 1.5rem;
}

html[dir="rtl"] .mobile-user-avatar {
    margin-right: 0;
    margin-left: 1rem;
}

html[dir="rtl"] .sidebar-notification {
    left: auto;
    right: var(--sidebar-width);
    transform: translateX(-10px);
}

html[dir="rtl"] .sidebar-notification.show {
    transform: translateX(0);
}

html[dir="rtl"] .bottom-nav-badge {
    right: auto;
    left: calc(50% - 14px);
}

html[dir="rtl"] .mobile-side-menu {
    left: auto;
    right: -280px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

html[dir="rtl"] .mobile-side-menu.show {
    right: 0;
}

html[dir="rtl"] .language-option .lang-code {
    margin-right: 0;
    margin-left: 10px;
}

@media (max-width: 991.98px) {
    html[dir="rtl"] .main-content-wrapper {
        margin-right: 0;
    }
    
    html[dir="rtl"] .sidebar-notification {
        left: 10px;
        right: auto;
    }
}

/* ============= STATUS INDICATORS ============= */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    border: 1px solid var(--border-color);
    position: relative;
    margin-inline-end: 6px;
    transition: background-color 0.2s ease-in-out;
}

.status-indicator.status-online {
    background-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.status-indicator.status-offline {
    background-color: #6c757d !important;
}

/* ============= PAID BADGE ============= */
.paid-badge {
    display: inline-flex;
    color: #FFD700;
    font-size: 0.5em;
    vertical-align: middle;
    background: linear-gradient(135deg, hsl(51, 100%, 41%), #FFA500);
    -webkit-background-clip: text;
    background-clip: text;
    position: relative;
    animation: shimmer 2s infinite alternate;
}

.paid-badge i {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    transform: scale(1.2);
}

@keyframes shimmer {
    0% {
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
    }
}

/* ============= ANIMATIONS ============= */
@keyframes pulseNav {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bottom-nav-item:active i {
    animation: pulseNav 0.3s ease;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 4px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.animate-status .status-indicator.status-online {
    animation: statusPulse 2s infinite;
}

@keyframes cartPulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(var(--primary-color-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0); }
}

.cart-count.pulse {
    animation: cartPulse 2s infinite;
}

/* You can add this to your existing CSS file */
.side-menu-badge {
    position: absolute;
    right: 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    min-height: 18px;
    padding: 0 5px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* For RTL layouts, position on the left instead */
html[dir="rtl"] .side-menu-badge {
    right: auto;
    left: 15px;
}

/* Bottom nav badges */
.bottom-nav-badge {
    position: absolute;
    top: 0;
    right: 8px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    min-height: 18px;
    padding: 0 5px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}