/* Navbar Scroll Behavior */
.hidden-nav {
    transform: translateY(-100%);
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: white;
    z-index: 40;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu-overlay.open {
    transform: translateX(0);
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.scale-up {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Utility Animations */
@keyframes bounce-y {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce-y {
    animation: bounce-y 2s infinite;
}

/* Force hide mobile button on desktop */
@media (min-width: 768px) {
    #mobile-menu-btn {
        display: none !important;
    }
}

/* Project Navigation Styles */
#project-navigation {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#prev-project-link, #next-project-link {
    transition: all 0.3s ease;
}

#prev-project-link:hover {
    transform: translateX(-4px);
}

#next-project-link:hover {
    transform: translateX(4px);
}

/* Responsive adjustments for project navigation */
@media (max-width: 768px) {
    #project-navigation {
        margin-top: 3rem;
        padding-top: 2rem;
    }
    
    #prev-project-link, #next-project-link {
        padding: 1rem 0;
        border-bottom: 1px solid #f5f5f5;
    }
    
    #prev-project-link:last-child, #next-project-link:last-child {
        border-bottom: none;
    }
}

/* Back to Top Button Styles */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

#back-to-top:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

#back-to-top:hover i {
    color: #000;
}

/* Responsive adjustments for back to top button */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 6rem;
        right: 1.5rem;
        padding: 0.75rem;
    }
    
    #back-to-top i {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Responsive adjustments for hero scroll indicator */
@media (max-width: 768px) {
    .hero-scroll {
        bottom: 4rem;
    }
    
    .hero-title {
        font-size: 4rem;
        line-height: 1;
        margin-bottom: 2rem;
    }
    
    #about {
        min-height: 90vh;
        padding-top: 10rem;
        justify-content: flex-start;
    }
    
    .hero-subtitle {
        margin-bottom: 4rem;
    }
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* 控制层：始终悬浮在最上层 */
.lightbox-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    pointer-events: none;
}

.lightbox-controls > * {
    pointer-events: auto;
}

/* 图片滑动容器：微信风格 */
.lightbox-slider {
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 100%;
    display: flex;
    z-index: 100;
    touch-action: none;
    transition: transform 0s linear;
}

.lightbox-slide {
    width: 33.333%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lightbox-slide-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    pointer-events: auto;
    transform-origin: center center;
    will-change: transform;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav i {
    color: white;
    width: 24px;
    height: 24px;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* PC端优化：不遮挡图片内容 */
@media (min-width: 769px) {
    .lightbox-slider {
        left: 0;
        width: 100%;
    }
    
    .lightbox-slide {
        width: 100%;
    }
    
    .lightbox-slide-img {
        max-width: calc(100% - 160px);
        max-height: calc(100% - 100px);
    }
    
    .lightbox-nav {
        width: 50px;
        height: 80px;
        border-radius: 8px;
    }
    
    .lightbox-nav.prev {
        left: 15px;
    }
    
    .lightbox-nav.next {
        right: 15px;
    }
    
    .lightbox-counter {
        bottom: 15px;
    }
}

/* Image cursor for gallery */
.gallery-image {
    cursor: zoom-in;
}

/* Touch swipe hint animation */
@keyframes swipe-hint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.swipe-hint-left {
    animation: swipe-hint 1s ease-in-out infinite;
}

.swipe-hint-right {
    animation: swipe-hint 1s ease-in-out infinite reverse;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
    
    .lightbox-image {
        max-width: 95%;
        max-height: 85%;
    }
}
