/* ─────────────────────────────────────────────
   DESIGN TOKENS (vivamossantafe.ar)
───────────────────────────────────────────── */
:root {
    --dark: #00182f;
    --green: #00482f;
    --white: #ffffff;
    --off-white: #f6f8f6;
    --a1: #3d007d;
    --a2: #700056;
    --a3: #ff6400;
    --grad: linear-gradient(135deg, var(--a1) 0%, var(--a2) 50%, var(--a3) 100%);
    --grad-h: linear-gradient(135deg, var(--a3) 0%, var(--a2) 50%, var(--a1) 100%);
    --font: 'Inter', sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 20px 60px rgba(0, 24, 47, 0.10);
    --shadow-lg: 0 30px 90px rgba(0, 24, 47, 0.16);
    --header-h: 80px;
    --sidebar-w: 380px;
}

/* ─────────────────────────────────────────────
   RESET
───────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--dark);
    background: var(--dark);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(0, 24, 47, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-tag {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: var(--grad);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand-title em {
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-stats {
    display: flex;
    gap: 1rem;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 0.4rem 1rem;
}

.stat-pill-number {
    font-size: 1.1rem;
    font-weight: 900;
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-pill-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────── */
.main-layout {
    display: flex;
    height: calc(100vh - var(--header-h));
    margin-top: var(--header-h);
}

/* ─────────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,24,47,0.08);
    z-index: 500;
    transition: transform 0.4s var(--ease);
}

.sidebar-close-btn {
    display: none;
}

.sidebar-search {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,24,47,0.06);
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: rgba(0,24,47,0.35);
    pointer-events: none;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 2px solid rgba(0,24,47,0.08);
    border-radius: 12px;
    font-family: var(--font);
    font-size: 0.85rem;
    background: var(--off-white);
    color: var(--dark);
    outline: none;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.search-input-wrap input:focus {
    border-color: var(--a2);
    box-shadow: 0 0 0 4px rgba(112, 0, 86, 0.08);
}

.search-input-wrap input::placeholder {
    color: rgba(0,24,47,0.35);
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
}

.sidebar-list::-webkit-scrollbar {
    width: 5px;
}

.sidebar-list::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-list::-webkit-scrollbar-thumb {
    background: rgba(0,24,47,0.12);
    border-radius: 999px;
}

/* Venue Card */
.venue-card {
    padding: 0.85rem 1.15rem;
    margin: 0.25rem 0.75rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    border: 2px solid transparent;
    position: relative;
}

.venue-card:hover {
    background: var(--off-white);
    border-color: rgba(112, 0, 86, 0.1);
}

.venue-card.active {
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--a2) 0%, var(--a3) 100%) border-box;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}

.venue-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.venue-card-pin {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-top: 2px;
}

.venue-card-pin svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.venue-card-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.25;
}

.venue-card-sports {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-left: 2.6rem;
}

.sport-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    background: rgba(61, 0, 125, 0.06);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--a1);
    white-space: nowrap;
}

.sport-chip-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sport-chip-icon img {
    width: 14px;
    height: 14px;
    filter: brightness(0) saturate(100%) invert(7%) sepia(85%) saturate(7480%) hue-rotate(271deg) brightness(60%) contrast(120%);
}

/* ─────────────────────────────────────────────
   MAP
───────────────────────────────────────────── */
.map-container {
    flex: 1;
    position: relative;
}

.map {
    width: 100%;
    height: 100%;
}

.map-watermark {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
}

.map-watermark img {
    height: 55px;
    opacity: 1; /* No transparency */
    display: block;
}

/* Floating City Controls */
.city-selector {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 6px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 24, 47, 0.08);
}

.city-btn {
    border: none;
    background: transparent;
    padding: 8px 18px;
    border-radius: 20px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.city-btn:hover {
    background: rgba(0, 24, 47, 0.05);
}

.city-btn.active {
    background: var(--grad);
    color: white;
    box-shadow: 0 4px 10px rgba(112, 0, 86, 0.2);
}

@media (max-width: 900px) {
    .map-watermark {
        bottom: 15px;
    }
    .map-watermark img {
        height: 40px;
    }
    .city-selector {
        top: 70px;
    }
    .city-btn {
        padding: 6px 14px;
        font-size: 0.78rem;
    }
}

/* Override Leaflet tiles for dark feel */
.leaflet-container {
    font-family: var(--font);
}

/* Custom popup — light theme */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(0,24,47,0.08) !important;
    box-shadow: 0 20px 60px rgba(0,24,47,0.15), 0 4px 12px rgba(0,0,0,0.06) !important;
    color: var(--dark) !important;
    padding: 0 !important;
    max-width: 340px !important;
    min-width: 280px !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
    font-size: 0.85rem !important;
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0,24,47,0.08) !important;
    border-top: none !important;
    border-left: none !important;
}

.leaflet-popup-close-button {
    color: rgba(0,24,47,0.4) !important;
    font-size: 22px !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    top: 8px !important;
    right: 8px !important;
}

.leaflet-popup-close-button:hover {
    color: var(--dark) !important;
}

/* Popup inner */
.popup-inner {
    padding: 1.25rem;
}

.popup-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--grad);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.popup-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    padding-right: 1.5rem;
}

.popup-sports-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.popup-sport-item {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(61, 0, 125, 0.04);
    border: 1px solid rgba(61, 0, 125, 0.08);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.2s var(--ease);
}

.popup-sport-item:hover {
    background: rgba(61, 0, 125, 0.07);
    border-color: rgba(61, 0, 125, 0.15);
}

.popup-sport-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.popup-sport-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--a1);
}

.popup-sport-calendar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.cal-day {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: rgba(255, 100, 0, 0.08);
    color: var(--a3);
    border: 1px solid rgba(255, 100, 0, 0.15);
}

.cal-day-empty {
    font-size: 0.62rem;
    font-weight: 500;
    color: rgba(0, 24, 47, 0.4);
    font-style: italic;
}

.popup-sport-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-sport-icon img {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(7%) sepia(85%) saturate(7480%) hue-rotate(271deg) brightness(60%) contrast(120%);
}

.popup-coords {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(0,24,47,0.08);
    font-size: 0.68rem;
    color: rgba(0,24,47,0.4);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.popup-coords svg {
    width: 12px;
    height: 12px;
    stroke: rgba(0,24,47,0.3);
    fill: none;
    stroke-width: 2;
}

/* ─────────────────────────────────────────────
   CUSTOM MARKER (TEARDROP MAP PIN)
 ───────────────────────────────────────────── */
.sport-marker {
    background: none;
    border: none;
}

.marker-wrap {
    position: relative;
    width: 50px;
    height: 60px;
    display: flex;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 4px 10px rgba(0, 24, 47, 0.25));
    transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}

.marker-wrap:hover {
    transform: scale(1.15) translateY(-4px);
    filter: drop-shadow(0 8px 20px rgba(0, 24, 47, 0.4));
}

.marker-pin {
    width: 44px;
    height: 44px;
    border-radius: 50% 50% 50% 0;
    background: var(--grad);
    transform: rotate(-45deg);
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 3px;
    z-index: 2;
}

.marker-pin-icon {
    transform: rotate(45deg); /* Counter-rotate to keep icon upright */
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-pin-icon img, .marker-pin-icon svg {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

/* Multi-sport marker badge */
.marker-badge {
    position: absolute;
    top: -6px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--a3);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ─────────────────────────────────────────────
   MOBILE SIDEBAR TOGGLE
───────────────────────────────────────────── */
.sidebar-toggle {
    display: none;
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 600;
    background: rgba(0,24,47,0.9);
    backdrop-filter: blur(12px);
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s var(--ease);
}

.sidebar-toggle:hover {
    background: rgba(0,24,47,1);
}

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes markerDrop {
    0%   { opacity: 0; transform: translateY(-30px) scale(0.5); }
    60%  { transform: translateY(4px) scale(1.05); }
    80%  { transform: translateY(-2px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(255,100,0,0.5); }
    100% { box-shadow: 0 0 0 14px rgba(255,100,0,0); }
}

.venue-card {
    animation: fadeUp 0.5s var(--ease) both;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 900px) {
    :root {
        --header-h: 64px;
        --sidebar-w: 320px;
    }

    .header-inner {
        justify-content: center;
        text-align: center;
    }

    .header-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header-stats {
        display: none;
    }

    .brand-title {
        font-size: 1.15rem;
    }

    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 30px rgba(0,0,0,0.2);
        z-index: 1100;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: rgba(61, 0, 125, 0.05);
        color: var(--a1);
        border: none;
        border-radius: 20px;
        padding: 8px 16px;
        font-family: var(--font);
        font-weight: 700;
        font-size: 0.8rem;
        cursor: pointer;
        width: 100%;
        justify-content: center;
        margin-bottom: 12px;
        transition: all 0.3s var(--ease);
        border: 1px solid rgba(61, 0, 125, 0.1);
    }

    .sidebar-close-btn:hover {
        background: rgba(61, 0, 125, 0.1);
        color: var(--a2);
        border-color: rgba(61, 0, 125, 0.2);
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-w: 100vw;
    }

    .header {
        padding: 0 1rem;
    }
}

/* ─────────────────────────────────────────────
   LEAFLET ATTRIBUTION STYLE
───────────────────────────────────────────── */
.leaflet-control-attribution {
    background: rgba(255,255,255,0.85) !important;
    color: rgba(0,24,47,0.5) !important;
    font-size: 0.65rem !important;
    backdrop-filter: blur(8px);
    border-radius: 8px 0 0 0 !important;
}

.leaflet-control-attribution a {
    color: rgba(0,24,47,0.7) !important;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: rgba(255,255,255,0.95) !important;
    color: var(--dark) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    backdrop-filter: blur(12px);
}

.leaflet-control-zoom a:hover {
    background: rgba(255,255,255,1) !important;
}

.leaflet-control-zoom-in {
    border-bottom: 1px solid rgba(0,24,47,0.08) !important;
}
