﻿/* ============================================
   SITE STYLES - MODERN DESIGN
   Note: Theme variables are defined in theme.css
   ============================================ */

/* ============================================
   CSS VARIABLES FOR HEADER/FOOTER
   ============================================ */
:root {
    --header-height: 72px;
    --header-bg: #ffffff;
    --header-glass: rgba(255, 255, 255, 0.1);
    --nav-link-color: rgba(255, 255, 255, 0.9);
    --nav-link-hover: rgba(255, 255, 255, 1);
    --nav-link-active-bg: rgba(255, 255, 255, 0.2);
    
    /* Footer Variables - Light Mode Default */
    --footer-bg: #ffffff;
    --footer-text: #5a7a7e;
    --footer-heading: #1a2e35;
    --footer-link: #5a7a7e;
    --footer-link-hover: #209aa2;
    --footer-border: #dce8e9;
    --footer-icon-bg: #f5f9f9;
    --footer-icon-border: #dce8e9;
    --footer-bottom-bg: #f5f9f9;
    
    /* Side Menu Variables - Light Mode Default */
    --side-menu-bg: #ffffff;
    --side-menu-text: #1a2e35;
    --side-menu-border: #dce8e9;
    --side-menu-link-bg: #f5f9f9;
    --side-menu-link-hover-bg: #eef4f4;
    --side-menu-link-color: #5a7a7e;
    --side-menu-link-hover-color: #209aa2;
    --side-menu-icon-color: #6d8d90;
    --side-menu-icon-bg: #eef4f4;
}

[data-theme="dark"] {
    --header-bg: var(--bg-card);
    
    /* Footer Variables - Dark Mode */
    --footer-bg: linear-gradient(135deg, #152e31 0%, #0f2224 100%);
    --footer-text: rgba(255, 255, 255, 0.8);
    --footer-heading: #ffffff;
    --footer-link: rgba(255, 255, 255, 0.7);
    --footer-link-hover: #e78a56;
    --footer-border: rgba(255, 255, 255, 0.1);
    --footer-icon-bg: rgba(255, 255, 255, 0.08);
    --footer-icon-border: rgba(255, 255, 255, 0.1);
    --footer-bottom-bg: rgba(0, 0, 0, 0.15);
    
    /* Side Menu Variables - Dark Mode */
    --side-menu-bg: linear-gradient(180deg, #0f2224 0%, #152e31 50%, #1a3a3d 100%);
    --side-menu-text: #ffffff;
    --side-menu-border: rgba(255, 255, 255, 0.1);
    --side-menu-link-bg: rgba(255, 255, 255, 0.08);
    --side-menu-link-hover-bg: rgba(32, 154, 162, 0.2);
    --side-menu-link-color: rgba(255, 255, 255, 0.9);
    --side-menu-link-hover-color: #ffffff;
    --side-menu-icon-color: #86b7ba;
    --side-menu-icon-bg: rgba(255, 255, 255, 0.15);
}

/* ============================================
   GLOBAL BUTTON DESIGN SYSTEM
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(32, 154, 162, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
    gap: 6px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 14px;
    gap: 10px;
}

.btn-primary {
    background: var(--purple-gradient);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(32, 154, 162, 0.45);
    color: var(--white);
}

.btn-secondary,
.btn-outline-primary {
    background: transparent;
    color: var(--purple-primary);
    border-color: var(--purple-primary);
}

.btn-secondary:hover,
.btn-outline-primary:hover {
    background: var(--purple-gradient);
    color: var(--white);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-purple);
}

.btn-success,
.btn-outline-success {
    background: transparent;
    color: var(--success);
    border-color: var(--success);
}

.btn-success:hover,
.btn-outline-success:hover {
    background: var(--success);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(32, 154, 162, 0.35);
}

.btn-danger,
.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover,
.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-info,
.btn-outline-info {
    background: transparent;
    color: var(--info);
    border-color: var(--info);
}

.btn-info:hover,
.btn-outline-info:hover {
    background: var(--info);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-warning,
.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border-color: var(--warning);
}

.btn-warning:hover,
.btn-outline-warning:hover {
    background: var(--warning);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--text-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-white {
    background: #ffffff;
    color: var(--purple-dark);
    border-color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-white:hover {
    background: var(--purple-lightest);
    color: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-icon {
    padding: 12px;
    width: 44px;
    height: 44px;
}

.btn-icon.btn-sm {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* ============================================
   BASE STYLES
   ============================================ */

html {
    font-size: 14px;
    scroll-behavior: smooth;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-body);
}

main {
    flex: 1;
}

.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--purple-primary);
    color: var(--white);
    padding: 10px 20px;
    z-index: 10000;
    transition: top 0.3s ease;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   NEW HEADER STYLES - MINIMAL DESIGN
   Layout: [Logo] [Menu] [Language] -- spacer -- [Notifications] [?] [Power]
   RTL:    [Power] [?] [Notifications] -- spacer -- [Language] [Menu] [Logo]
   ============================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-card);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-height: var(--header-height);
    border-bottom: 1px solid var(--border-light);
}

.header-container {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 0 24px 0 0;
    height: var(--header-height);
    position: relative;
    z-index: 1;
}

/* RTL Support for Header Container */
[dir="rtl"] .header-container,
body.rtl .header-container {
    padding: 0 0 0 24px;
}

/* LEFT GROUP */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

/* Header Logo should stretch full height */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 0;
    height: 100%;
    align-self: stretch; /* Ensure it fills height even if container is centered */
}

/* SPACER */
.header-spacer {
    flex: 1;
}

/* RIGHT GROUP */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo Styling */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 0;
    height: 100%;
}

.header-logo .logo-icon {
    width: var(--header-height);
    height: var(--header-height);
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-right: 1px solid var(--border-light);
    transition: all 0.3s ease;
    overflow: hidden;
}

.header-logo .logo-icon img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.header-logo:hover .logo-icon {
    transform: scale(1.05);
    background: var(--bg-hover);
}

.header-logo .logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-logo .logo-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--purple-dark);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.header-logo .logo-tagline {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Menu Toggle Button */
.header-menu-toggle {
    width: 44px;
    height: 44px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-menu-toggle:hover {
    background: var(--bg-active);
    transform: scale(1.05);
    color: var(--purple-primary);
}

.header-menu-toggle i {
    font-size: 1.4rem;
}

/* Language Dropdown */
.header-lang-dropdown {
    position: relative;
}

.header-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-lang-btn:hover {
    background: var(--bg-active);
    color: var(--purple-primary);
}

.header-lang-btn::after {
    display: none;
}

.header-lang-btn .chevron-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.header-lang-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.dropdown-menu-lang {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 180px;
    margin-top: 8px !important;
}

.dropdown-menu-lang .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
}

.dropdown-menu-lang .dropdown-item:hover {
    background: var(--purple-lightest);
    color: var(--purple-primary);
}

.dropdown-menu-lang .dropdown-item.active {
    background: var(--purple-lightest);
    color: var(--purple-primary);
}

.dropdown-menu-lang .dropdown-item .lang-flag {
    font-size: 1.2rem;
}

.dropdown-menu-lang .dropdown-item i.bi-check2 {
    margin-left: auto;
    color: var(--success);
}

/* Icon Buttons (Notification, Help) */
.header-icon-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.header-icon-btn:hover {
    background: var(--bg-active);
    transform: scale(1.05);
    color: var(--purple-primary);
}

/* Theme Toggle Icons */
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }

.header-icon-btn i {
    font-size: 1.15rem;
}

/* Notification Badge */
.header-icon-btn .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Power/User Button */
.header-power-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.header-power-btn:hover {
    background: var(--bg-active);
    transform: scale(1.05);
    color: var(--danger);
}

.header-power-btn i {
    font-size: 1.15rem;
}

/* User Button with Avatar */
.header-user-btn {
    padding: 0;
    overflow: hidden;
}

.header-user-btn::after {
    display: none;
}

.header-user-btn .user-avatar-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.header-user-btn .user-avatar-small i {
    font-size: 1.2rem;
}

/* User Dropdown */
.dropdown-menu-user {
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 260px;
    margin-top: 8px !important;
}

.dropdown-menu-user .dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, var(--purple-lightest) 0%, transparent 100%);
    border-radius: 12px;
    margin-bottom: 8px;
}

.dropdown-menu-user .user-avatar-lg {
    width: 50px;
    height: 50px;
    background: var(--purple-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.dropdown-menu-user .user-avatar-lg i {
    font-size: 1.5rem;
    color: white;
}

.dropdown-menu-user .user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-menu-user .user-fullname {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropdown-menu-user .user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dropdown-menu-user .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.dropdown-menu-user .dropdown-item:hover {
    background: var(--purple-lightest);
    color: var(--purple-primary);
}

.dropdown-menu-user .dropdown-item i {
    font-size: 1.1rem;
    opacity: 0.7;
    width: 20px;
    text-align: center;
}

.dropdown-menu-user .dropdown-item:hover i {
    opacity: 1;
}

.dropdown-menu-user .dropdown-item-logout {
    color: var(--danger) !important;
    border: none;
    background: transparent;
    width: 100%;
    cursor: pointer;
}

.dropdown-menu-user .dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
}

.dropdown-menu-user .dropdown-divider {
    margin: 8px 0;
    border-color: var(--border-color);
    opacity: 0.5;
}

/* ============================================
   SIDE MENU (OFFCANVAS)
   ============================================ */

.side-menu {
    width: 300px !important;
    background: var(--side-menu-bg);
    border-right: 1px solid var(--side-menu-border) !important;
}

[dir="rtl"] .side-menu {
    border-right: none !important;
    border-left: 1px solid var(--side-menu-border) !important;
}

.side-menu .offcanvas-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--side-menu-border);
}

.side-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--side-menu-border);
    background: var(--side-menu-link-bg);
    color: var(--side-menu-link-color);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-inline-start: auto;
    font-size: 1rem;
    padding: 0;
}

.side-menu-close:hover {
    background: var(--danger-bg, #fee2e2);
    color: var(--danger, #EF4444);
    border-color: var(--danger, #EF4444);
    transform: scale(1.05);
}

[data-theme="dark"] .side-menu-close:hover {
    background: rgba(239, 68, 68, 0.15);
}

.side-menu-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.side-menu-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--side-menu-icon-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--side-menu-border);
}

.side-menu-logo .logo-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.side-menu-logo .logo-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--side-menu-text);
}

.side-menu .offcanvas-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--side-menu-link-bg);
    border: 1px solid var(--side-menu-border);
    color: var(--side-menu-link-color);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.side-menu-link:hover {
    background: var(--side-menu-link-hover-bg);
    border-color: rgba(32, 154, 162, 0.3);
    color: var(--side-menu-link-hover-color);
}

.side-menu-link.active {
    background: linear-gradient(135deg, rgba(32, 154, 162, 0.25) 0%, rgba(31, 90, 94, 0.2) 100%);
    border-color: rgba(32, 154, 162, 0.4);
    color: var(--side-menu-link-hover-color);
}

.side-menu-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: var(--side-menu-icon-color);
}

.side-menu-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--side-menu-border);
}

.side-menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--side-menu-text);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.side-menu-theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.side-menu-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.side-menu-theme-toggle i {
    font-size: 1.2rem;
    color: #86b7ba;
}

.side-menu-theme-toggle .icon-light {
    display: none;
}

[data-theme="dark"] .side-menu-theme-toggle .icon-dark {
    display: none;
}

[data-theme="dark"] .side-menu-theme-toggle .icon-light {
    display: inline-block;
}

.side-menu-auth {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.side-menu-btn-login {
    background: var(--side-menu-link-bg);
    border: 1px solid var(--side-menu-border);
    color: var(--side-menu-text);
}

.side-menu-btn-login:hover {
    background: var(--side-menu-link-hover-bg);
    color: var(--side-menu-link-hover-color);
}

.side-menu-btn-register {
    background: linear-gradient(135deg, #209aa2 0%, #205b5f 100%);
    border: none;
    color: white;
}

.side-menu-btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(32, 154, 162, 0.4);
    color: white;
}

/* ============================================
   RTL SUPPORT FOR NEW HEADER
   ============================================ */

[dir="rtl"] .header-logo .logo-text,
body.rtl .header-logo .logo-text {
    text-align: right;
}

[dir="rtl"] .dropdown-menu-lang,
body.rtl .dropdown-menu-lang {
    text-align: right;
}

[dir="rtl"] .dropdown-menu-lang .dropdown-item i.bi-check2,
body.rtl .dropdown-menu-lang .dropdown-item i.bi-check2 {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .header-icon-btn .notification-badge,
body.rtl .header-icon-btn .notification-badge {
    right: auto;
    left: -4px;
}

[dir="rtl"] .dropdown-menu-user,
body.rtl .dropdown-menu-user {
    text-align: right;
}

[dir="rtl"] .dropdown-menu-user .user-details,
body.rtl .dropdown-menu-user .user-details {
    text-align: right;
}

/* RTL Side Menu */
[dir="rtl"] .side-menu,
body.rtl .side-menu {
    --bs-offcanvas-start: auto;
}

[dir="rtl"] .offcanvas-start,
body.rtl .offcanvas-start {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

[dir="rtl"] .offcanvas-start.show,
body.rtl .offcanvas-start.show {
    transform: translateX(0);
}

[dir="rtl"] .side-menu-link,
body.rtl .side-menu-link {
    text-align: right;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .header-container {
        padding: 0 12px 0 0;
    }

    [dir="rtl"] .header-container,
    body.rtl .header-container {
        padding: 0 0 0 12px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .header-right {
        gap: 6px;
    }
    
    .header-logo .logo-text {
        display: none;
    }

    .header-logo .logo-icon {
        width: 60px;
        height: var(--header-height);
        flex-shrink: 0;
        padding: 0;
    }

    .header-logo .logo-icon img {
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
    
    .header-menu-toggle,
    .header-icon-btn,
    .header-power-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .header-lang-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .header-lang-btn span {
        display: none;
    }
    
    .header-lang-btn .chevron-icon {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 8px;
    }
    
    .header-left,
    .header-right {
        gap: 4px;
    }
    
    .header-menu-toggle,
    .header-icon-btn,
    .header-power-btn {
        width: 34px;
        height: 34px;
    }

    .header-logo .logo-icon {
        width: 56px;
        height: var(--header-height);
        padding: 0;
    }

    .header-logo .logo-icon img {
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
}

/* Theme Toggle Button - keeping for side menu */
.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-active);
    transform: scale(1.05);
    color: var(--purple-primary);
}

.theme-toggle-btn i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.4s ease;
}

.theme-toggle-btn .icon-dark {
    opacity: 1;
}

.theme-toggle-btn .icon-light {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
}

[data-theme="dark"] .theme-toggle-btn .icon-dark {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg);
}

[data-theme="dark"] .theme-toggle-btn .icon-light {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Dark mode dropdown adjustments */
[data-theme="dark"] .dropdown-menu-lang,
[data-theme="dark"] .dropdown-menu-user,
[data-theme="dark"] .dropdown-menu-notifications {
    background: var(--bg-primary, #152e31);
    border-color: var(--border-color, #1e4446);
}

[data-theme="dark"] .dropdown-menu-lang .dropdown-item,
[data-theme="dark"] .dropdown-menu-user .dropdown-item {
    color: var(--text-primary, #eef4f4);
}

[data-theme="dark"] .dropdown-menu-lang .dropdown-item:hover,
[data-theme="dark"] .dropdown-menu-user .dropdown-item:hover {
    background: rgba(32, 154, 162, 0.2);
}

[data-theme="dark"] .dropdown-menu-user .dropdown-user-info {
    background: rgba(32, 154, 162, 0.15);
}

[data-theme="dark"] .dropdown-menu-user .user-fullname {
    color: #eef4f4;
}

[data-theme="dark"] .dropdown-menu-user .user-email {
    color: #8da8ab;
}

/* Language Toggle - keeping for compatibility */
.nav-item-lang {
    position: relative;
    z-index: 9999;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px !important;
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.lang-toggle i {
    font-size: 1.1rem;
}

.lang-text {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Modern Dropdown Menu */
.dropdown-menu-modern {
    background: #ffffff !important;
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 12px;
    margin-top: 12px !important;
    min-width: 220px;
    animation: dropdownSlide 0.3s ease;
    z-index: 9999 !important;
    position: absolute;
    isolation: isolate;
}

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

.dropdown-menu-modern::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: rotate(45deg);
    border-radius: 4px;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.dropdown-menu-modern .dropdown-header {
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dropdown-menu-modern .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: var(--purple-lightest);
    color: var(--purple-primary);
    transform: translateX(4px);
}

.dropdown-menu-modern .dropdown-item i {
    font-size: 1.1rem;
    opacity: 0.7;
    width: 20px;
    text-align: center;
}

.dropdown-menu-modern .dropdown-item:hover i {
    opacity: 1;
}

.dropdown-menu-modern .dropdown-item.active {
    background: var(--purple-lightest);
    color: var(--purple-primary);
}

.dropdown-menu-modern .dropdown-divider {
    margin: 8px 0;
    border-color: var(--border-color);
    opacity: 0.5;
}

/* Language Dropdown Items */
.lang-flag {
    font-size: 1.2rem;
}

.lang-name {
    flex: 1;
}

.check-icon {
    color: var(--success);
    font-size: 1rem;
}

/* User Menu Toggle */
.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important;
    transition: all 0.3s ease;
    text-decoration: none;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.user-menu-toggle .user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.user-menu-toggle .user-avatar i {
    font-size: 1.1rem;
    color: white;
}

.avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #209aa2;
}
.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-toggle .chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.user-menu-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* User Dropdown Header */
.dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, var(--purple-lightest) 0%, transparent 100%);
    border-radius: 12px;
    margin-bottom: 8px;
}

.user-avatar-lg {
    width: 50px;
    height: 50px;
    background: var(--purple-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.user-avatar-lg i {
    font-size: 1.5rem;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-fullname {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Logout Item */
.dropdown-item-logout {
    color: var(--danger) !important;
}

.dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
}

/* Auth Buttons */
.btn-nav-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-nav-login:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
    transform: translateY(-2px);
}

.btn-nav-register {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: white;
    color: var(--purple-dark);
    border: 2px solid white;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-nav-register:hover {
    background: var(--purple-lightest);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    color: var(--purple-dark);
}

/* Global Theme Logo Toggles */
.dark-logo {
    display: none;
}

[data-theme="dark"] .light-logo {
    display: none;
}

[data-theme="dark"] .dark-logo {
    display: block;
}

/* ============================================
   MODERN FOOTER STYLES
   ============================================ */

.main-footer {
    position: relative;
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: auto;
}

.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        #209aa2 0%,
        #86b7ba 25%,
        #e78a56 50%,
        #86b7ba 75%,
        #209aa2 100%);
    background-size: 200% 100%;
    animation: gradientFlow 8s ease infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- Footer Top Row: Brand + Newsletter ---- */
.footer-content {
    padding: 28px 0 0;
}

.footer-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
    flex-wrap: wrap;
}

.footer-brand {
    flex: 1 1 320px;
    max-width: 420px;
}

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 8px;
}

.footer-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.footer-brand-name {
    font-size: 1.4rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--footer-heading);
    letter-spacing: -0.02em;
}

.footer-description {
    color: var(--footer-text);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 360px;
    margin: 6px 0 0;
    opacity: 0.85;
}

.footer-newsletter {
    flex: 1 1 320px;
    max-width: 400px;
}

.footer-newsletter .footer-title {
    margin-bottom: 8px;
}

.newsletter-text {
    color: var(--footer-text);
    font-size: 0.88rem;
    margin-bottom: 14px;
    opacity: 0.8;
}

.newsletter-input-wrap {
    display: flex;
    align-items: stretch;
    background: var(--footer-icon-bg);
    border-radius: 10px;
    border: 1px solid var(--footer-border);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.newsletter-input-wrap:focus-within {
    border-color: var(--purple-primary);
}

.newsletter-form .form-control {
    background: transparent;
    border: none;
    color: var(--footer-heading);
    padding: 12px 16px;
    font-size: 0.9rem;
    flex: 1;
}

.newsletter-form .form-control::placeholder {
    color: var(--footer-text);
}

.newsletter-form .form-control:focus {
    box-shadow: none;
    background: transparent;
}

.btn-subscribe {
    background: #e78a56;
    color: white;
    border: none;
    padding: 12px 18px;
    font-size: 1rem;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-subscribe:hover {
    background: #d47a48;
    color: white;
}

/* ---- Divider ---- */
.footer-divider {
    height: 1px;
    background: var(--footer-border);
    margin: 20px 0;
}

/* ---- Footer Links Row ---- */
.footer-links-row {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.footer-col {
    flex: 1 1 160px;
    min-width: 140px;
}

.footer-col-social {
    flex: 1 1 200px;
}

.footer-title {
    color: var(--footer-heading);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: var(--footer-link);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s ease, padding-left 0.25s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--footer-link-hover);
    padding-left: 4px;
}

/* ---- Social Icons ---- */
.social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--footer-link);
    font-size: 1rem;
    background: var(--footer-icon-bg);
    border: 1px solid var(--footer-icon-border);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: #e78a56;
    border-color: #e78a56;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(231, 138, 86, 0.35);
}

/* ---- Footer Bottom ---- */
.footer-bottom {
    background: var(--footer-bottom-bg);
    padding: 16px 0;
    border-top: 1px solid var(--footer-border);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.copyright {
    margin: 0;
    font-size: 0.82rem;
    color: var(--footer-text);
    opacity: 0.85;
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-bottom-links a {
    color: var(--footer-link);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.25s ease;
    opacity: 0.85;
}

.footer-bottom-links a:hover {
    color: var(--footer-link-hover);
    opacity: 1;
}

/* ---- Mobile: stack footer ---- */
@media (max-width: 767.98px) {
    .footer-top-row {
        flex-direction: column;
        gap: 24px;
    }

    .footer-brand,
    .footer-newsletter {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .footer-links-row {
        gap: 24px;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }
}

/* ============================================
   RTL SUPPORT
   ============================================ */

body.rtl {
    direction: rtl;
    text-align: right;
}

/* RTL Navbar Layout - Complete overhaul for proper positioning */
body.rtl .main-header .navbar .container-fluid {
    flex-direction: row-reverse;
}

body.rtl .main-header .navbar {
    direction: rtl;
}

body.rtl .navbar-brand {
    margin-right: 0;
    margin-left: 1rem;
}

body.rtl .navbar-brand .brand-icon-wrapper {
    margin-right: 0;
    margin-left: 12px;
}

body.rtl .navbar-toggler {
    margin-left: 0;
    margin-right: 0;
    order: -1;
}

body.rtl .navbar-collapse.show {
    flex-direction: row-reverse;
}

@media (min-width: 992px) {
    body.rtl .navbar-collapse {
        flex-direction: row-reverse;
    }
}

body.rtl .nav-main {
    margin-left: auto;
    margin-right: 0;
    flex-direction: row;
}

body.rtl .nav-right {
    margin-left: 0;
    margin-right: 0;
    flex-direction: row;
}

body.rtl .nav-main .nav-link {
    flex-direction: row-reverse;
}

body.rtl .nav-main .nav-link i {
    margin-right: 0;
    margin-left: 8px;
}

body.rtl .nav-main .nav-link.active::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

body.rtl .dropdown-menu-modern::before {
    right: auto;
    left: 24px;
}

body.rtl .dropdown-menu-modern .dropdown-item {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .dropdown-menu-modern .dropdown-item:hover {
    transform: translateX(-4px);
}

body.rtl .footer-links a:hover {
    padding-left: 0;
    padding-right: 4px;
}

body.rtl .btn-nav-login,
body.rtl .btn-nav-register {
    flex-direction: row-reverse;
}

body.rtl .btn-nav-login i,
body.rtl .btn-nav-register i {
    margin-right: 0;
    margin-left: 8px;
}

body.rtl .user-menu-toggle {
    padding: 6px 6px 6px 14px !important;
    flex-direction: row-reverse;
}

body.rtl .user-menu-toggle .user-avatar {
    margin-right: 0;
    margin-left: 10px;
}

body.rtl .user-menu-toggle .user-name {
    margin-right: 0;
    margin-left: 6px;
}

body.rtl .user-menu-toggle .chevron {
    margin-left: 0;
    margin-right: 4px;
}

body.rtl .lang-toggle {
    flex-direction: row-reverse;
}

body.rtl .lang-toggle i {
    margin-right: 0;
    margin-left: 6px;
}

body.rtl .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

/* RTL Notification bell */
body.rtl .notification-toggle .notification-badge {
    right: auto;
    left: -4px;
}

/* RTL dropdown items icon positioning */
body.rtl .dropdown-menu-modern .dropdown-item i {
    margin-right: 0;
    margin-left: 10px;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 991px) {
    /* Keep notification dropdown full width on mobile */
    .dropdown-menu-notifications {
        position: fixed !important;
        top: 70px !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: none !important;
        transform: none !important;
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .footer-content {
        padding: 30px 0 20px;
    }
    
    .footer-wave svg {
        height: 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 8px; /* reduce gap in bottom footer */
    }
}

@media (max-width: 576px) {
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ============================================
   THEME TOGGLE COMPATIBILITY
   ============================================ */

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.theme-toggle .theme-icon {
    position: absolute;
    font-size: 1.2rem;
    color: white;
    transition: all 0.4s ease;
}

.theme-toggle .icon-moon {
    opacity: 1;
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-180deg);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

/* Container */
.container {
    max-width: 1200px;
}

/* Form Focus States */
.btn:focus, 
.btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--purple-primary);
}

/* Global Password Field Fix - ensure proper bullet display */
input[type="password"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: 0.1em;
}

.form-floating > .form-control-plaintext::placeholder, 
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, 
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ============================================
   GLOBAL SELECT/DROPDOWN STYLING
   Modern design for all dropdowns
   ============================================ */

/* Base Select Styling */
select,
.form-select,
select.form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: var(--bg-card, #ffffff) !important;
    border: 2px solid var(--border-color, #dce8e9) !important;
    border-radius: 12px !important;
    padding: 12px 48px 12px 16px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: var(--text-primary, #152e31) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23016484' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    min-height: 48px !important;
    line-height: 1.5 !important;
}

select:hover,
.form-select:hover,
select.form-control:hover {
    border-color: var(--purple-primary, #209aa2) !important;
    box-shadow: 0 4px 12px rgba(32, 154, 162, 0.1) !important;
}

select:focus,
.form-select:focus,
select.form-control:focus {
    outline: none !important;
    border-color: var(--purple-primary, #209aa2) !important;
    box-shadow: 0 0 0 4px rgba(32, 154, 162, 0.15), 0 4px 12px rgba(32, 154, 162, 0.1) !important;
}

/* Select Options */
select option,
.form-select option {
    padding: 12px 16px !important;
    background-color: #ffffff !important;
    color: #152e31 !important;
    font-weight: 500 !important;
}

select option:checked,
.form-select option:checked {
    background: linear-gradient(135deg, #209aa2 0%, #205b5f 100%) !important;
    background-color: #209aa2 !important;
    color: #ffffff !important;
}

select option:hover,
.form-select option:hover {
    background-color: rgba(32, 154, 162, 0.1) !important;
}

/* Disabled State */
select:disabled,
.form-select:disabled,
select.form-control:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: var(--bg-secondary, #eef4f4) !important;
}

/* Small Select */
select.form-select-sm,
.form-select-sm {
    padding: 8px 40px 8px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
    min-height: 38px !important;
    background-size: 16px !important;
    background-position: right 10px center !important;
}

/* Large Select */
select.form-select-lg,
.form-select-lg {
    padding: 16px 52px 16px 20px !important;
    font-size: 1.05rem !important;
    border-radius: 14px !important;
    min-height: 56px !important;
    background-size: 20px !important;
}

/* ============================================
   DARK MODE SELECT STYLING
   ============================================ */
[data-theme="dark"] select,
[data-theme="dark"] .form-select,
[data-theme="dark"] select.form-control {
    background-color: var(--bg-input, #1a3a3d) !important;
    border-color: var(--border-color, #1e4446) !important;
    color: var(--text-primary, #eef4f4) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2386b7ba' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] select:hover,
[data-theme="dark"] .form-select:hover,
[data-theme="dark"] select.form-control:hover {
    border-color: var(--purple-light, #86b7ba) !important;
    box-shadow: 0 4px 12px rgba(134, 183, 186, 0.2) !important;
}

[data-theme="dark"] select:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] select.form-control:focus {
    border-color: var(--purple-light, #86b7ba) !important;
    box-shadow: 0 0 0 4px rgba(134, 183, 186, 0.25), 0 4px 12px rgba(134, 183, 186, 0.2) !important;
}

[data-theme="dark"] select option,
[data-theme="dark"] .form-select option {
    background-color: var(--bg-input, #1a3a3d) !important;
    color: var(--text-primary, #eef4f4) !important;
}

[data-theme="dark"] select option:checked,
[data-theme="dark"] .form-select option:checked {
    background: linear-gradient(135deg, #209aa2 0%, #205b5f 100%) !important;
    color: #ffffff !important;
}

[data-theme="dark"] select:disabled,
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] select.form-control:disabled {
    background-color: var(--bg-tertiary, #0f2224) !important;
    border-color: var(--border-color, #152e31) !important;
}

/* ============================================
   RTL SUPPORT FOR SELECTS
   ============================================ */
[dir="rtl"] select,
[dir="rtl"] .form-select,
[dir="rtl"] select.form-control,
html[lang="ar"] select,
html[lang="ar"] .form-select,
html[lang="ar"] select.form-control {
    padding: 12px 16px 12px 48px !important;
    background-position: left 14px center !important;
}

[dir="rtl"] select.form-select-sm,
[dir="rtl"] .form-select-sm,
html[lang="ar"] select.form-select-sm,
html[lang="ar"] .form-select-sm {
    padding: 8px 12px 8px 40px !important;
    background-position: left 10px center !important;
}

[dir="rtl"] select.form-select-lg,
[dir="rtl"] .form-select-lg,
html[lang="ar"] select.form-select-lg,
html[lang="ar"] .form-select-lg {
    padding: 16px 20px 16px 52px !important;
    background-position: left 16px center !important;
}

/* ============================================
   FLOATING LABEL SELECT FIX
   ============================================ */
.form-floating > select,
.form-floating > .form-select {
    padding-top: 1.625rem !important;
    padding-bottom: 0.625rem !important;
    min-height: 58px !important;
}

.form-floating > select ~ label,
.form-floating > .form-select ~ label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1rem 0.75rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: var(--text-secondary, #6d8d90);
}

.form-floating > select:focus ~ label,
.form-floating > select:not([value=""]):valid ~ label,
.form-floating > .form-select ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--purple-primary, #209aa2);
}

/* ============================================
   VALIDATION STATES FOR SELECTS
   ============================================ */
select.is-valid,
.form-select.is-valid,
.was-validated select:valid,
.was-validated .form-select:valid {
    border-color: #86b7ba !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2386b7ba' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

select.is-valid:focus,
.form-select.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(134, 183, 186, 0.15) !important;
}

select.is-invalid,
.form-select.is-invalid,
.was-validated select:invalid,
.was-validated .form-select:invalid {
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

select.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}


/* ============================================
   NOTIFICATION BELL & DROPDOWN
   ============================================ */

/* Notification Toggle Button */
.nav-item-notifications {
    position: relative;
}

.notification-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-tertiary, #f5f9f9);
    border: 1px solid var(--border-color, #dce8e9);
    border-radius: 12px;
    color: var(--text-secondary, #6d8d90);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.notification-toggle:hover {
    background: var(--purple-primary, #209aa2);
    border-color: var(--purple-primary, #209aa2);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 154, 162, 0.3);
}

.notification-toggle i {
    font-size: 1.15rem;
    transition: transform 0.3s ease;
}

.notification-toggle:hover i {
    transform: rotate(-15deg);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notificationPulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Notification Dropdown (Modern) */
.notification-dropdown,
.dropdown-menu-notifications {
    width: 400px !important;
    max-width: 92vw !important;
    padding: 0 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.2), 0 10px 20px -5px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: dropdownFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

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

.notification-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: relative;
}

.notification-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent);
}

.notification-header h6 {
    margin: 0;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, #5a7a7e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-mark-all-read {
    background: rgba(32, 154, 162, 0.08); /* Brand clear tint */
    border: none;
    color: var(--purple-primary, #209aa2);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-mark-all-read:hover {
    background: var(--purple-primary, #209aa2);
    color: #ffffff;
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(32, 154, 162, 0.3);
}

/* Notification List */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
    background: transparent;
    padding: 8px 0;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--border-color, #dce8e9);
    border-radius: 3px;
}

/* Notification Item Enhancements */
.notification-item {
    display: grid;
    grid-template-columns: 48px 1fr auto; /* Fixed icon, fluid content, time/status */
    gap: 16px;
    padding: 16px 20px;
    margin: 4px 12px;
    border-radius: 16px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: visible; /* For potential badges/dots */
}

.notification-item:hover {
    background: #ffffff;
    border-color: rgba(0,0,0,0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.08); 
    z-index: 2;
}

.notification-item.unread {
    background: linear-gradient(145deg, rgba(32, 154, 162, 0.05) 0%, rgba(255,255,255,1) 100%);
    border-left: 0; /* Remove old border */
}

/* Distinct unread dot indicator */
.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--purple-primary, #209aa2);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(32, 154, 162, 0.4);
}

.notification-item:last-child {
    margin-bottom: 12px;
}

/* Modern Icon Design */
.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px; /* Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #f5f9f9; /* Fallback */
    border: 1px solid rgba(255,255,255,0.4);
}

.notification-item:hover .notification-icon {
    transform: scale(1.1) rotate(-5deg);
}

.notification-icon i {
    font-size: 1.35rem;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Icon Variants with Glassy gradients */
.notification-icon.icon-viewed {
    background: linear-gradient(135deg, #86b7ba 0%, #209aa2 100%);
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.3);
}

.notification-icon.icon-status {
    background: linear-gradient(135deg, #86b7ba 0%, #205b5f 100%);
    box-shadow: 0 8px 16px -4px rgba(13, 148, 136, 0.3);
}

.notification-icon.icon-shortlisted {
    background: linear-gradient(135deg, #e78a56 0%, #d47840 100%);
    box-shadow: 0 8px 16px -4px rgba(217, 119, 6, 0.3);
}

.notification-icon.icon-rejected {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 8px 16px -4px rgba(220, 38, 38, 0.3);
}

.notification-icon.icon-hired {
    background: linear-gradient(135deg, #86b7ba 0%, #209aa2 100%);
    box-shadow: 0 8px 16px -4px rgba(5, 150, 105, 0.3);
}

.notification-icon.icon-application {
    background: linear-gradient(135deg, #86b7ba 0%, #205b5f 100%);
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
}

.notification-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Text truncation fix */
}

.notification-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #152e31);
    line-height: 1.35;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-secondary, #6d8d90);
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 450;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted, #8da8ab);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    opacity: 0.8;
}

.notification-time i {
    font-size: 0.8rem;
    color: var(--purple-primary); /* Accent color for clock */
}


/* Notification Empty State (Modern) */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9f9 100%);
    min-height: 300px;
}

.empty-icon-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eef4f4 0%, #dce8e9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.8),
        0 16px 32px -8px rgba(0,0,0,0.08);
}

.empty-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.notification-empty i {
    font-size: 3.5rem;
    margin: 0;
    color: #c8d8da;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
    background: linear-gradient(135deg, #c8d8da 0%, #8da8ab 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.notification-empty p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary, #6d8d90);
    font-weight: 600;
    text-align: center;
    max-width: 240px;
    line-height: 1.6;
}

/* Notification Footer (Modern) */
.notification-footer {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0,0,0,0.04);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
}

.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 28px;
    background: #ffffff;
    color: var(--text-secondary, #5a7a7e);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 12px -2px rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.view-all-link:hover {
    background: var(--purple-primary, #209aa2);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(32, 154, 162, 0.25);
}

/* Dark Mode Notifications */
[data-theme="dark"] .notification-toggle {
    background: var(--bg-tertiary, #152e31);
    border-color: var(--border-color, #1e4446);
    color: var(--text-secondary, #8da8ab);
}

[data-theme="dark"] .notification-toggle:hover {
    background: var(--purple-primary, #209aa2);
    border-color: var(--purple-primary, #209aa2);
    color: #ffffff;
}

[data-theme="dark"] .notification-dropdown,
[data-theme="dark"] .dropdown-menu-notifications {
    background: var(--bg-primary, #0f2224) !important;
    border-color: var(--border-color, #1e4446) !important;
}

[data-theme="dark"] .notification-list {
    background: var(--bg-primary, #0f2224);
}

[data-theme="dark"] .notification-item {
    border-color: var(--border-color, #1e4446) !important;
}

[data-theme="dark"] .notification-item:hover {
    background: var(--bg-tertiary, #152e31) !important;
}

[data-theme="dark"] .notification-item.unread {
    background: linear-gradient(135deg, rgba(32, 154, 162, 0.1) 0%, rgba(32, 91, 95, 0.05) 100%) !important;
}

[data-theme="dark"] .notification-item.unread:hover {
    background: linear-gradient(135deg, rgba(32, 154, 162, 0.15) 0%, rgba(32, 91, 95, 0.08) 100%) !important;
}

[data-theme="dark"] .notification-title {
    color: var(--text-primary, #eef4f4) !important;
}

[data-theme="dark"] .notification-message {
    color: var(--text-secondary, #8da8ab) !important;
}

[data-theme="dark"] .notification-footer {
    background: var(--bg-secondary, #152e31);
    border-color: var(--border-color, #1e4446);
}

/* RTL Support for Notifications */
[dir="rtl"] .notification-item.unread {
    border-left: none;
    border-right: 3px solid var(--purple-primary, #209aa2);
}

[dir="rtl"] .notification-badge {
    right: auto;
    left: -4px;
}

/* ============================================
   GLOBAL DARK MODE FIXES - UNIVERSAL TEXT VISIBILITY
   ============================================ */

/* Ensure all text is visible in dark mode */
[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-muted {
    color: #8da8ab !important;
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
    color: #eef4f4;
}

[data-theme="dark"] p {
    color: #c8d8da;
}

/* Numbers and counters */
[data-theme="dark"] .count,
[data-theme="dark"] .counter,
[data-theme="dark"] .number,
[data-theme="dark"] .stat-number,
[data-theme="dark"] .stat-value,
[data-theme="dark"] .badge-count {
    color: #eef4f4 !important;
}

/* Generic badges */
[data-theme="dark"] .badge {
    color: #eef4f4;
}

[data-theme="dark"] .badge.bg-primary,
[data-theme="dark"] .badge.bg-success,
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-danger,
[data-theme="dark"] .badge.bg-info {
    color: #ffffff !important;
}

[data-theme="dark"] .badge.bg-secondary,
[data-theme="dark"] .badge.bg-light {
    background-color: #1e4446 !important;
    color: #eef4f4 !important;
}

/* Cards in dark mode */
[data-theme="dark"] .card {
    background-color: #152e31;
    border-color: #1e4446;
}

[data-theme="dark"] .card-header {
    background-color: #0f2224;
    border-color: #1e4446;
    color: #eef4f4;
}

[data-theme="dark"] .card-body {
    color: #c8d8da;
}

[data-theme="dark"] .card-title {
    color: #eef4f4;
}

[data-theme="dark"] .card-text {
    color: #8da8ab;
}

[data-theme="dark"] .card-footer {
    background-color: #0f2224;
    border-color: #1e4446;
}

/* List groups */
[data-theme="dark"] .list-group-item {
    background-color: #152e31;
    border-color: #1e4446;
    color: #eef4f4;
}

[data-theme="dark"] .list-group-item:hover {
    background-color: #0f2224;
}

[data-theme="dark"] .list-group-item.active {
    background-color: #209aa2;
    border-color: #209aa2;
}

/* Tables */
[data-theme="dark"] .table {
    color: #eef4f4;
}

[data-theme="dark"] .table th {
    color: #eef4f4;
    border-color: #1e4446;
}

[data-theme="dark"] .table td {
    color: #c8d8da;
    border-color: #1e4446;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .table-hover > tbody > tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Modals */
[data-theme="dark"] .modal-content {
    background-color: #152e31;
    border-color: #1e4446;
}

[data-theme="dark"] .modal-header {
    border-color: #1e4446;
}

[data-theme="dark"] .modal-title {
    color: #eef4f4;
}

[data-theme="dark"] .modal-body {
    color: #c8d8da;
}

[data-theme="dark"] .modal-footer {
    border-color: #1e4446;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Alerts */
[data-theme="dark"] .alert {
    border-width: 1px;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #a8d0d3;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(134, 183, 186, 0.15);
    border-color: rgba(134, 183, 186, 0.3);
    color: #a8d0d3;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #de9369;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Borders */
[data-theme="dark"] .border {
    border-color: #1e4446 !important;
}

[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: #1e4446 !important;
}

/* Well and panels */
[data-theme="dark"] .well,
[data-theme="dark"] .panel,
[data-theme="dark"] .jumbotron {
    background-color: #152e31;
    color: #eef4f4;
}

/* ============================================
   RTL SUPPORT - USING DIR ATTRIBUTE
   ============================================ */

/* Navbar container RTL */
[dir="rtl"] .main-header .container {
    display: flex;
    flex-direction: row-reverse;
}

[dir="rtl"] .navbar-brand {
    margin-left: 0;
    margin-right: 0;
}

[dir="rtl"] .navbar-collapse.show,
[dir="rtl"] .navbar-collapse.collapsing {
    display: flex !important;
}

[dir="rtl"] .navbar-collapse.show {
    flex-grow: 1;
    justify-content: flex-end;
}

[dir="rtl"] .nav-main {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .nav-main .nav-item {
    text-align: right;
}

[dir="rtl"] .nav-main .nav-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-main .nav-link i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .nav-right {
    margin-right: 0;
    margin-left: 0;
}

[dir="rtl"] .nav-right .nav-item {
    text-align: right;
}

/* User menu RTL */
[dir="rtl"] .user-menu-toggle {
    flex-direction: row-reverse;
}

[dir="rtl"] .user-menu-toggle .user-name {
    margin-right: 8px;
    margin-left: 0;
}

[dir="rtl"] .user-menu-toggle .chevron {
    margin-right: 4px;
    margin-left: 0;
}

[dir="rtl"] .user-avatar {
    margin-right: 0;
    margin-left: 8px;
}

/* Language toggle RTL */
[dir="rtl"] .lang-toggle {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-toggle i {
    margin-right: 0;
    margin-left: 6px;
}

/* Dropdown items RTL */
[dir="rtl"] .dropdown-item {
    text-align: right;
}

[dir="rtl"] .dropdown-item i {
    margin-right: 0;
    margin-left: 10px;
}

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

[dir="rtl"] .notification-item {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .notification-item.unread {
    border-left: none;
    border-right: 3px solid var(--purple-primary, #209aa2);
}

/* Fix navbar layout in RTL */
[dir="rtl"] .main-header .navbar > .container-fluid,
[dir="rtl"] .main-header .navbar > .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .navbar-collapse.show {
    flex-direction: row-reverse;
}

@media (min-width: 992px) {
    [dir="rtl"] .navbar-collapse {
        flex-direction: row-reverse;
    }
}

[dir="rtl"] .navbar-nav.nav-main {
    flex-direction: row-reverse;
    margin-right: 2rem;
    margin-left: auto;
}

[dir="rtl"] .navbar-nav.nav-right {
    flex-direction: row-reverse;
    margin-left: 0;
    margin-right: 0;
}

/* ============================================
   MOBILE MENU OPEN STATE
   ============================================ */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body.mobile-menu-open .navbar-collapse {
    touch-action: pan-y !important;
}

body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: var(--header-height, 72px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9997;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Hamburger Menu Animation Enhancement */
.navbar-toggler.active .toggler-icon span:nth-child(1),
.navbar-toggler[aria-expanded="true"] .toggler-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggler.active .toggler-icon span:nth-child(2),
.navbar-toggler[aria-expanded="true"] .toggler-icon span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.navbar-toggler.active .toggler-icon span:nth-child(3),
.navbar-toggler[aria-expanded="true"] .toggler-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   SIDE MENU INTERACTION (PUSH EFFECT)
   ============================================ */

/* Elements to animate */
#main-content, 
.site-header, 
.main-footer {
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

/* Open State - LTR (Desktop Only) */
@media (min-width: 769px) {
    body.side-menu-open #main-content,
    body.side-menu-open .site-header,
    body.side-menu-open .main-footer {
        transform: translateX(300px);
    }
}

/* Open State - RTL (Desktop Only) */
@media (min-width: 769px) {
    [dir='rtl'] body.side-menu-open #main-content,
    [dir='rtl'] body.side-menu-open .site-header,
    [dir='rtl'] body.side-menu-open .main-footer {
        transform: translateX(-300px);
    }
}

/* Ensure no horizontal scrollbar when pushed */
body.side-menu-open {
    overflow-x: hidden;
}


/* ============================================
   MOBILE HEADER ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    /* Make icon buttons consistent size */
    .header-icon-btn,
    .header-menu-toggle,
    .header-power-btn,
    .header-lang-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        justify-content: center;
    }

    /* Adjust sizing for text buttons in header */
    .header-right .btn-sm {
        height: 40px;
        padding: 0 12px;
        display: flex;
        align-items: center;
    }

    /* Adjust Language Button for Mobile */
    .header-lang-btn span,
    .header-lang-btn .chevron-icon {
        display: none;
    }
    
    .header-lang-btn {
        gap: 0;
    }

    .header-logo .logo-text {
        display: none;
    }
    
    .header-left, .header-right {
        gap: 8px;
    }
}

