:root {
    --primary: #4f46e5;
    --accent: #06b6d4;
    --outer-bg: #cbd5e1;
    /* The "Void" background */
    --inner-bg: #f1f5f9;
    /* Soft matte background inside the box */
    --white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #94a3b8;
    --card-border: #e2e8f0;
    --glass: rgba(255, 255, 255, 0.75);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--outer-bg);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.background{
    background-image: url('assets/backgroundtile.png');
    background-repeat: repeat;
    background-size: 600px;
    background-position: center 0;
}

/* --- The 1200px Container (Itch.io Style) --- */
.main-wrapper {
    width: 100%;
    max-width: 1200px;
    /* Widened as requested */
    background-color: var(--inner-bg);
    border: 2px solid var(--border-color);
    /* Added Border */
    border-top: none;
    border-bottom: none;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- Navigation --- */
nav {
    background: var(--white);
    padding: 25px;
    display: flex;
    justify-content: center;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-weight: 800;
    font-size: 2.5rem;
    text-decoration: none;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo span {
    color: var(--primary);
}

/* --- Map Section --- */
.map-section {
    position: relative;
    width: 100%;
    background: #94a3b8;
    border-bottom: 2px solid var(--border-color);
}

.map-wrapper img {
    width: 100%;
    display: block;
    filter: brightness(0.95);
}

/* Glassy Labels */
.poi-anchor {
    position: absolute;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.6);
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.poi-anchor:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.3);
}

/* Pin Positions */
.label-lillestrom {
    top: 8%;
    right: 22%;
}

.label-denmark {
    top: 28%;
    right: 30%;
}

.label-austria {
    top: 60%;
    right: 19%;
}

.label-italy {
    top: 74%;
    right: 27%;
}

.label-france {
    top: 60%;
    left: 18%;
}

.label-mallorca {
    bottom: 10%;
    left: 24%;
}

/* --- Content Sections --- */
.dest-section {
    padding: 80px 50px;
}

/* --- Route Highlight Section --- */
.route-section {
    padding: 80px 50px;
    text-align: center;
    background: var(--white);
    border-top: 2px solid var(--border-color);
}

.route-btn {
    display: inline-block;
    padding: 25px 40px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.route-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-weight: 900;
    font-size: 2.5rem;
    letter-spacing: -1px;
}

.destinations-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
}

.dest-card {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    transition: 0.3s ease;
    cursor: pointer;
    scroll-margin-top: 120px;
}

.dest-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
}

/* Click Highlight Pulse */
.dest-card:target {
    animation: soft-pulse 2.5s ease;
    border-color: var(--primary);
    border-width: 2px;
}

@keyframes soft-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(79, 70, 229, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.dest-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.dest-content {
    padding: 30px;
}

.dest-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.dest-content p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1rem;
    /* truncate to a few lines in the card; full text shown in modal */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Modal System (Mobile Centered) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    /* Perfect vertical/horizontal center */
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 900px;       /* allow bigger on desktop */
    max-height: 90vh;      /* a bit more vertical space */
    border-radius: 32px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header-img {
    width: 100%;
    height: 400px;  /* larger header image */
    object-fit: cover;
}

.modal-body {
    padding: 40px;
}

.modal-body h2 {
    color: var(--primary);
    margin-top: 0;
    font-size: 2rem;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* --- Leaderboard --- */
.leaderboard-section {
    background: var(--white);
    padding: 100px 50px;
    border-top: 2px solid var(--border-color);
}

#bike-tracker-component {
    max-width: 500px;
    margin: 0 auto;
    background: var(--inner-bg);
    border-radius: 32px;
    padding: 40px;
    border: 2px solid var(--border-color);
}

.total-val {
    font-size: 4rem;
    color: var(--primary);
    font-weight: 900;
    text-align: center;
    letter-spacing: -2px;
}

.prog-bg {
    background: #e2e8f0;
    height: 16px;
    border-radius: 8px;
    margin: 25px 0;
    overflow: hidden;
}

#prog-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    width: 0%;
    transition: width 1s;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.input-group input {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
    font-size: 1rem;
}

#bt-btn {
    padding: 18px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

footer {
    padding: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 2px solid var(--border-color);
    background: var(--white);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1200px) {
    .main-wrapper {
        border-left: none;
        border-right: none;
        max-width: 100%;
        border-top: none;
    }

    .dest-section {
        padding: 60px 20px;
    }

    .leaderboard-section {
        padding: 60px 20px;
    }

    .modal-header-img {
        height: 250px;
    }

    .modal-body {
        padding: 25px;
    }
}
