/* Header Styles - Custom Implementation */

#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid transparent;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    transition: box-shadow 0.3s ease;
    overflow: visible;
}

#header * {
    box-sizing: border-box;
}

#header:hover {
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.15);
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#header:hover .header-background {
    opacity: 1;
}

.header-nav {
    padding: 1rem 0;
    position: relative;
    z-index: 1001;
    overflow: visible;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: visible;
    gap: 2rem;
}

.header-container > .header-menu {
    flex: 1;
}

.header-container > .header-menu > .menu-item:last-child {
    margin-left: auto;
}

@media (max-width: 1200px) {
    .header-container > .header-menu {
        flex: none;
    }
    
    .header-container > .header-menu > .menu-item:last-child {
        margin-left: 0;
    }
}

@media (max-width: 1200px) {
    .header-container > .header-menu {
        flex: none;
    }
    
    .header-container > .header-menu > .menu-item:last-child {
        margin-left: 0;
    }
}

/* Logo Styles */
.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s ease;
    text-decoration: none;
}

.header-logo:hover {
    transform: scale(1.05);
}

.logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: auto;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.header-logo:hover .logo-img {
    /* Removed color filter for transparent PNG logo */
}

.logo-glow {
    display: none;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.5;
    }
}

/* Menu Styles */
.header-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1002;
    flex: 1;
}

.header-menu .menu-item:last-child {
    margin-left: auto;
}

.menu-item {
    position: relative;
    z-index: auto;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
}

.menu-link i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.menu-link:hover {
    color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    will-change: transform;
}

.menu-link:hover i {
    transform: scale(1.2);
}

.menu-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.menu-link.active i {
    color: #ffffff;
}

/* Login Button - Special button style (refer to become a member button style) */
.menu-link-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border: none;
    position: relative;
    overflow: hidden;
}

.menu-link-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.menu-link-login:hover::before {
    left: 100%;
}

.menu-link-login i {
    color: #ffffff !important;
    transition: transform 0.3s ease;
}

.menu-link-login span {
    color: #ffffff !important;
}

.menu-link-login:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: #ffffff !important;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.menu-link-login:hover i {
    color: #ffffff !important;
    transform: translateX(4px);
}

.menu-link-login:hover span {
    color: #ffffff !important;
}

.menu-link-login:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

/* CTA Button */
.menu-link-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.menu-link-cta i {
    color: #ffffff;
}

.menu-link-cta:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: #ffffff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.menu-link-cta:hover i {
    color: #ffffff;
}

/* Dropdown Menu */
.menu-item-dropdown {
    position: relative;
    z-index: 1003;
    overflow: visible;
}

/* Ensure dropdown parent has proper stacking context */
.menu-item-dropdown .menu-link-dropdown {
    position: relative;
    z-index: 1003;
}

.menu-link-dropdown {
    padding-right: 2rem;
}

.dropdown-arrow {
    font-size: 0.75rem;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.menu-item-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    min-width: 200px;
    max-width: 300px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    padding: 0.5rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1005;
    pointer-events: none;
    white-space: nowrap;
    display: block;
    margin-top: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Ensure dropdown doesn't overflow viewport */
.menu-item-dropdown:last-child .dropdown-menu {
    right: 0;
    left: auto;
}

/* Add a bridge area to prevent gap between menu item and dropdown */
.menu-item-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
    z-index: 1004;
    pointer-events: none;
    display: block;
}

.menu-item-dropdown:hover::after {
    pointer-events: auto;
}

/* Show dropdown when hovering over parent menu item or the dropdown itself */
.menu-item-dropdown:hover .dropdown-menu,
.menu-item-dropdown .dropdown-menu:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    display: block !important;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 2px solid rgba(102, 126, 234, 0.2);
    border-top: 2px solid rgba(102, 126, 234, 0.2);
    transform: rotate(45deg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dropdown-item i {
    color: #667eea;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    padding-left: 2rem;
    transform: translateX(5px);
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

.dropdown-item:hover i {
    transform: scale(1.2);
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: #2c3e50;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Header Decoration */
.header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.decoration-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.3;
    animation: float-dot 6s ease-in-out infinite;
}

.dot-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.dot-2 {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.dot-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float-dot {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(5px, -5px) scale(1.1);
        opacity: 0.6;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .header-nav {
        position: relative;
        width: 100%;
        max-width: 100%;
    }
    
    .header-container {
        flex-wrap: wrap;
        position: relative;
        width: 100%;
        max-width: 100%;
        align-items: center;
        box-sizing: border-box;
    }
    
    .header-logo {
        margin-right: 1rem;
        order: 1;
        flex-shrink: 0;
        flex-basis: auto;
    }
    
    .mobile-toggle {
        display: flex;
        order: 2;
        margin-left: auto;
        flex-shrink: 0;
        flex-basis: auto;
        align-self: center;
    }
    
    .header-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 0.25rem;
        order: 3;
        position: static;
        flex-basis: 100%;
        flex: 1 1 100%;
        align-items: stretch;
        min-width: 0;
    }
    
    .header-menu.active {
        display: flex;
    }
    
    .menu-item {
        width: 100% !important;
        flex-shrink: 0;
        max-width: 100% !important;
    }
    
    .menu-link {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem 1rem;
        justify-content: flex-start;
        box-sizing: border-box;
    }
    
    .menu-item-dropdown {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .menu-link-dropdown {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        margin: 0.5rem 0 0 1.5rem;
        border-left: 3px solid rgba(102, 126, 234, 0.2);
        border-radius: 0;
        min-width: auto;
        width: calc(100% - 1.5rem);
        display: block !important;
        pointer-events: auto;
    }
    
    .dropdown-menu::before {
        display: none;
    }
    
    /* Remove hover effects on mobile */
    .menu-item-dropdown:hover .dropdown-menu {
        display: block !important;
    }
    
    /* Hide the bridge area on mobile */
    .menu-item-dropdown::after {
        display: none;
    }
    
    .dropdown-item {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        border-radius: 6px;
        margin: 0.25rem 0;
    }
    
    .dropdown-item:hover {
        padding-left: 1.5rem;
        transform: translateX(5px);
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    }
    
    .menu-item-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
}
