@font-face {
    font-family: 'Suisse Regular';
    src: url('./public/fonts/Suisse Int\'l/SuisseIntl-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Suisse Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    overflow-x: hidden;
    min-height: 200vh; /* Allow scrolling to trigger panels */
    /* Hide scroll bars */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scroll bar for webkit browsers */
body::-webkit-scrollbar {
    display: none;
}

#app {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* Loading message */
#loading-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

#loading-message.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    font-size: 24px;
    font-weight: normal;
    color: #333333;
    letter-spacing: 1px;
}

/* Border container - fullscreen on load */
#border-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: visible; /* Allow content to extend beyond container */
}

#map-outline-svg {
    position: absolute;
    width: 114%; /* Restored to larger size to extend beyond browser window */
    height: auto;
    max-width: none;
    max-height: none;
    z-index: 1;
    left: 50%; /* Exact same center reference as border SVG */
    top: 50%; /* Must match border SVG exactly */
    transform: translate(-50%, -50%) translate(-12%, -76%); /* Center + offset fine-tuned */
    opacity: 0.3; /* Make it subtle */
    overflow: visible;
}

#border-svg {
    /* position: relative; */
    position: absolute; /* Change to absolute for consistent positioning */
    width: 80%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* Center the border SVG */
    /* width: 80%;
    height: auto;
    max-width: none; */
    z-index: 2;
}

#map-outline-svg path {
    fill: none;
    /* filrgb(2, 81, 55)6a6; */
    /* stroke: #000000; */
    stroke:none;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

#border-svg path {
    fill: none;
    /* stroke: #ff0000; Red color to make it clearly visible for alignment */
    stroke: none; /* Red color to make it clearly visible for alignment */
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

/* Text along outline path */
#outline-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Behind border text but above outline */
}

.outline-char {
    position: absolute;
    font-size: 10px; /* 2 points smaller than border text (12px) */
    font-weight: 400;
    color: #000000;
    user-select: none;
    transition: opacity 0.3s ease;
    opacity: 0.6; /* Slightly more subtle than main border text */
}

/* Text along border path */
#border-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.border-char {
    position: absolute;
    font-size: 12px;
    font-weight: 400;
    color: #000000;
    user-select: none;
    transition: opacity 0.3s ease;
}

/* Hover zones */
#hover-zones {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
}

.hover-zone {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    z-index: 4;
    transition: background-color 0.2s ease;
}

.hover-zone:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Images container */
#images-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 20; /* Above lines container */
    transform: translateZ(1px); /* Force in front of lines in 3D space */
}

.satellite-image {
    position: absolute;
    width: 11.11vw;
    height: auto;
    /* border-radius: 6px; */
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    z-index: 99999; /* EXTREME z-index to force above everything */
}

.satellite-image.visible {
    opacity: 1;
    transform: scale(1);
}

.satellite-image.active {
    border: 2px solid #017D03; /* Green stroke around active image */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Subtle shadow */
    transition: border 0.3s ease, box-shadow 0.3s ease;
}


.satellite-image.fade-out {
    opacity: 0;
    transition: opacity 5s ease;
}

.satellite-image.panel-triggered {
    z-index: 16; /* Highest priority images */
}

.satellite-image.show-all-mode {
    z-index: 14; /* Below panel-triggered but still high */
}

/* Bottom panels */
.panel {
    position: fixed;
    bottom: 0;
    width: 50vw;
    height: 40vh;
    background: rgba(255, 255, 255, 0.7); /* 20% translucent (80% opacity) */
    backdrop-filter: blur(6px); /* 8px blur for background */
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5; /* Back to normal */
}

#info-panel {
    left: 0;
    border-right: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
    overflow: hidden;
}

/* Default desktop behavior - panels visible */
.panel.hidden {
    transform: translateY(100%);
}

/* Mobile behavior - panels completely hidden by default */
@media (max-width: 768px) {
    .panel.hidden {
        transform: translateY(calc(100% + 2px)) !important; /* Extra 2px to hide borders completely */
    }
}

.panel h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

#info-panel h2 {
    text-align: right;
    margin-right: 16px;
}

.panel p {
    line-height: 1.6;
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

#crossings-list {
    list-style: none;
}

.crossing-item {
    padding: 8px 0;
    cursor: pointer;
    line-height: 1.2;
}

.crossing-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.plain-text-info {
    font-family: 'Suisse Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #333;
    font-weight: normal;
    line-height: .8;
    text-align: right;
    white-space: nowrap;
    overflow-x: hidden;
    /* Removed z-index - using natural stacking */
}

/* Connection lines container */
#connections-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 6; /* Above panel (z-index 5) but below images container (z-index 20) */
    transform: translateZ(-1px); /* Force behind images in 3D space */
}

/* MORAKANA logo */
#morakana-logo {
    position: fixed;
    top: 0px;
    right: 20px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    z-index: 11;
    pointer-events: none;
    user-select: none;
}

#morakana-logo img {
    height: 86px;
    width: auto;
    display: block;
}

#morakana-logo.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .panel {
        width: 100vw;
        height: 33.33vh; /* 1/3 of screen height */
    }
    
    #info-panel {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    /* Ensure panels are completely hidden on mobile when they have .hidden class */
    .panel.hidden {
        transform: translateY(calc(100% + 2px)) !important; /* Push completely off-screen */
    }
    
    #border-svg {
        width: 80%;
    }
    
    .border-char {
        font-size: 6px; /* Reduced from 8px */
    }
    
    .outline-char {
        font-size: 5px; /* Reduced from default */
    }
    
    .satellite-image {
        width: 13.33vw;
        height: auto;
    }
    
    /* Larger touch targets for mobile */
    .hover-zone {
        width: 44px !important;
        height: 44px !important;
    }
    
    /* Smaller Morakana logo on mobile */
    #morakana-logo img {
        height: 69px; /* 20% smaller than 86px */
    }
}

@media (max-width: 480px) {
    .panel {
        width: 100vw;
        height: 33.33vh; /* Keep 1/3 height on small screens too */
    }
    
    
    /* Ensure panels are completely hidden on small mobile when they have .hidden class */
    .panel.hidden {
        transform: translateY(calc(100% + 2px)) !important; /* Push completely off-screen */
    }
    
    .border-char {
        font-size: 4px; /* Even smaller for very small screens */
    }
    
    .outline-char {
        font-size: 3px; /* Even smaller for very small screens */
    }
    
    .satellite-image {
        width: 15.56vw;
        height: auto;
    }
    
    /* Maintain touch target size on small screens */
    .hover-zone {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Instructions message and popup - Desktop only */
.instructions-message {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: black;
    font-size: 14px;
    font-family: Arial, sans-serif;
    font-style: italic;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.instructions-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: black;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    line-height: 1.4;
}

.instructions-popup div {
    margin-bottom: 8px;
}

/* Hide instructions on mobile */
@media (max-width: 768px) {
    .instructions-message,
    .instructions-popup {
        display: none !important;
    }
}