/* ================= Header Base ================= */
.chf-header {
    width: 100%;
    background: #293445;
    border-bottom: 1px solid #1f2a38;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.chf-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

/* ================= Logo ================= */
.chf-logo img {
    max-height: 35px;
    transition: transform 0.3s;
}
.chf-logo img:hover {
    transform: scale(1.05);
}

/* ================= Navigation ================= */
.chf-nav {
    flex: 1;
    margin-left: 40px;
}
.chf-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
.chf-menu li {
    margin: 0 15px;
    position: relative;
}
.chf-menu li a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    padding: 10px 0;
    transition: color 0.3s;
}
/* Underline hover effect */
.chf-menu li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background: gold;
    transition: 0.3s;
}
.chf-menu li a:hover {
    color: gold;
}
.chf-menu li a:hover::after {
    width: 100%;
}

/* ================= ACTIVE MENU ITEM ================= */
.chf-menu li a.active {
    color: gold;
}
.chf-menu li a.active::after {
    width: 100%;
    background: gold;
}

/* ================= User Buttons ================= */
.chf-user-buttons {
    display: flex;
    gap: 12px;
}

/* Login Button */
.chf-btn-login {
    padding: 8px 20px;
    border-radius: 25px;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}
.chf-btn-login:hover {
    background: rgba(255,255,255,0.15);
    color: gold;
    transform: scale(1.03);
}

/* Signup Button */
.chf-btn-signup {
    padding: 8px 22px;
    border-radius: 25px;
    background: gold;
    color: #000;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}
.chf-btn-signup:hover {
    background: #f0b700;
    color: #000;
    transform: scale(1.03);
}

/* ================= Hamburger ================= */
.chf-hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}
.chf-hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    display: block;
}

/* ================= TABLET & MOBILE (1024px and below) ================= */
@media screen and (max-width: 1024px) {
    /* Hide regular navigation on tablet & mobile */
    .chf-nav {
        display: none;
    }
    
    /* Show hamburger on tablet & mobile */
    .chf-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        order: 1;
        z-index: 10001;
        margin-left: 0;
    }

    .chf-hamburger span {
        width: 25px;
        height: 3px;
        background: #fff;
        display: block;
        transition: all 0.4s ease;
        transform-origin: center;
    }

    /* Hamburger animation */
    .chf-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .chf-hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .chf-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Logo centered in header - Adjusted to the left */
    .chf-logo {
        position: absolute;
        left: 45%; /* Changed from 50% to 45% to move left */
        transform: translateX(-50%);
        order: 2;
        z-index: 10001;
    }

    /* Login button on right */
    .chf-user-buttons {
        order: 3;
        margin: 0;
        display: flex;
        gap: 10px;
        z-index: 10001;
    }

    /* Adjust header inner for tablet & mobile */
    .chf-header-inner {
        position: relative;
        padding: 12px 15px;
        height: 60px;
        box-sizing: border-box;
    }

    /* ================= Mobile Menu ================= */
    .chf-nav {
        position: fixed;
        top: 60px !important; /* FIXED: Start below header */
        left: -100%;
        width: 100%;
        min-height: auto;
        max-height: calc(100vh - 60px);
        background: #293445;
        flex-direction: column;
        transition: left 0.4s ease;
        z-index: 9999;
        padding-top: 20px;
        box-sizing: border-box;
        box-shadow: 3px 0 15px rgba(0,0,0,0.2);
        overflow-y: auto;
        margin: 0;
        display: flex;
        align-items: flex-start;
    }

    .chf-nav.active {
        left: 0;
        display: flex; /* Show when active */
    }

    .chf-menu {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        flex: none;
    }

    .chf-menu li {
        margin: 0;
        width: 100%;
    }

    .chf-menu li a {
        display: block;
        padding: 15px 20px;
        color: #fff;
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid #1f2a38;
        position: relative;
        transition: all 0.3s;
        width: 100%;
        box-sizing: border-box;
    }

    /* Remove the underline hover effect for mobile/tablet */
    .chf-menu li a::after {
        display: none;
    }
    
    /* Active state for mobile menu */
    .chf-menu li a.active {
        color: gold;
        background: rgba(255, 215, 0, 0.1);
        border-left: 4px solid gold;
    }

    /* Add hover effect for mobile/tablet menu items */
    .chf-menu li a:hover,
    .chf-menu li a:active {
        background: rgba(255, 255, 255, 0.1);
        color: gold;
    }

    /* Optional: Add padding bottom to menu */
    .chf-menu::after {
        content: '';
        display: block;
        height: 20px;
    }

    /* Semi-transparent overlay */
    .chf-nav::before {
        content: '';
        position: fixed;
        top: 60px !important; /* FIXED: Start below header */
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
    }
    
    .chf-nav.active::before {
        opacity: 1;
        pointer-events: auto;
    }

    /* Prevent body scroll when menu is active */
    body.menu-active {
        overflow: hidden;
    }
}

/* ================= TABLET SPECIFIC (769px - 1024px) ================= */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Keep desktop logo size on tablets */
    .chf-logo img {
        max-height: 35px; /* Same as desktop */
    }
    
    /* Show both login and signup buttons on tablets */
    .chf-btn-signup {
        display: block; /* Show signup on tablets */
    }
    
    /* Adjust button sizes for tablets */
    .chf-btn-login,
    .chf-btn-signup {
        padding: 7px 18px;
        font-size: 14px;
    }
    
    /* Slightly adjust logo position for tablets */
    .chf-logo {
        left: 47%;
    }
}

/* ================= MOBILE SPECIFIC (768px and below) ================= */
@media screen and (max-width: 768px) {
    /* Reduced logo size on mobile */
    .chf-logo img {
        max-height: 28px;
    }
    
    /* Hide signup in mobile header */
    .chf-btn-signup {
        display: none;
    }
    
    /* Adjust logo position for mobile */
    .chf-logo {
        left: 45%;
    }
    
    /* ================= Extra Small Screens ================= */
    @media screen and (max-width: 480px) {
        .chf-logo img {
            max-height: 24px;
        }
        /* Adjust logo position even more for very small screens */
        .chf-logo {
            left: 46%; /* Even more to the left on very small screens */
        }
        .chf-btn-login {
            padding: 6px 15px;
            font-size: 14px;
        }
    }
}
/* ================= DESKTOP VIEW (1025px and above) ================= */
@media screen and (min-width: 1025px) {
    /* Ensure hamburger is hidden on desktop */
    .chf-hamburger {
        display: none !important;
    }
    
    /* Ensure regular navigation is shown on desktop */
    .chf-nav {
        display: flex !important;
    }
}

/* ================= User Section ================= */
.chf-user-section {
    display: flex;
    align-items: center;
}

/* ================= Desktop Dropdown ================= */
.chf-user-dropdown {
    position: relative;
}

.chf-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 25px;
    transition: all 0.3s;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.chf-user-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chf-user-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.chf-user-name {
    font-size: 14px;
}

.chf-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.chf-user-dropdown:hover .chf-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.chf-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #293445;
    border: 1px solid #1f2a38;
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.chf-user-dropdown:hover .chf-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chf-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.chf-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: gold;
}

.chf-dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.chf-dropdown-divider {
    height: 1px;
    background: #1f2a38;
    margin: 8px 0;
}

.chf-dropdown-logout {
    color: #ff6b6b;
}

.chf-dropdown-logout:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* ================= Mobile User Menu ================= */
.chf-mobile-user {
    display: none;
}

.chf-mobile-user-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chf-mobile-user-toggle img {
    width: 40px; /* Increased from 35px */
    height: 40px; /* Increased from 35px */
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3); /* Add border */
}

/* Mobile User Menu Panel - FIXED */
.chf-mobile-user-menu {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 280px; /* Slightly smaller for better fit */
    height: calc(100vh - 60px);
    background: #293445;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.chf-mobile-user-menu.active {
    right: 0;
}

/* Mobile User Header - FIXED */
.chf-mobile-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px; /* Reduced right padding */
    background: #1f2a38;
    border-bottom: 1px solid #2a384b;
}

.chf-mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced gap */
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.chf-mobile-avatar {
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

.chf-mobile-avatar img {
    width: 50px; /* Reduced from 60px */
    height: 50px; /* Reduced from 60px */
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chf-mobile-user-details {
    flex: 1;
    min-width: 0; /* Allows text to truncate */
    overflow: hidden; /* Prevents overflow */
}

.chf-mobile-user-details h4 {
    color: #fff;
    margin: 0 0 3px 0; /* Reduced margin */
    font-size: 15px; /* Slightly smaller */
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chf-mobile-user-details p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 12px; /* Smaller */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chf-mobile-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px; /* Slightly smaller */
    cursor: pointer;
    padding: 0;
    width: 36px; /* Smaller */
    height: 36px; /* Smaller */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
    flex-shrink: 0; /* Prevent close button from shrinking */
    margin-left: 5px; /* Small margin */
}

.chf-mobile-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile User Content */
.chf-mobile-user-content {
    padding: 15px 0; /* Reduced padding */
}

.chf-mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced gap */
    padding: 14px 20px; /* Adjusted padding */
    color: #fff;
    text-decoration: none;
    font-size: 14px; /* Slightly smaller */
    border-left: 4px solid transparent;
    transition: all 0.3s;
}

.chf-mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: gold;
    border-left-color: gold;
}

.chf-mobile-icon {
    font-size: 16px; /* Slightly smaller */
    width: 20px; /* Smaller */
    text-align: center;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.chf-mobile-divider {
    height: 1px;
    background: #1f2a38;
    margin: 10px 20px; /* Reduced margin */
}

.chf-mobile-logout {
    color: #ff6b6b;
}

.chf-mobile-logout:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
}

/* For very small screens */
@media screen and (max-width: 380px) {
    .chf-mobile-user-menu {
        width: 260px; /* Even smaller on tiny screens */
    }
    
    .chf-mobile-avatar img {
        width: 45px;
        height: 45px;
    }
    
    .chf-mobile-user-details h4 {
        font-size: 14px;
    }
    
    .chf-mobile-user-details p {
        font-size: 11px;
    }
}

/* ================= Responsive ================= */
@media screen and (max-width: 1024px) {
    /* Hide desktop dropdown on mobile/tablet */
    .chf-user-dropdown {
        display: none;
    }
    
    /* Show mobile user icon */
    .chf-mobile-user {
        display: block;
        order: 3;
        margin-left: 10px;
    }
    
    /* Hide regular user buttons when logged in */
    .chf-user-buttons {
        order: 3;
    }
    
    /* Adjust header for mobile user */
    .chf-header-inner {
        position: relative;
    }
    
    .chf-hamburger {
        order: 1;
    }
    
    .chf-logo {
        order: 2;
    }
    
    /* When logged out, show buttons normally */
    .chf-user-section .chf-user-buttons {
        order: 3;
    }
}

@media screen and (min-width: 1025px) {
    /* Hide mobile user on desktop */
    .chf-mobile-user {
        display: none !important;
    }
}
/* ================= Responsive Width Management ================= */
@media screen and (min-width: 1200px) {
    .chf-header-inner {
        max-width: 1400px;
        padding: 12px 40px;
    }
    
    .chf-nav {
        margin-left: 80px;
    }
    
    .chf-menu li {
        margin: 0 25px;
    }
}

@media screen and (min-width: 1400px) {
    .chf-header-inner {
        max-width: 1600px;
        padding: 12px 50px;
    }
    
    .chf-menu li {
        margin: 0 30px;
    }
}