/* =========================================================
   USER HEADER
========================================================= */
.user-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(230, 230, 230, 0.7);
}

body {
    padding-top: 84px;
}

/* =========================================================
   DESKTOP WRAPPER
========================================================= */
.user-header-desktop {
    width: 100%;
    height: 84px;
    transition: all 0.3s ease;
}

.user-header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* =========================================================
   LOGO
========================================================= */
.user-header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.user-header-logo img {
    width: 150px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.user-header-logo:hover img {
    transform: scale(1.03);
}

/* =========================================================
   MENU
========================================================= */
.user-header-menu-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.user-header-menu {
    display: flex;
    align-items: center;
    gap: 34px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-header-menu-item {
    position: relative;
}

.user-header-menu-link {
    position: relative;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: #1f1f1f;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
    padding: 8px 0;
}

/* =========================================================
   UNDERLINE EFFECT
========================================================= */
.user-header-menu-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: #111;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.user-header-menu-link:hover::after,
.user-header-menu-item.active-menu .user-header-menu-link::after {
    width: 100%;
}

.user-header-menu-link:hover,
.user-header-menu-item.active-menu .user-header-menu-link {
    color: #000;
}

/* =========================================================
   RIGHT SIDE
========================================================= */
.user-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* =========================================================
   SEARCH
========================================================= */
.user-header-search-form {
    margin-right: 8px;
}

.user-header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.user-header-search-input {
    width: 240px;
    height: 44px;
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    padding: 0 46px 0 18px;
    font-size: 14px;
    background: #fafafa;
    transition:
        all 0.3s ease,
        width 0.3s ease;
}

.user-header-search-input:focus {
    outline: none;
    background: #fff;
    border-color: #111;
    width: 270px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.user-header-search-input::placeholder {
    color: #999;
}

.user-header-search-btn {
    position: absolute;
    right: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #666;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-header-search-btn:hover {
    color: #000;
}

/* =========================================================
   ICONS
========================================================= */
.user-header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-header-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

.user-header-icon i {
    font-size: 19px;
    color: #1f1f1f;
    transition: color 0.25s ease;
}

.user-header-icon:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

.user-header-icon:hover i {
    color: #000;
}

/* =========================================================
   BADGE
========================================================= */
.user-header-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4747;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
    pointer-events: none;
    border: 2px solid #fff;
}

/* =========================================================
   PROFILE
========================================================= */
.user-header-profile {
    position: relative;
}

/* =========================================================
   DROPDOWN (Optimized for smooth transitions)
   ========================================================= */
.user-header-dropdown {
    position: absolute;
    top: 58px;
    right: 0;
    width: 220px;
    background: #fff;
    border-radius: 18px;
    padding: 10px;
    /* Use visibility/opacity instead of display:none to allow transitions */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Prevents users from accidentally clicking it while hidden */
    transform: translateY(-10px);
    transition:
        opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.25s ease;
    z-index: 100;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);
}

.user-header-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Re-enables clicking when open */
    transform: translateY(0);
}

/* =========================================================
   MOBILE TOGGLE
========================================================= */
.user-header-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.user-header-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: #111;
    border-radius: 20px;
    transition: all 0.3s ease;
}

/* =========================================================
   MOBILE MENU
========================================================= */
.user-mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 290px;
    max-width: 85%;
    height: 100vh;
    background: #fff;
    z-index: 1400;
    padding: 24px 20px;
    transition: left 0.35s ease;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

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

/* =========================================================
   MOBILE OVERLAY
========================================================= */
.user-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    z-index: 1300;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

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

/* =========================================================
   MOBILE MENU HEADER
========================================================= */
.user-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.user-mobile-menu-header img {
    width: 130px;
}

.user-mobile-close {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   MOBILE SEARCH & NAVIGATION
   ========================================================= */
.user-mobile-search-form {
    margin-bottom: 18px;
}

.user-mobile-search {
    position: relative;
}

.user-mobile-search input {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    padding: 0 46px 0 16px;
    font-size: 14px;
    background: #fafafa;
    outline: none;
}

.user-mobile-search input:focus {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    border-color: #111;
    background: #fff;
}

.user-mobile-search button {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.user-mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-mobile-menu-links a {
    text-decoration: none;
    color: #111;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 16px;
    border-radius: 14px;
    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.user-mobile-menu-links a:hover {
    background: #f7f7f7;
    transform: translateX(3px);
}

.mobile-logout {
    color: #d11a2a !important;
}

/* =========================================================
   STICKY EFFECT (Optimized for smooth structural tracking)
   ========================================================= */
.user-header {
    transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.user-header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    border-color: rgba(230, 230, 230, 0.4);
}

/* Shrink the inner wrapper container context smoothly */
.user-header.scrolled .user-header-desktop {
    height: 72px;
}

/* =========================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================= */
@media (max-width: 1200px) {
    .user-header-search-input {
        width: 200px;
    }

    .user-header-search-input:focus {
        width: 220px;
    }

    .user-header-menu {
        gap: 24px;
    }
}

@media (max-width: 991px) {
    body {
        padding-top: 72px;
    }

    .user-header {
        display: block;
    }

    .user-header-desktop {
        height: 72px;
    }

    /* Prevent the scroll toggle from shrinking the layout too far on small screens */
    .user-header.scrolled .user-header-desktop {
        height: 72px;
    }

    .user-header-container {
        gap: 12px;
    }

    .user-header-menu-wrapper {
        display: none;
    }

    .user-header-search-form {
        display: none;
    }

    .user-header-mobile-toggle {
        display: flex;
    }

    .user-header-logo img {
        width: 120px;
    }

    .user-header-icons {
        gap: 2px;
    }

    .user-header-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .user-header-dropdown {
        width: 200px;
    }

    .user-mobile-menu {
        width: 260px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 68px;
    }

    .user-header-desktop {
        height: 68px;
    }

    .user-header.scrolled .user-header-desktop {
        height: 68px;
    }

    .user-header-logo img {
        width: 105px;
    }

    .user-header-icon {
        width: 38px;
        height: 38px;
    }

    .user-header-icon i {
        font-size: 17px;
    }

    .user-mobile-menu {
        width: 240px;
    }
}

/* =========================================================
   ACCESSIBILITY & UTILITY COMPONENTS
   ========================================================= */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Container alignment */
.user-header-login-wrapper {
    display: flex;
    align-items: center;
    padding: 0 10px;
}

/* Modern Button Styling */
.user-header-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 20px;
    box-shadow:
        0 4px 6px -1px rgba(79, 70, 229, 0.2),
        0 2px 4px -1px rgba(79, 70, 229, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Accent line over the top edge of the button */
.user-header-login-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

/* Interactive Hover Effects */
.user-header-login-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.user-header-login-btn:hover::before {
    transform: translateX(100%);
}

.user-header-login-btn:active {
    transform: translateY(0);
}

/* Icon Animation */
.user-header-login-btn i {
    transition: transform 0.2s ease;
}

.user-header-login-btn:hover i {
    transform: translateX(3px);
}

/* //dropdown Menu */
/* =========================================================
   FIXED DROPDOWN STRUCTURE & ROW LINKS
   ========================================================= */
.user-header-dropdown {
    position: absolute;
    top: 58px;
    right: 0;
    width: 220px;
    background: #fff;
    border-radius: 18px;
    padding: 10px;
    /* Layout engine defaults */
    display: flex !important;
    /* Force items into a flexbox column stack */
    flex-direction: column;
    gap: 4px;
    /* Visibility animation engine properties */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
        opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.25s ease;
    z-index: 100;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);
}

/* This class triggers smoothly from your JS file layout */
.user-header-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Force each option onto a clean independent padded row link block */
.user-header-dropdown-link {
    display: flex !important;
    /* Force row structural flow layout */
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    /* Completely strip the blue hyperlink underline */
    color: #222 !important;
    /* Overwrite native blue browser links color */
    font-size: 14px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 12px;
    transition:
        background-color 0.25s ease,
        color 0.25s ease;
    width: 100%;
    box-sizing: border-box;
    /* Lock padding boundaries safely */
}

/* Alignment fixes for font-awesome indicators */
.user-header-dropdown-link i {
    width: 20px;
    /* Lock icons down to an identical baseline column line layout */
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f1f1f;
    /* Give icons a standard dark grey accent tint */
}

.user-header-dropdown-link:hover {
    background: #f5f5f5;
    color: #000 !important;
}

/* Specialized color treatment fallback for the exit action block */
.user-header-logout {
    color: #d11a2a !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    /* Clean decorative line anchor break */
    margin-top: 4px;
    padding-top: 12px;
}

.user-header-logout i {
    color: #d11a2a !important;
}