/* ===== Mobile Navigation Styles ===== */

/* Mobile Navigation Button */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-pink), var(--deep-pink));
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(200, 26, 117, 0.4);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.mobile-nav-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(200, 26, 117, 0.6);
}

.mobile-nav-toggle.active {
    background: linear-gradient(135deg, var(--deep-pink), var(--coral-pink));
}

/* Hamburger Icon */
.hamburger {
    width: 30px;
    height: 24px;
    position: relative;
    transition: 0.3s ease-in-out;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 10px;
}

.hamburger span:nth-child(3) {
    top: 20px;
}

.mobile-nav-toggle.active .hamburger span:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
}

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

.mobile-nav-toggle.active .hamburger span:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 防止未激活時捕獲點擊事件 */
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto; /* 只有激活時才能點擊 */
}

/* Mobile Menu Container */
.mobile-menu {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 26, 117, 0.3);
    border-radius: 20px;
    padding: 20px;
    z-index: 9999;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(200, 26, 117, 0.3);
    display: none;
    pointer-events: none; /* 防止未激活時捕獲點擊事件 */
}

.mobile-menu.active {
    transform: scale(1);
    display: block;
    pointer-events: auto; /* 只有激活時才能點擊 */
}

/* Mobile Menu Items */
.mobile-menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    margin: 10px 0;
    opacity: 0;
    transform: translateX(20px);
    animation: fadeInMenu 0.3s ease forwards;
}

.mobile-menu-item:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu-item:nth-child(2) { animation-delay: 0.10s; }
.mobile-menu-item:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu-item:nth-child(4) { animation-delay: 0.20s; }
.mobile-menu-item:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu-item:nth-child(6) { animation-delay: 0.30s; }
.mobile-menu-item:nth-child(7) { animation-delay: 0.35s; }
.mobile-menu-item:nth-child(8) { animation-delay: 0.40s; }
.mobile-menu-item:nth-child(9) { animation-delay: 0.45s; }

@keyframes fadeInMenu {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu-link {
    display: block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(200, 26, 117, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-link:hover {
    background: rgba(200, 26, 117, 0.1);
    color: var(--accent-pink);
    padding-left: 24px;
}

.mobile-menu-link:hover::before {
    left: 100%;
}

/* Mobile Logo in Menu */
.mobile-menu-logo {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(200, 26, 117, 0.2);
}

.mobile-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-pink), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Orbitron', sans-serif;
}

.mobile-logo-subtitle {
    font-size: 0.9rem;
    color: var(--light-pink);
    letter-spacing: 2px;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hide desktop navigation */
    .nav-menu {
        display: none !important;
    }
    
    /* Show mobile navigation button */
    .mobile-nav-toggle {
        display: flex;
    }
    
    /* Mobile menu overlay should be hidden by default */
    .mobile-menu-overlay {
        display: none;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Adjust navbar for mobile */
    .navbar {
        padding: 15px 20px;
    }
    
    .nav-container {
        height: 60px;
    }
    
    /* Smaller logo on mobile navbar */
    .nav-logo svg {
        height: 30px !important;
    }
    
    .logo-subtitle {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .mobile-nav-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .mobile-menu {
        right: 20px;
        bottom: 85px;
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
    }
    
    .hamburger {
        width: 28px;
        height: 22px;
    }
}

/* Accessibility */
.mobile-nav-toggle:focus {
    outline: 2px solid var(--accent-pink);
    outline-offset: 3px;
}

.mobile-menu-link:focus {
    outline: 2px solid var(--accent-pink);
    outline-offset: -2px;
}