/* Zine-inspired styling for the interactive zine */

/* Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(30, 41, 43, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #333;
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
}

.nav-tab {
    background: none;
    border: 2px solid #333;
    border-right: none;
    color: #ffa9a9;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    background-color: #2a3739;
}

.nav-tab:last-child {
    border-right: 2px solid #333;
}

.nav-tab:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.nav-tab:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.nav-tab:hover {
    background-color: #3a4749;
    color: #feef00;
    box-shadow: inset 0 0 10px rgba(255, 239, 0, 0.1);
}

.nav-tab.active {
    background-color: #feef00;
    color: #1e292b;
    box-shadow: 0 0 15px rgba(255, 239, 0, 0.3);
}

/* Main sections */
.main-section {
    display: none;
    padding-top: 60px; /* Account for fixed nav */
}

.main-section.active {
    display: block;
}

/* Mobile scroll sensitivity fix */
.scrolly-container {
    /* Reduce momentum scrolling on mobile */
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: contain;
}

/* Mobile responsiveness for navigation */
@media (max-width: 768px) {
    .nav-tab {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        letter-spacing: 0.5px;
    }
    
    .main-section {
        padding-top: 50px;
    }
    
    /* Mobile-specific scroll dampening */
    .scrolly-container {
        scroll-behavior: auto;
        overscroll-behavior-y: contain;
    }
    
    /* Increase scroll space on mobile to reduce sensitivity */
    .scroll-space {
        height: 500vh; /* Further increased from 400vh for even less sensitivity */
    }
}

/* Basic page reset */
body {
    margin: 0;
    font-family: 'IBM Plex Mono', 'Courier New', monospace, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #1e292b; /* Updated to match new SVG background */
    background-image: url("noise.svg");
    background-size: 700px 700px; /* Updated to match new SVG size */
    background-repeat: repeat;
    color: #333;
    line-height: 1.6;
}

/* Opening page */
.opening-page {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.bike-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bike-image {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border: 3px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 3;
}

.scroll-arrow {
    font-size: 2rem;
    animation: bounce 2s infinite;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

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

/* Text sections */
.text-section {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.text-content {
    background-color: #2a3739;
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.text-content h2 {
    font-size: 2rem;
    font-weight: bold;
    color: #feef00;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
}

.text-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ffa9a9;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Journey section text - increase font weight */
#journey-section .text-content p {
    font-weight: 700;
}

/* Video sections */
.video-section {
    margin: 2rem 0;
}

.video-placeholder {
    height: 400px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px dashed #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    border-radius: 8px;
}

.video-placeholder p {
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
}

/* The Scrolly Container */
.scrolly-container {
    position: relative;
}

/* The Video Div */
#scrolly-video {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    object-fit: cover;
    border: 3px solid #333; /* Zine-style border */
}

#scrolly-video-2 {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    object-fit: cover;
    border: 3px solid #333; /* Zine-style border */
}

/* Chrome-specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    #scrolly-video video {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    #scrolly-video canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    #scrolly-video-2 video {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    #scrolly-video-2 canvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }
}

/* Scroll space to enable scrolling */
.scroll-space {
    height: 300vh; /* 3x viewport height for smooth scrolling */
    width: 100%;
}

/* Custom scrollbar for zine feel */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1e292b; /* Match the new background color */
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 6px;
    border: 2px solid #1e292b;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
} 

/* Layered image section */
#layered-section, #layered-section-2 {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    border: 3px solid #333; /* Zine-style border like the videos */
}


.layered-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.layer-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border: none; /* Remove border since the container has one */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); /* Reduced shadow intensity and spread */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.base-layer {
    opacity: 1;
}

.scroll-layer {
    opacity: 0;
}

.scroll-layer.visible {
    opacity: 1;
}

/* Interactive Bike Setup Page */
.interactive-page-section {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #333;
    background: #1e292b;
    background-image: url("noise.svg");
    background-size: 700px 700px;
    background-repeat: repeat;
}

.interactive-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper {
    position: relative;
    display: inline-block;
}

.interactive-bike-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Hotspot styles */
.hotspot {
    position: absolute;
    cursor: pointer;
    z-index: 10;
}

.hotspot-dot {
    width: 14px;
    height: 14px;
    background: #feef00;
    border: 1px solid #333;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 0 rgba(254, 239, 0, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(254, 239, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(254, 239, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(254, 239, 0, 0);
    }
}

.hotspot:hover .hotspot-dot {
    transform: scale(1.2);
    background: #fff;
    animation: none;
}

/* Label styles */
.hotspot-label {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 20;
}

.hotspot.active .hotspot-label,
.hotspot:hover .hotspot-label {
    opacity: 1;
    visibility: visible;
}

.label-text {
    background: rgba(30, 41, 43, 0.4);
    color: #feef00;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* SVG curve container */
.curve-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
}

.curve-line {
    stroke: #feef00;
    stroke-width: 2;
    fill: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.label-line {
    display: none;
}

/* Universal label positioning - centered on screen, above horizon */
.hotspot-label {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 400px;
}

/* Line positioning - connects dot to label bottom center */
.hotspot .label-line {
    width: 2px;
    height: 0px;
}

/* Vertical line from dot to turn point */
.hotspot .label-line::before {
    bottom: 0;
    left: 0;
}

/* Horizontal line from turn point to label */
.hotspot .label-line::after {
    bottom: 100%;
    left: var(--horizontal-left, 0);
    width: var(--horizontal-width, 0);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .label-text {
        font-size: 1rem;
        padding: 0.8rem 1rem;
        max-width: 300px;
        white-space: normal;
    }
    
    .hotspot-dot {
        width: 20px;
        height: 20px;
    }
    
    .hotspot-dot {
        width: 16px;
        height: 16px;
    }
    
    /* Adjust label positions for mobile */
    .hotspot[data-label="lights"] .hotspot-label,
    .hotspot[data-label="rail"] .hotspot-label,
    .hotspot[data-label="simworks"] .hotspot-label {
        right: -120px;
    }
}

/* Static Page Section */
.static-page-section {
    width: 100%;
    min-height: 200vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #333;
    background: #1e292b;
    background-image: url("noise.svg");
    background-size: 700px 700px;
    background-repeat: repeat;
    padding: 2rem 0;
}

.static-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.static-tall-image {
    max-width: 50%;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Regular page sections (p5, p6, etc.) - standard height */
.regular-page-section {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #333;
    background: #1e292b;
    background-image: url("noise.svg");
    background-size: 700px 700px;
    background-repeat: repeat;
}

.regular-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Regular static image (for p5, p6, etc.) */
.static-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* X-ray container (P7) */
.xray-container {
    position: relative;
    display: inline-block;
    cursor: crosshair;
}

.xray-base-image, .xray-cover-image {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
}

.xray-base-image {
    position: relative;
    z-index: 1;
}

.xray-cover-image {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    /* Match base image sizing exactly */
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    /* X-ray mask effect */
    mask: radial-gradient(circle 112px at var(--mask-x, 50%) var(--mask-y, 0%), transparent 0px, transparent 90px, black 112px);
    -webkit-mask: radial-gradient(circle 112px at var(--mask-x, 50%) var(--mask-y, 0%), transparent 0px, transparent 90px, black 112px);
    mask-composite: subtract;
    -webkit-mask-composite: xor;
    filter: blur(1px);
    opacity: 0.9;
    transition: mask 0.1s ease, -webkit-mask 0.1s ease, filter 0.1s ease;
}

/* P7 Interactive Markers */
.p7-marker {
    position: absolute;
    cursor: pointer;
    z-index: 15;
}

.p7-marker-dot {
    width: 12px;
    height: 12px;
    background: transparent;
    border: 1px solid rgba(254, 239, 0, 0.75);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.p7-marker:hover .p7-marker-dot {
    transform: scale(1.2);
    animation: none;
}

/* P7 Interactive Labels */
.p7-label {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 20;
    width: max-content;
    max-width: 400px;
}

.p7-label.visible {
    opacity: 1;
    visibility: visible;
}

.p7-label-text {
    background: rgba(30, 41, 43, 0.6);
    color: #feef00;
    font-family: 'Comic Neue', 'Chalkboard SE', 'Bradley Hand', cursive;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
    position: absolute;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-top: -10px;
    margin-left: 10px;
}

/* PREP section comic font styling */
#prep-section {
    font-family: 'Comic Neue', 'Chalkboard SE', 'Bradley Hand', cursive;
    font-weight: bold;
}

#prep-section .label-text {
    font-family: 'Comic Neue', 'Chalkboard SE', 'Bradley Hand', cursive;
    font-weight: bold;
}

/* PREP section ending */
.prep-ending-section {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #333;
    background: #1e292b;
    background-image: url("noise.svg");
    background-size: 700px 700px;
    background-repeat: repeat;
}

.prep-ending-container {
    text-align: center;
    padding: 2rem;
}

.prep-ending-text {
    font-family: 'Comic Neue', 'Chalkboard SE', 'Bradley Hand', cursive;
    font-size: 2rem;
    font-weight: bold;
    color: #feef00;
    text-shadow: 0 0 10px rgba(255, 239, 0, 0.3);
    line-height: 1.4;
    margin: 0;
}

/* Mobile responsive adjustments for static images */
@media (max-width: 768px) {
    .static-page-section {
        min-height: 150vh;
    }
    
    
    .static-tall-image {
        max-width: 100%;
    }
    
    .static-image {
        max-width: 95%;
        max-height: 85vh;
    }
    
    /* Regular page sections stay standard height on mobile too */
    .regular-page-section {
        height: 100vh;
    }
    
    .xray-base-image, .xray-cover-image {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .p7-marker {
        max-width: 80px;
        max-height: 60px;
    }
    
    .p7-label-text {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}