/* Mobile Navigation Styles */

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* Hamburger Animation when active */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    opacity: 0;
    pointer-events: none; /* CRITICAL FIX: Prevent clicks when hidden */
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto; /* CRITICAL FIX: Allow clicks when visible */
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.mobile-nav-menu .ButtonClass {
    width: 80%;
    max-width: 300px;
    margin: 10px 0;
    padding: 15px 20px;
    font-size: 18px;
    background-color: #333;
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-nav-menu .ButtonClass:hover,
.mobile-nav-menu .ButtonClass:focus {
    background-color: white;
    color: #333;
    transform: scale(1.05);
}

/* Desktop Navigation Styles */
#Buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ButtonClass {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ButtonClass:hover,
.ButtonClass:focus {
    background-color: white;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Header adjustments */
#Header {
    background-color: black;
    padding: 10px 0;
}

#Title {
    display: flex;
    align-items: center;
    padding: 0 30px;
}

#Logo {
    cursor: pointer;
    transition: transform 0.3s ease;
}

#Logo:hover {
    transform: scale(1.1);
}

/* Mobile Responsive Breakpoints */
@media screen and (max-width: 768px) {
    /* Show hamburger menu */
    .hamburger {
        display: flex;
        position: absolute;
        top: 30px;
        right: 20px;
    }
    
    /* Hide desktop navigation */
    #Buttons {
        display: none !important;
    }
    
    /* Show mobile overlay when active */
    .mobile-nav-overlay {
        display: block;
    }
    
    /* Adjust header */
    #Title {
        padding: 10px 20px;
        justify-content: center;
    }
    
    #Logo {
        height: 60px;
        width: 60px;
        margin-right: 15px;
    }
    
    #WebsiteTitle {
        font-size: 24px;
        padding-top: 0;
    }
    
    h1 {
        padding: 0;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Tablet adjustments */
    .ButtonClass {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    #Buttons {
        gap: 8px;
        padding: 0 20px 15px 20px;
    }
}

@media screen and (max-width: 480px) {
    /* Small mobile adjustments */
    #WebsiteTitle {
        font-size: 20px;
    }
    
    #Logo {
        height: 50px;
        width: 50px;
        margin-right: 10px;
    }
    
    .mobile-nav-menu .ButtonClass {
        width: 90%;
        font-size: 16px;
        padding: 12px 15px;
    }
}

/* Accessibility improvements */
.ButtonClass:focus,
.hamburger:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

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