/* ===== PREMIUM MAIN CONTENT AREA STYLES ===== */
:root {
    --nav-height: 60px;
    --header-height: 56px;
    --footer-height: 48px;
    --primary-gradient: linear-gradient(135deg, #4361ee, #3a56d4);
    --primary-color: #4361ee;
    --secondary-color: #6c757d;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #1f2937;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-light: #f0f2f5;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.03);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-white: #1f2937;
    --bg-light: #111827;
    --bg-dark: #0f172a;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-light: #2d3748;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-light);
    transition: margin var(--transition-base);
}

/* ===== PREMIUM TOP NAVBAR ===== */
.top-navbar-modern {
    height: var(--nav-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(var(--bg-white-rgb, 255, 255, 255), 0.9);
}

[data-theme="dark"] .top-navbar-modern {
    background-color: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(8px);
}

.nav-container {
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Premium Toggle Buttons */
.nav-toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.25rem;
}

    .nav-toggle-btn:hover {
        background: var(--bg-light);
        color: var(--primary-color);
        transform: scale(1.05);
    }

    .nav-toggle-btn:active {
        transform: scale(0.95);
    }

.desktop-toggle {
    display: flex;
}

.mobile-toggle {
    display: none;
}

@media (max-width: 768px) {
    .desktop-toggle {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }
}

/* Premium Brand */
.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: 12px;
}

.brand-logo-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-logo {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.brand-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Current Page Indicator */
.current-page-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

    .current-page-indicator .separator {
        font-size: 1.2rem;
        line-height: 1;
    }

    .current-page-indicator .page-name {
        color: var(--text-secondary);
        font-weight: 500;
    }

/* Mobile Page Title */
.mobile-page-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quick Actions Group */
.quick-actions-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    background: var(--bg-light);
    border-radius: 12px;
    margin-right: 8px;
}

.action-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
    position: relative;
}

    .action-btn:hover {
        background: var(--bg-white);
        color: var(--primary-color);
        box-shadow: var(--shadow-sm);
    }

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-white);
}

/* Premium User Menu */
.user-menu-wrapper {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

    .user-menu-trigger:hover {
        background: var(--bg-white);
        border-color: var(--primary-color);
        box-shadow: var(--shadow-sm);
    }

.user-avatar-container {
    position: relative;
    width: 32px;
    height: 32px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 30px;
    object-fit: cover;
    border: 2px solid var(--bg-white);
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border: 2px solid var(--bg-white);
    border-radius: 50%;
}

.user-name-display {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.user-menu-trigger[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Premium Dropdown */
.user-dropdown-premium {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-base);
    z-index: 1000;
}

    .user-dropdown-premium.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-header-premium {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
}

.dropdown-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropdown-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-menu-items {
    padding: 8px;
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

    .dropdown-menu-item:hover {
        background: var(--bg-light);
        color: var(--primary-color);
        transform: translateX(4px);
    }

    .dropdown-menu-item i {
        font-size: 1.1rem;
        width: 20px;
    }

    .dropdown-menu-item.text-danger {
        color: var(--danger-color);
    }

        .dropdown-menu-item.text-danger:hover {
            background: rgba(239, 68, 68, 0.1);
        }

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px;
}

/* ===== PREMIUM PAGE HEADER ===== */
.page-header-premium {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title-premium {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* Premium Breadcrumb */
.breadcrumb-premium {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

    .breadcrumb-item:hover {
        color: var(--primary-color);
    }

    .breadcrumb-item i {
        font-size: 1rem;
    }

    .breadcrumb-item.active {
        color: var(--text-secondary);
        font-weight: 500;
    }

.breadcrumb-separator {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .header-actions .btn {
        padding: 6px 14px;
        font-size: 0.85rem;
        border-radius: 8px;
        font-weight: 500;
    }

/* ===== PREMIUM CONTENT CONTAINER ===== */
.content-container-premium {
    flex: 1;
    padding: 16px 20px;
    background: var(--bg-light);
}

/* Alert Container */
.alert-container-compact {
    margin-bottom: 16px;
}

    .alert-container-compact .alert {
        padding: 10px 16px;
        margin-bottom: 12px;
        border-radius: 10px;
        font-size: 0.9rem;
    }

/* Premium Toast Container */
.toast-container-premium {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    right: 20px;
    z-index: 1056;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    pointer-events: none;
}

.toast-premium {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideIn 0.2s ease;
    max-width: 100%;
    backdrop-filter: blur(8px);
}

    .toast-premium.success {
        border-left: 3px solid var(--success-color);
    }

    .toast-premium.error {
        border-left: 3px solid var(--danger-color);
    }

    .toast-premium.warning {
        border-left: 3px solid var(--warning-color);
    }

    .toast-premium.info {
        border-left: 3px solid var(--info-color);
    }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Main Content */
.main-content-premium {
    min-height: calc(100vh - var(--nav-height) - var(--header-height) - var(--footer-height) - 32px);
}

/* ===== PREMIUM FOOTER ===== */
.footer-premium {
    height: var(--footer-height);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 0 20px;
}

.footer-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

    .footer-copyright i {
        font-size: 0.9rem;
    }

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-badge {
    padding: 2px 8px;
    background: var(--bg-light);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.7rem;
}

.footer-separator {
    color: var(--border-color);
    font-size: 0.8rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

    .footer-link:hover {
        color: var(--primary-color);
    }

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
        --header-height: 48px;
        --footer-height: 56px;
    }

    .nav-container {
        padding: 0 12px;
    }

    .brand-name {
        display: none;
    }

    .user-name-display {
        display: none;
    }

    .quick-actions-group {
        background: transparent;
        margin-right: 0;
    }

    .action-btn {
        width: 36px;
        height: 36px;
    }

    .user-menu-trigger {
        padding: 2px;
        background: transparent;
        border: none;
    }

        .user-menu-trigger:hover {
            background: transparent;
        }

    .page-header-premium {
        padding: 0 16px;
    }

    .breadcrumb-premium {
        display: none;
    }

    .content-container-premium {
        padding: 12px 16px;
    }

    .footer-container {
        flex-direction: column;
        gap: 4px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .quick-actions-group {
        gap: 2px;
    }

    .action-btn {
        width: 34px;
        height: 34px;
    }

    .content-container-premium {
        padding: 10px 12px;
    }

    .toast-container-premium {
        right: 12px;
        left: 12px;
        max-width: calc(100% - 24px);
    }
}

/* ===== UTILITY CLASSES ===== */
/* RTL Support */
[dir="rtl"] .breadcrumb-separator {
    transform: rotate(180deg);
}

[dir="rtl"] .dropdown-menu-item:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .toast-premium {
    border-left: none;
    border-right: 3px solid;
}

/* Print Styles */
@media print {
    .top-navbar-modern,
    .page-header-premium,
    .footer-premium,
    .toast-container-premium {
        display: none !important;
    }

    .main-content-premium {
        padding: 0 !important;
    }
}
/* User Menu Wrapper */
.user-menu-wrapper {
    position: relative;
}

/* User Menu Trigger */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

    .user-menu-trigger:hover {
        background: var(--bg-white);
        border-color: var(--primary-color);
        box-shadow: var(--shadow-sm);
    }

    .user-menu-trigger:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

.user-avatar-container {
    position: relative;
    width: 32px;
    height: 32px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 30px;
    object-fit: cover;
    border: 2px solid var(--bg-white);
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border: 2px solid var(--bg-white);
    border-radius: 50%;
}

.user-name-display {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

/* Premium Dropdown */
.user-dropdown-premium {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    pointer-events: none;
}

    .user-dropdown-premium.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

/* RTL Support */
[dir="rtl"] .user-dropdown-premium {
    right: auto;
    left: 0;
}

.dropdown-header-premium {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.user-info-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
}

.dropdown-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropdown-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-menu-items {
    padding: 8px;
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

    .dropdown-menu-item:hover {
        background: var(--bg-light);
        color: var(--primary-color);
        transform: translateX(4px);
    }

[dir="rtl"] .dropdown-menu-item:hover {
    transform: translateX(-4px);
}

.dropdown-menu-item i {
    font-size: 1.1rem;
    width: 20px;
}

.dropdown-menu-item.text-danger {
    color: var(--danger-color);
}

    .dropdown-menu-item.text-danger:hover {
        background: rgba(239, 68, 68, 0.1);
    }

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .user-name-display {
        display: none;
    }

    .user-menu-trigger {
        padding: 2px;
        background: transparent;
        border: none;
    }

        .user-menu-trigger:hover {
            background: transparent;
        }

    .dropdown-arrow {
        display: none;
    }

    .user-dropdown-premium {
        width: 240px;
        right: -10px;
    }

    [dir="rtl"] .user-dropdown-premium {
        left: -10px;
        right: auto;
    }
}

/* Add to your existing CSS */
.user-profile.impersonating-mode {
    background: linear-gradient(145deg, #fff7e6, #fff3d6);
    border: 1px solid #ffd966;
    position: relative;
}

.impersonation-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
    background: #ffc107;
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.impersonation-label {
    font-size: 0.7rem;
    color: #f59e0b;
    font-weight: normal;
    margin-right: 0.5rem;
}

.status-indicator.warning {
    background: #f59e0b;
}

.logout-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .logout-content small {
        font-size: 0.7rem;
        opacity: 0.7;
    }

.dropdown-item.warning {
    color: #f59e0b;
    background: #fff9e6;
}

    .dropdown-item.warning i {
        color: #f59e0b;
    }

.dropdown-item.danger {
    color: #dc3545;
}

    .dropdown-item.danger i {
        color: #dc3545;
    }

/* RTL Support */
[dir="rtl"] .impersonation-badge {
    right: auto;
    left: -4px;
}

[dir="rtl"] .impersonation-label {
    margin-right: 0;
    margin-left: 0.5rem;
}
/* Hide brand link on mobile */
@media (max-width: 768px) {
    .brand-link {
        display: none !important;
    }

    .current-page-indicator {
        display: none !important;
    }
    .nav-center{
        display:none!important;
    }
    .mobile-page-title {
       display:none!important;
    }
}
/* Professional Navbar Style */
.lang-container {
    display: inline-flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.lang-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .lang-option:hover {
        color: #4361ee;
        background: #f1f5f9;
    }

    .lang-option.active {
        background: linear-gradient(135deg, #4361ee, #3a0ca3);
        color: white;
        box-shadow: 0 4px 10px -2px #4361ee80;
    }

        .lang-option.active:hover {
            background: linear-gradient(135deg, #3a56d4, #2e0892);
            color: white;
        }

.lang-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

    .lang-tooltip::before {
        content: '';
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: 5px solid #1e293b;
    }

.lang-option:hover .lang-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -36px;
}

.lang-divider {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 4px;
}

/* RTL Support */
[dir="rtl"] .lang-tooltip {
    font-family: 'Cairo', sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .lang-container {
        padding: 2px;
    }

    .lang-option {
        padding: 6px 12px;
        font-size: 12px;
    }

    .lang-tooltip {
        display: none;
    }
}