
/* ========================================
   HEADER LAYOUT - RTL/LTR RESPONSIVE
   ======================================== */

/* Sticky Header Container */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Main Header Content Container */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 70px;
    min-height: 70px;
    max-height: 70px;
}

/* ========================================
   RIGHT GROUP (RTL) - Brand + Navigation
   ======================================== */

.header-right-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    direction: rtl;
    flex: 1;
    min-width: 0;
    margin-right: 0 ;

}

/* Brand Section */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    cursor: pointer;
}

.header-brand span:first-child {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #1e293b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    direction: rtl;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ========================================
   LEFT GROUP (LTR) - Toggle + Actions
   ======================================== */

.header-left-group {
    display: flex;
    align-items: center;
    margin-right: 2rem;
    gap: 1rem;
    direction: ltr;
    flex-shrink: 0;
}

/* Toggle Button */
.header-toggle {
    display: none;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.toggle-btn:hover {
    background-color: #f1f5f9;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    direction: ltr;
}


/* Shared action button base style */
.login-btn,
.register-btn,
.profile-btn,
.logout-btn,
.admin-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.875rem;
}

.login-btn,
.register-btn {
    background: linear-gradient(135deg, #2563eb, #3255b4);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(55, 14, 159, 0.2);
}

.login-btn:hover,
.register-btn:hover {
    background: linear-gradient(135deg, #7d8fb7, #7d8fb7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(188, 200, 221, 0.3);
}

/* Profile button (green) */
.profile-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}
.profile-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Logout button (red) */
.logout-btn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}
.logout-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.admin-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}
.admin-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ========================================
   MOBILE NAVIGATION DROPDOWN
   ======================================== */

.mobile-nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 40;
}

.mobile-nav-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    direction: rtl;
}

.mobile-nav .nav-link {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-bottom: none;
    transition: background-color 0.2s ease;
}

.mobile-nav .nav-link:hover {
    background-color: #f8fafc;
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.mobile-actions .login-btn,
.mobile-actions .register-btn 
.mobile-actions .profile-btn,
.mobile-actions .logout-btn,
.mobile-actions .admin-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Large screens */
@media (min-width: 1024px) {
    .header-content {
        padding: 0 2rem;
    }
    
    .header-right-group {
        gap: 3rem;
    }
    
    .main-nav {
        gap: 2rem;
    }
    
    .header-title {
        font-size: 1.75rem;
    }
}

/* Medium screens */
@media (max-width: 1023px) and (min-width: 768px) {
    .header-right-group {
        gap: 1.5rem;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .header-title {
        font-size: 1.25rem;
    }
    
    .login-btn,
    .register-btn,
    .logout-btn,
    .profile-btn,
    .admin-btn{
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Small screens - Show mobile navigation */
@media (max-width: 880px) {
    .header-content {
        height: 60px;
        min-height: 60px;
        max-height: 60px;
    }
    
    .header-toggle {
        display: block;
    }
  
    .main-nav {
        display: none;
    }
    /* Hide all buttons in header actions on small screens (stronger selector) */
    .header-actions > .login-btn,
    .header-actions > .register-btn,
    .header-actions > .profile-btn,
    .header-actions > .logout-btn,
    .header-actions > .admin-btn,
    .header-actions a.login-btn,
    .header-actions a.register-btn,
    .header-actions a.profile-btn,
    .header-actions a.logout-btn,
    .header-actions a.admin-btn,
    .header-actions button.logout-btn,
    .header-actions button.profile-btn {
        display: none !important;
    }

    .header-right-group {
        gap: 1rem;
        flex: 1;
    }
    
    .header-title {
        font-size: 1.125rem;
    }
    
    .header-brand span:first-child {
        width: 2rem;
        height: 2rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    .header-brand span:first-child {
        width: 1.75rem;
        height: 1.75rem;
    }

    /* Make login button smaller on very small screens */
    .login-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce repaints during animations */
.login-btn,
.register-btn,
.profile-btn,
.logout-btn,
.admin-btn,
.nav-link {
    will-change: transform;
}

/* Smooth scrolling for navigation overflow */
.main-nav {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.toggle-btn:focus,
.login-btn:focus,
.register-btn:focus,
.nav-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Ensure header stays contained */
.sticky-header * {
    box-sizing: border-box;
}

/*---------------------------------------------
    Center for Notificaion and Chat bottons 
-----------------------------------------------*/

/* Header Center Bell Styles */
.header-flex-layout {
    position: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-center-bell {
    display: auto;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 60px;
    z-index: 2;
}

@media (max-width: 250px) {
    .header-center-bell {
        display: none;
    }
}


/*=====================================================================*/
/*     Header Chat and Notification Icons                              */
/*=====================================================================*/

.header-icons {
    display: flex;
    align-items: center;
    color: #2563eb;
    gap: 0.75rem;
    justify-content: center;
}

/* Unified Icon Button Style */

.header-icon-btn {
    position: relative;
    background: #ffffff;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.10);
}


.header-icon-btn:hover {
    background-color: #7e9ddc;
}

.header-icon-btn:focus {
    outline: 2px solid #1810bd;
    outline-offset: 2px;
}

.header-icon-svg {
    width: 22px;
    height: 22px;
    color: #0d2aa8;
    display: block;
    transition: color 0.2s ease;
}

.header-icon-btn:hover .header-icon-svg {
    color: #e0e7ff;
}

.header-icon-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #dc2626;
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

@media (max-width: 767px) {
    .header-icon-btn {
        width: 34px;
        height: 34px;
        padding: 7px;
    }
    .header-icon-svg {
        width: 18px;
        height: 18px;
    }
    .header-icon-badge {
        width: 12px;
        height: 12px;
        font-size: 8px;
    }
    .header-icons {
        gap: 0.5rem;
    }
}
