/* 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;
}


/* Centered block for the mode selection */
.mode-selector {
    text-align: center;
    color: #fff;
}

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

/* 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;
}

/* Each mode tile fills most of the width and adapts well to screen size */
.mode-tile {
    background-color: #1f1f1f;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%;
    max-width: 420px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mode-tile:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.4);
}

.mode-tile img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    object-fit: cover;
}

.mode-tile span {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

/* Optional: 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); }
}

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

body.mixed-mode-laptop .narrative-overlay,
body.mixed-mode-laptop .narrative-input,
body.mixed-mode-laptop .menu-container,
body.mixed-mode-laptop #compass-container,
body.mixed-mode-laptop .interactive-icon-pane,
body.mixed-mode-laptop #toggle-overlay {
    display: none !important;
}

/* 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;
}

