/* Mobile Navigation Styles */
.hamburger-menu {
    display: none;
    background: rgba(0, 0, 0, 0.85); /* Changed to black for better contrast */
    border: 1px solid rgba(212, 175, 55, 0.3); /* Subtle gold border */
    cursor: pointer;
    padding: 12px;
    z-index: 1000;
    position: absolute;
    top: 20px;
    right: 20px;
    transition: all 0.3s ease;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hamburger-line {
    display: block;
    width: 30px;
    height: 3px;
    margin: 6px 0;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.hamburger-menu.active {
    position: fixed;
    top: 15px;
    right: 25px;
    z-index: 10000; /* Increased z-index to ensure X icon is always above the mobile menu */
    transform: translateZ(0); /* Create a new stacking context */
}

.hamburger-menu:hover {
    background: rgba(0, 0, 0, 0.95); /* Darker black on hover */
    border-color: rgba(212, 175, 55, 0.8); /* More visible gold border on hover */
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .hamburger-menu {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(139, 0, 0, 0.95), rgba(165, 42, 42, 0.9)); /* Enhanced gradient for better visibility */
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M10 10L90 90M90 10L10 90" stroke="rgba(255,255,255,0.08)" stroke-width="2"/></svg>');
        background-size: 20px 20px;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 60px; /* Reduced padding-top to prevent overlap with X icon */
        margin-top: 50px; /* Added margin-top to create space for the X icon */
        transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: -8px 0 25px rgba(0, 0, 0, 0.45);
        z-index: 1002; /* Increased z-index to be above the logo */
        overflow-y: auto;
    }
    
    .main-nav.nav-open {
        right: 0;
        animation: menuFadeIn 0.5s ease forwards;
    }
    
    @keyframes menuFadeIn {
        from { opacity: 0.8; }
        to { opacity: 1; }
    }
    
    .main-nav a {
        display: block;
        padding: 16px 25px;
        font-size: 1.1rem;
        text-align: left;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        color: white;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
        transition: all 0.3s ease;
    }
    
    .main-nav a:hover, .main-nav a.active {
        background-color: rgba(255, 255, 255, 0.15);
        padding-left: 30px;
        border-left: 4px solid var(--accent-color);
        color: var(--accent-color);
        text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    }
    
    .main-nav a::before {
        display: none;
    }
    
    body.nav-active {
        overflow: hidden;
    }
    
    /* Add a subtle overlay when menu is open */
    body.nav-active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4); /* Reduced opacity for lighter overlay */
        z-index: 997; /* Decreased z-index to be below the mobile menu */
        animation: fadeIn 0.3s ease forwards;
        pointer-events: none; /* Allow clicks to pass through to elements beneath */
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1010; /* Increased to be higher than logo */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
}

/* Mobile navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(139, 0, 0, 0.9)); /* Black and dark red gradient */
    border-top: 3px solid var(--accent-color); /* Gold accent border */
    z-index: 1010; /* Increased to be higher than logo */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}