/* ===================================
   MOBILE MENU STYLES
   =================================== */

/* Hamburger Menu Button - Hidden on Desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: #ffffff;
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
}

/* Hamburger Animation when Active */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Desktop Navigation - Default State */
.nav-menu {
    display: flex;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ===================================
   TABLET STYLES (768px - 1024px)
   =================================== */

@media (max-width: 1024px) and (min-width: 769px) {
    .nav-menu {
        gap: 30px;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
    }
}

/* ===================================
   MOBILE STYLES (max-width: 768px)
   =================================== */

@media (max-width: 768px) {
    /* Show Hamburger Button */
    .hamburger {
        display: flex;
    }
    
    /* Transform Desktop Menu to Mobile Menu */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0;
        padding: 100px 30px 40px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        transition: right 0.4s ease;
        z-index: 1000;
        overflow-y: auto;
        margin: 0;
    }
    
    /* Show Mobile Menu when Active */
    .nav-menu.active {
        right: 0;
    }
    
    /* Mobile Menu List Items */
    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
        padding: 0;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    /* Mobile Menu Links */
    .nav-menu a {
        display: block;
        padding: 20px 0;
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.3s ease;
        text-decoration: none;
    }
    
    .nav-menu a:hover,
    .nav-menu a:focus {
        color: #ffffff;
        padding-left: 10px;
        background: rgba(139, 92, 246, 0.1);
    }
    
    /* Prevent Body Scroll When Menu is Open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ===================================
   SMALL MOBILE STYLES (max-width: 480px)
   =================================== */

@media (max-width: 480px) {
    .hamburger {
        width: 26px;
        height: 20px;
    }
    
    .nav-menu {
        width: 260px;
        padding: 80px 25px 30px;
    }
    
    .nav-menu a {
        font-size: 0.95rem;
        padding: 18px 0;
    }
}

/* ===================================
   ACCESSIBILITY & INTERACTIONS
   =================================== */

/* Focus States */
.hamburger:focus {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 4px;
}

.nav-menu a:focus {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 2px;
}

/* Smooth Scrolling Adjustment for Fixed Nav */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }
}

/* Ensure Menu is Above Other Elements */
.nav {
    z-index: 1000;
}

.hamburger {
    z-index: 1001;
}

.mobile-menu-overlay {
    z-index: 999;
}

.nav-menu {
    z-index: 1000;
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .hamburger,
    .mobile-menu-overlay {
        display: none;
    }
    
    .nav-menu {
        position: static;
        display: flex;
        flex-direction: row;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
}