/* style.css */
:root {
    --nav-bg: #0B192C;
    --accent-blue: #3b82f6;
    --tg-safe-area-inset-top: env(safe-area-inset-top);
    --tg-safe-area-inset-bottom: env(safe-area-inset-bottom);
}

/* 1. Responsive Shell Centering */
body {
    background-color: #020617;
    /* Outside color for Laptops */
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Noto Sans', sans-serif;
}

#app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 2. Map Layout & Saga Atmosphere */
.map-area {
    position: relative;
    width: 100%;
    height: 4800px;
    background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.07) 0%, transparent 80%);
}

.road-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#main-content {
    transition: opacity 0.3s ease-in-out;
    overscroll-behavior-y: contain; /* Prevents elastic drag-to-close on views */
    padding-top: var(--tg-safe-area-top, 50px) !important;
}

.overscroll-contain {
    overscroll-behavior-y: contain;
}

.view-hidden {
    opacity: 0;
}

.view-visible {
    opacity: 1;
}

/* Natural easing for the road - synced to 2.5s */
#progress-mask-rect {
    transition: y 2.5s cubic-bezier(0.45, 0, 0.55, 1);
}

.text-glow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 0, 0, 0.4);
}

.node-btn {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    border: 4px solid white !important;
}

.node-active {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 255, 255, 0.8);
    }

    70% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 15px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* 4. Level Specific Gradients */
.bg-lvl-blue {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.bg-lvl-green {
    background: linear-gradient(180deg, #34d399, #059669);
}

.bg-lvl-orange {
    background: linear-gradient(180deg, #fbbf24, #d97706);
}

.bg-lvl-purple {
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.bg-lvl-red {
    background: linear-gradient(180deg, #f87171, #dc2626);
}

/* 5. Fog Effects */
.fog-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 350px;
    background: linear-gradient(to bottom, #0B192C 10%, rgba(11, 25, 44, 0.9) 40%, transparent 100%);
    z-index: 50;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fog-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, #0B192C 0%, rgba(11, 25, 44, 0.5) 50%, transparent 100%);
    z-index: 50;
    pointer-events: none;
}

.fog-label {
    color: #475569;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    margin-top: -100px;
    opacity: 0.6;
}

/* 6. Navigation UI */
.nav-tab .tab-bg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.5);
}

.nav-tab.is-active .tab-bg {
    opacity: 1;
    transform: scale(1);
}

.nav-tab.is-active i,
.nav-tab.is-active svg {
    color: #ffffff !important;
    fill: #ffffff !important;
    animation: navPop 0.4s ease;
}

@keyframes navPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* style.css additions */
.max-h-0 {
    max-height: 0;
}

.max-h-96 {
    max-height: 24rem;
}

/* roughly 384px */

/* Glow for the winning trophies */
.shadow-glow {
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5));
}

#top-nav {
    pointer-events: none;
}

#top-nav div {
    pointer-events: auto;
}

#bottom-nav {
    padding-bottom: var(--tg-safe-area-inset-bottom, 10px);
}

.globe-glow {
    /* Adding a atmosphere-like glow */
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5), 
                inset -5px -5px 15px rgba(0, 0, 0, 0.4);
}

.active-landmark img {
    animation: breathing 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.5)); /* Soft Blue Glow */
}

@keyframes breathing {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.03); /* Gentle float up and slight grow */
    }
}

/* ==========================================================================
   PREMIUM ARTICLE MODAL SYSTEM STYLES
   ========================================================================== */
   #article-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 260;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Single Header State Transformation on Scroll */
#article-topbar.scrolled {
    background: rgba(11, 25, 44, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Translucent Button Capsules */
.article-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.article-nav-btn:active {
    transform: scale(0.95);
}

.article-nav-btn.share-accent {
    background: rgba(37, 99, 235, 0.85);
    border-color: rgba(96, 165, 250, 0.4);
}

/* Typography & Composition Layouts */
.article-para {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.8;
    font-weight: 500;
    margin-bottom: 20px;
}

.article-para:first-child {
    font-size: 16px;
    color: #e2e8f0;
}

.article-list {
    list-style: none;
    padding: 20px;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
}

.article-bullet {
    display: flex;
    gap: 10px;
    font-size: 14px;
    line-height: 1.65;
    border-left: 2px solid rgba(99, 102, 241, 0.5);
    padding-left: 12px;
}

.article-callout {
    margin: 28px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(59, 130, 246, 0.06));
    border-left: 3px solid #6366f1;
    border-radius: 0 16px 16px 0;
    color: #a5b4fc;
    font-size: 14px;
    font-style: italic;
    line-height: 1.7;
}

#article-hero-wrap {
    position: relative;
    height: 280px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
}

#article-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center top;
    will-change: transform;
}

#article-hero-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, #0B192C);
    pointer-events: none;
}

/* 🔠 Global Article View Font Rescaling System */

/* --- SMALL SIZING RULES --- */
#article-scroll-root.font-size-small h1 { font-size: 18px !important; }
#article-scroll-root.font-size-small p { font-size: 12px !important; line-height: 1.65 !important; }
#article-scroll-root.font-size-small span { font-size: 9px !important; }
#article-scroll-root.font-size-small li { font-size: 12px !important; }
#article-scroll-root.font-size-small li strong { font-size: 11px !important; }
#article-scroll-root.font-size-small .article-callout { font-size: 12px !important; }
#article-scroll-root.font-size-small button { font-size: 11px !important; }

/* --- MEDIUM SIZING RULES (Default Baseline Layout) --- */
#article-scroll-root.font-size-medium h1 { font-size: 22px !important; }
#article-scroll-root.font-size-medium p { font-size: 14px !important; line-height: 1.75 !important; }
#article-scroll-root.font-size-medium span { font-size: 10px !important; }
#article-scroll-root.font-size-medium li { font-size: 14px !important; }
#article-scroll-root.font-size-medium li strong { font-size: 13px !important; }
#article-scroll-root.font-size-medium .article-callout { font-size: 14px !important; }
#article-scroll-root.font-size-medium button { font-size: 13px !important; }

/* --- LARGE SIZING RULES --- */
#article-scroll-root.font-size-large h1 { font-size: 26px !important; color: #ffffff !important; }
#article-scroll-root.font-size-large p { font-size: 17px !important; line-height: 1.85 !important; color: #f8fafc !important; }
#article-scroll-root.font-size-large span { font-size: 11px !important; }
#article-scroll-root.font-size-large li { font-size: 16px !important; }
#article-scroll-root.font-size-large li strong { font-size: 15px !important; color: #a5b4fc !important; }
#article-scroll-root.font-size-large .article-callout { font-size: 16px !important; color: #e0e7ff !important; }
#article-scroll-root.font-size-large button { font-size: 15px !important; }

/* style.css additions */

/* Elastic layout system that vertically centers content but stays clear of top safe bounds */
.elastic-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    width: 100%;
    padding-top: calc(var(--tg-safe-area-top, 24px) + 12px);
    padding-bottom: calc(var(--tg-safe-area-inset-bottom, 10px) + 80px); /* Leave clean space above bottom nav bar */
    box-sizing: border-box;
}

/* Hard protective block to hide scrolling content under Telegram's button overlay zone */
.tg-header-shield {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tg-safe-area-top, 24px);
    background-color: #0B192C; /* Matches global app base canvas color */
    z-index: 240;
    pointer-events: none;
}

/* Scroll views require descriptive top space offsets to keep top items legible */
.scroll-safe-top {
    padding-top: calc(var(--tg-safe-area-top, 24px) + 20px) !important;
}
