@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary: #53a3fa;
    --secondary: #f5576c;
    --tertiary: #38ef7d;
    --gold: #fbbf24;
    --purple: #a855f7;
    --dark: #050505;
    --gray: #677590;
    --light: #f5f5f6;
    --bg: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--dark);
    overflow-x: hidden;
}

/* Layout */
.container {
    position: relative;
    width: 100%;
}

/* Fixed Visual Background (Right Side) */
.visual-stage {
    position: fixed;
    top: 0;
    right: 0;
    width: 55%;
    height: 100vh;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f2f5;
    transition: background-color 0.5s ease;
    overflow: hidden;
}

/* Scrollytelling Content (Left Side) */
.scroll-container {
    position: relative;
    z-index: 10;
    width: 45%;
    pointer-events: none;
}

.content-scroll {
    padding-bottom: 50vh;
}

.step {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    pointer-events: none;
}

.step-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    width: 95%;
    max-width: 700px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    border-left: 8px solid var(--primary);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease-out;
    pointer-events: auto;
}

.step.active .step-card {
    transform: translateY(0);
    opacity: 1;
}

.step-number {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
    line-height: 1.15;
    font-weight: 700;
    color: #060606;
}

h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.8rem 0;
    color: var(--primary);
    font-weight: 700;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1rem;
}

/* Region Tags */
.region-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), #4a90e2);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.region-tag.north { background: linear-gradient(135deg, #f5576c, #e74c3c); }
.region-tag.south { background: linear-gradient(135deg, #38ef7d, #11998e); }
.region-tag.center { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

/* Company Logos Grid */
.company-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1rem 0;
}

.apple-visual {
    margin: 1rem 0 0.5rem 0;
}

.apple-visual img {
    display: block;
    max-width: 180px;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

.port-visual {
    margin: 1.25rem 0 1rem 0;
}

.port-visual img {
    display: block;
    width: 100%;
    max-width: 520px;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
}

.company-badge {
    background: rgba(83, 163, 250, 0.1);
    border: 2px solid rgba(83, 163, 250, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    transition: all 0.3s ease;
}

.company-badge:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.company-badge.samsung { border-color: #1428a0; background: rgba(20, 40, 160, 0.1); }
.company-badge.apple { border-color: #555; background: rgba(0, 0, 0, 0.05); }
.company-badge.lg { border-color: #a50034; background: rgba(165, 0, 52, 0.1); }
.company-badge.nike { border-color: #111; background: rgba(0, 0, 0, 0.05); }
.company-badge.adidas { border-color: #000; background: rgba(0, 0, 0, 0.05); }

/* Stats Grid */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: linear-gradient(135deg, rgba(83, 163, 250, 0.08), rgba(83, 163, 250, 0.02));
    padding: 1.2rem;
    border-radius: 12px;
    border: 2px solid rgba(83, 163, 250, 0.2);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    font-weight: 600;
    margin-top: 0.3rem;
}

/* Sector Pills */
.sector-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0;
}

.sector-pill {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray);
}

.sector-pill.active {
    border-color: var(--primary);
    background: rgba(83, 163, 250, 0.1);
    color: var(--primary);
}

/* Citation */
.citation {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: var(--gray);
    font-style: italic;
}

.citation a {
    color: var(--primary);
    text-decoration: none;
}

/* Map Visual */
#visual-map {
    width: 100%;
    height: 100%;
    max-width: none;
    background: #0a0e27;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#map-container {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Custom Markers */
.port-marker {
    background: none;
    border: none;
}

.port-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), #4a90e2);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 6px 20px rgba(83, 163, 250, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.port-icon.major {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary), #e74c3c);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.5);
}

.industrial-marker {
    background: none;
    border: none;
}

.industrial-icon {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--gold), #f59e0b);
    border-radius: 8px;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Brand Marker with Label */
.brand-marker {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(251, 191, 36, 0.3);
    min-width: fit-content;
}

.brand-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    max-width: 150px;
    overflow: visible;
    text-overflow: clip;
    letter-spacing: 0.5px;
}

.route-line {
    stroke-dasharray: 8, 4;
    animation: routeFlow 20s linear infinite;
}

.belt-route {
    opacity: 0.9;
}

.park-highlight {
    stroke-dasharray: 4, 4;
}

/* Airports */
.airport-marker {
    background: none;
    border: none;
}

.airport-icon {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #e5f0ff);
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 26px rgba(37, 99, 235, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #1d4ed8;
}

.airport-icon.major {
    width: 95px;
    height: 95px;
    font-size: 34px;
    box-shadow: 0 10px 32px rgba(30, 64, 175, 0.7);
}

/* Story controls */
#story-controls {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
}

.story-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4);
    transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.story-control-btn:hover {
    transform: translateY(-1px);
    background-color: rgba(15, 23, 42, 1);
}

.story-control-btn.play.active {
    background: var(--primary);
}

.ga-outro {
    text-align: center;
}

.ga-outro-logo {
    max-width: 260px;
    margin: 0 auto 1.5rem auto;
}

.ga-outro-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.ga-outro-tagline {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.ga-outro-subtext {
    font-size: 0.95rem;
    color: var(--gray);
}

@keyframes routeFlow {
    to { stroke-dashoffset: -500; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Province Overlay */
.province-overlay {
    fill: rgba(83, 163, 250, 0.2);
    stroke: var(--primary);
    stroke-width: 2;
}

/* Loading Screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-text {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: 'Inter', sans-serif;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.popup-subtitle {
    font-size: 0.85rem;
    color: var(--gray);
}
