/* =============================================
   NWI Dashboard — Modern Dark Theme
   ============================================= */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-deep: #030712;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-solid: #0f172a;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent-1: #0ea5e9;
    --accent-2: #6366f1;
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --heat-low: #fee2e2;
    --heat-mid: #ef4444;
    --heat-high: #7f1d1d;
    --success: #22c55e;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Glass Card --- */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}

.glass:hover {
    border-color: var(--border-hover);
}

/* ====== HERO INTRO ====== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(14, 165, 233, 0.15), transparent),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(99, 102, 241, 0.10), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    animation: fadeInUp 1s ease-out;
}

.hero-badge {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--accent-1);
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 999px;
    padding: 6px 18px;
    margin-bottom: 28px;
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    background: linear-gradient(160deg, #ffffff 30%, var(--accent-1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 480px;
    margin: 0 auto 32px;
}

.hero-stats-container {
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.version-disclaimer {
    font-size: 0.75rem;
    color: var(--text-dim);
    max-width: 400px;
    text-align: center;
    line-height: 1.3;
    opacity: 0.7;
    margin: 0;
}

/* CTA Button */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--accent-gradient);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 24px rgba(14, 165, 233, 0.25);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.35);
}

.cta-btn-sm {
    padding: 10px 24px;
    font-size: 0.9rem;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-dim), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* ====== WATCH SHOWCASE ====== */
.watch-showcase {
    position: relative;
    height: 250vh;
    /* background: linear-gradient(to bottom, var(--bg-deep), #050a15, var(--bg-deep)); */
}

.watch-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.watch-container {
    position: relative;
    width: 320px;
    height: 320px;
    transform: scale(0.4);
    opacity: 0;
    transition: none;
    /* JS controls this */
    will-change: transform, opacity;
}

.watch-face {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 18%;
    /* The image already has smooth corners; this ensures consistency */
    box-shadow:
        0 0 80px rgba(14, 165, 233, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Clock overlay — positioned to match garminfull.png layout.
   The garminempty.png already has 86%, SUN, blue numbers, and 15C baked in.
   We overlay only: the date (e.g. "26 Feb") and the large time (e.g. "12:18").
   The day of week is hidden since it's already in the image. */
.clock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Push content down from top to match watch face layout */
    padding-top: 18%;
}

.clock-overlay.visible {
    opacity: 1;
}

.clock-date {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.clock-time {
    font-family: var(--font);
    font-size: 64px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
    letter-spacing: -2px;
    line-height: 1;
}

.clock-day {
    display: none;
    /* Already baked into garminempty.png */
}

.watch-caption {
    margin-top: 32px;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.watch-caption.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ====== COVER IMAGE SECTION ====== */
.cover-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.05);
    transition: transform 8s ease-out;
    filter: brightness(0.55) saturate(1.2);
}

.cover-section.in-view .cover-image {
    transform: scale(1.0);
}

.cover-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    max-width: 600px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.cover-section.in-view .cover-overlay {
    opacity: 1;
    transform: translateY(0);
}

.cover-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #ffffff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 16px;
}

.cover-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}



/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 36px;
    min-width: 170px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* ====== SECTIONS ====== */
.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ====== CHART ====== */
.chart-card {
    padding: 32px;
    position: relative;
}

.chart-card canvas {
    width: 100% !important;
    max-height: 360px;
}

/* ====== MAP ====== */
.map-card {
    padding: 4px;
    overflow: hidden;
}

#worldMap {
    width: 100%;
    height: 450px;
    border-radius: calc(var(--radius) - 4px);
    z-index: 1;
}

/* Leaflet overrides for dark theme */
.leaflet-container {
    background: #0c1222 !important;
}

.leaflet-control-attribution {
    background: rgba(3, 7, 18, 0.7) !important;
    color: var(--text-dim) !important;
    font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
    color: var(--text-muted) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card-solid) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Map tooltip */
.country-tooltip {
    background: var(--bg-card-solid) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text) !important;
    padding: 8px 14px !important;
    font-family: var(--font) !important;
    font-size: 0.85rem !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

.country-tooltip::before {
    display: none !important;
}

.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    border-top-color: var(--bg-card-solid) !important;
}

.tooltip-count {
    font-weight: 700;
    color: var(--accent-1);
}

/* ====== COUNTRY GRID ====== */
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.country-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: transform var(--transition), border-color var(--transition);
    animation: fadeInUp 0.5s ease-out both;
}

.country-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.country-flag {
    font-size: 2rem;
    line-height: 1;
}

.country-info {
    flex: 1;
}

.country-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.country-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.country-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.country-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 1s ease-out;
}

.country-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
}

/* ====== GARMIN EMBED ====== */
.app-embed-card {
    padding: 4px;
    overflow: hidden;
}

.app-embed-inner {
    position: relative;
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
    min-height: 500px;
}

.app-embed-inner iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: calc(var(--radius) - 4px);
}

.app-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.05), rgba(99, 102, 241, 0.05));
}

.app-fallback.visible {
    display: flex;
}

.app-fallback-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.app-fallback h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.app-fallback p {
    color: var(--text-muted);
    max-width: 400px;
    margin-bottom: 24px;
}

/* ====== SUGGESTION FORM ====== */
.form-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.optional {
    color: var(--text-dim);
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    box-shadow: 0 4px 24px rgba(14, 165, 233, 0.25);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.35);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    transition: transform var(--transition);
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Thank you overlay */
.thank-you-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border-radius: var(--radius);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.thank-you-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.thumbs-up {
    font-size: 4rem;
    animation: thumbsBounce 0.8s ease-out;
}

.thank-you-text {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.thank-you-sub {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 0.9rem;
}

/* ====== FOOTER ====== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: var(--accent-1);
}

/* ====== ANIMATIONS ====== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(1);
    }

    50% {
        opacity: 0.8;
        transform: scaleY(1.2);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes thumbsBounce {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.3) rotate(10deg);
        opacity: 1;
    }

    70% {
        transform: scale(0.9) rotate(-5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Fade-in on scroll */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .hero {
        padding: 60px 20px;
        min-height: auto;
        min-height: 100vh;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-card {
        min-width: auto;
        width: 100%;
        max-width: 260px;
    }

    .section {
        padding: 60px 0;
    }

    .chart-card {
        padding: 16px;
    }

    #worldMap {
        height: 300px;
    }

    .country-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 24px;
    }

    .app-embed-inner iframe {
        height: 400px;
    }

    .app-embed-inner {
        min-height: 400px;
    }

    /* Watch showcase responsive */
    .watch-showcase {
        height: 200vh;
    }

    .watch-container {
        width: 240px;
        height: 240px;
    }

    .clock-time {
        font-size: 48px;
    }

    .clock-date {
        font-size: 11px;
    }

    .cover-title {
        font-size: 2rem;
    }
}