/* entry.css */

html, body {
    height: 100%;
    width: 100%;
    overflow-y: auto;     /* ✅ enable vertical scroll */
    overflow-x: hidden;
    font-family: Merriweather, serif;
    background-color: #2f2f2f;
}


/* Full-screen container for the entry screen */
.entry-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    background-color: #2f2f2f;

    min-height: 100vh;      /* ✅ Ensures it at least fills full screen */
    width: 100vw;

    overflow-y: auto;
    padding: 2rem 1rem;
    box-sizing: border-box;

    position: relative;     /* 🧩 Helps keep layout controlled */
    z-index: 1;
}


/* Welcome section styling */
.welcome-section {
    text-align: center;
    color: #fff;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ff8a00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.welcome-section .tagline {
    font-size: 1.3rem;
    font-style: italic;
    color: #ffd700;
    margin-bottom: 1rem;
    font-weight: 300;
}

.welcome-section .description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 0;
}

/* Centered block for the mode selection */
.mode-selector {
    text-align: center;
    color: #fff;
    max-width: 900px;
    margin: 0 auto;
}

/* Heading style */
.mode-selector h2 {
    margin-bottom: 10px;
    font-size: 2rem;
    text-align: center;
    color: #fff;
}

.mode-selector .mode-intro {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Tiled mode buttons */
.mode-buttons-tiled {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mode-tile {
    background-color: #1f1f1f;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    width: 140px;
}

.mode-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.5);
}

.mode-tile img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 10px;
}

.mode-tile span {
    color: #fff;
    font-size: 1.1rem;
    display: block;
    margin-top: 5px;
}

/* Mobile-optimized tiled layout */
.mode-buttons-tiled {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.5rem 1rem;
}

/* Enhanced mode tile styling */
.mode-tile {
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    border: 2px solid transparent;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    width: 100%;
    max-width: 420px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 138, 0, 0.4);
    border-color: rgba(255, 138, 0, 0.5);
}

.mode-image-container {
    position: relative;
    padding: 1rem 1rem 0.5rem 1rem;
}

.mode-tile img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 0;
    object-fit: cover;
    max-height: 200px;
}

.mode-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(45deg, #ff8a00, #ffd700);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 138, 0, 0.3);
}

.mode-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.mode-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.5rem 0;
}

.mode-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ccc;
    margin: 0 0 1rem 0;
}

.mode-benefits {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.benefit-tag {
    background: rgba(255, 138, 0, 0.2);
    color: #ff8a00;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255, 138, 0, 0.3);
}

/* Help section styling */
.help-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.help-text {
    font-size: 1rem;
    color: #e0e0e0;
    margin: 0;
    line-height: 1.5;
}

.help-text strong {
    color: #ff8a00;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .welcome-section h1 {
        font-size: 2.2rem;
    }
    
    .welcome-section .tagline {
        font-size: 1.1rem;
    }
    
    .welcome-section .description {
        font-size: 1rem;
    }
    
    .mode-selector h2 {
        font-size: 1.7rem;
    }
    
    .mode-content {
        padding: 1rem;
    }
    
    .mode-content h3 {
        font-size: 1.2rem;
    }
    
    .mode-description {
        font-size: 0.9rem;
    }
    
    .mode-badge {
        top: 1rem;
        right: 1rem;
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .entry-container {
        padding: 1rem 0.5rem;
    }
    
    .welcome-section {
        margin-bottom: 2rem;
    }
    
    .welcome-section h1 {
        font-size: 1.8rem;
    }
    
    .mode-buttons-tiled {
        padding: 1rem 0.5rem;
    }
    
    .help-section {
        margin-top: 1.5rem;
        padding: 1rem;
    }
}

/* Better vertical alignment on short screens */
.entry-container {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2rem;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-out {
    animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.95); }
}

/* Staggered fade-in animation for mode tiles */
.mode-tile:nth-child(1) {
    animation: slideInUp 0.6s ease 0.1s both;
}

.mode-tile:nth-child(2) {
    animation: slideInUp 0.6s ease 0.2s both;
}

.mode-tile:nth-child(3) {
    animation: slideInUp 0.6s ease 0.3s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility improvements */
.mode-tile:focus {
    outline: 3px solid #ff8a00;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .mode-tile,
    .welcome-section,
    .help-section {
        animation: none;
        transition: none;
    }
    
    .mode-tile:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mode-tile {
        border: 2px solid #fff;
    }
    
    .mode-badge {
        background: #fff;
        color: #000;
    }
    
    .benefit-tag {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}

/* Mixed Mode Specific Styles */
body.mixed-mode-laptop {
    /* Laptop interface focuses on visual elements */
}

/* Removed: hiding interactive elements for single-device laptop experience
   Original mixed-mode design hid these for dual-device setup,
   but we now support single-device immersive experience */

/* For laptop, show the image pane full width */
body.mixed-mode-laptop #image-pane {
    display: block !important;
    width: 50%;
    height: 100vh;
    float: left;
}

body.mixed-mode-laptop #image-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.mixed-mode-laptop #interactive-pane {
    width: 100%;
    height: 100vh;
    float: right;
}

body.mixed-mode-laptop #vertical-image-pane {
    height: 100vh;
    position: relative;
}

body.mixed-mode-laptop #vertical-image-display {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.mixed-mode-mobile {
    /* Mobile interface focuses on text and controls */
}

body.mixed-mode-mobile #image-pane,
body.mixed-mode-mobile #vertical-image-display,
body.mixed-mode-mobile #audio-pane {
    display: none !important;
}

body.mixed-mode-mobile #narrative-overlay {
    background: rgba(0, 0, 0, 0.9);
    position: absolute;  /* Absolute positioning for proper layout */
    top: 0;
    left: 0;
    width: 100%;
    height: 50vh;  /* Initial height - will be overridden by JS */
    min-height: 50px;   /* Match JS constraint */
    max-height: 80%;    /* Match JS constraint (0.8 * window.innerHeight) */
    resize: none;       /* Disable CSS resize, use JS handle instead */
    overflow: hidden;   /* Container overflow hidden, content scrolls */
    display: flex;
    flex-direction: column;
    z-index: 1999;      /* Ensure it's above other content */
}

/* Ensure resize handle works in mixed mode mobile */
body.mixed-mode-mobile .narrative-resize-handle {
    flex: 0 0 24px;     /* Larger handle for mobile touch */
    background: rgba(255, 255, 255, 0.5);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    touch-action: none;  /* Prevent default touch behaviors */
}

/* Ensure narrative text scrolls properly */
body.mixed-mode-mobile #narrative-text {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;  /* Smooth scrolling on iOS */
}

body.mixed-mode-mobile #vertical-image-pane {
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;     /* Start from top */
    align-items: center;            /* Center content horizontally */
    padding: 1rem;
    height: 100vh;
    overflow: hidden;               /* Prevent container scrolling */
    position: relative;
}

/* Wrapper for narrative overlay to contain it at top */
body.mixed-mode-mobile #narrative-overlay {
    margin-bottom: 1rem;            /* Space below narrative */
}

/* Content area that can scroll if needed */
body.mixed-mode-mobile #vertical-image-pane > *:not(.interactive-icon-pane):not(#narrative-overlay) {
    flex-shrink: 1;                 /* Allow shrinking if needed */
}

body.mixed-mode-mobile #compass-container {
    position: static;
    margin: 1rem auto;  /* Reduced margin to save space */
    transform: scale(1.2);  /* Make compass slightly larger on mobile */
    flex-shrink: 0;     /* Prevent compass from shrinking */
}

body.mixed-mode-mobile .interactive-icon-pane {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: auto;   /* Push to bottom */
    margin-bottom: 1rem;
    flex-shrink: 0;     /* Prevent icon pane from shrinking */
    width: 100%;
    padding: 0 1rem;
}

/* Mixed mode instructions styling */
.mixed-mode-instructions h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
}

.mixed-mode-instructions ol {
    line-height: 2;
}

.mixed-mode-instructions button:hover {
    background: #45a049 !important;
}

