/* Full-page Stacked Scrolling Styles - Fixed Layout Version */

/* Main Container for Stacked Sections - Now inside layout-content */
#stacked-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Individual Section Styles */
.stacked-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    transition: background-color 0.5s ease;
    padding: 1rem 0;
}

/* Section Content Wrapper - Handles internal scrolling if needed */
.stacked-section-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.stacked-section-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Vertical Centering Helper */
.section-vertical-center {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: min-content;
    padding: 2rem 0;
}

/* Active Section State */
.stacked-section.active {
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
}

/* Inactive Section State */
.stacked-section:not(.active) {
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

/* Scroll Indicators */
.scroll-indicator {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    animation: bounce 2s infinite;
    pointer-events: none;
}

.scroll-indicator span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Section Navigation Dots */
.section-nav {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 90;
}

.section-nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.section-nav-dot:hover {
    background: var(--primary);
    transform: scale(1.2);
}

.section-nav-dot.active {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.3);
}

/* ============================================
   MOBILE & TABLET RESPONSIVE STYLES
   ============================================ */

/* Tablet Styles */
@media (max-width: 1024px) {
    .stacked-section {
        /* Allow content to scroll naturally on tablet */
        justify-content: flex-start;
        align-items: stretch;
    }
    
    .stacked-section-content {
        justify-content: flex-start;
        /* Enable momentum scrolling */
        -webkit-overflow-scrolling: touch;
    }
    
    .section-vertical-center {
        justify-content: flex-start;
        padding-top: 1.5rem;
        padding-bottom: 2rem;
        min-height: 100%;
        flex-shrink: 0;
    }
    
    /* Ensure content has enough space */
    .section-vertical-center > .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .section-nav {
        right: 0.75rem;
        gap: 0.5rem;
        /* Make dots smaller and less intrusive */
        opacity: 0.7;
    }
    
    .section-nav-dot {
        width: 8px;
        height: 8px;
    }
    
    .stacked-section {
        padding: 0;
        /* Remove centering on mobile - content flows from top */
        justify-content: flex-start;
        align-items: stretch;
    }
    
    .stacked-section-content {
        justify-content: flex-start;
        /* Smooth scrolling for mobile */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .section-vertical-center {
        justify-content: flex-start;
        padding: 1rem 0;
        min-height: 100%;
        /* Ensure content doesn't get cut off */
        flex-shrink: 0;
    }
    
    /* Hero section specific mobile adjustments */
    #hero .section-vertical-center {
        min-height: 100%;
        padding-top: 1rem;
    }
    
    /* Ensure all sections have proper spacing */
    .stacked-section .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hide scroll indicator on mobile */
    .scroll-indicator {
        display: none;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .section-nav {
        right: 0.5rem;
        gap: 0.4rem;
    }
    
    .section-nav-dot {
        width: 6px;
        height: 6px;
    }
    
    .stacked-section {
        padding: 0;
    }
    
    .section-vertical-center {
        padding: 0.75rem 0;
    }
    
    .stacked-section .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .stacked-section {
        /* In landscape, ensure content fits */
        justify-content: flex-start;
    }
    
    .section-vertical-center {
        padding-top: 0.5rem;
        padding-bottom: 1rem;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .stacked-section {
        transition: opacity 0.3s ease;
    }
    
    .scroll-indicator {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .stacked-section {
        position: relative;
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
        page-break-after: always;
        height: auto;
        min-height: 100vh;
    }
    
    .section-nav {
        display: none;
    }
}
