/* ==========================================================================
   BracketFlow — Global Event Map Styles
   ========================================================================== */

/* SCROLLABLE / FLEX OVERWRITES FOR BODY */
body {
    overflow-y: auto !important;
    height: auto !important;
}

.mirror-container {
    min-height: auto !important;
    padding-bottom: 10px;
}

:root {
    --accent-gold: #c5a880;
}

/* Map Container & Panel Sizing */
.map-panel {
    position: relative;
    width: 100%;
    max-width: 1440px;
    height: calc(100vh - 240px);
    min-height: 560px;
    max-height: 760px;
    margin: 0 auto 20px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #14161a;
    box-sizing: border-box;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    background: #0b0c0e;
}

/* Custom Leaflet Tooltip / Popup */
.leaflet-popup-content-wrapper {
    background: rgba(10, 10, 13, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8);
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: rgba(10, 10, 13, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Popup Card Styling */
.popup-card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.popup-card-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 75%;
    height: 100%;
    background-size: cover;
    background-position: center right;
    opacity: 0.4;
    mask-image: linear-gradient(to left, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
    pointer-events: none;
}

.popup-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.popup-location-link {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 700;
}

.popup-location-link:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

.popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.popup-meta {
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.popup-meta p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-btn {
    display: block;
    text-align: center;
    background: var(--accent) !important;
    color: #0b0c0e !important;
    text-decoration: none;
    padding: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.popup-btn:hover {
    background: #e2c9a6 !important;
    transform: translateY(-1px);
}
}

.popup-btn:hover {
    background: #006bce !important;
    color: white !important;
}

/* Leaflet container fix to match dark theme background */
.leaflet-container {
    background-color: var(--bg-main) !important;
}

/* Marker Styles */
.custom-marker {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    border: 2.5px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    background-color: #141419;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-marker:hover {
    z-index: 1000 !important;
}

.custom-marker:hover .marker-logo {
    transform: scale(1.15);
}

.marker-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.marker-live {
    border-color: var(--loser-red);
    animation: pulse-marker 1.5s infinite ease-in-out;
}

.marker-live .marker-logo {
    animation: pulse-logo 1.5s infinite ease-in-out;
}

.marker-upcoming {
    border-color: var(--accent-gold);
}

@keyframes pulse-marker {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes pulse-logo {
    0% { transform: scale(0.92); }
    50% { transform: scale(1.08); }
    100% { transform: scale(0.92); }
}

/* Cluster Styling (Obsidian & Warm Amber Accent) */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
    background-color: rgba(197, 168, 128, 0.2) !important;
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(197, 168, 128, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
    background-color: #14161a !important;
    color: var(--accent) !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-top: 4px;
    text-align: center;
    line-height: 30px;
    border: 1.5px solid var(--accent);
    box-shadow: inset 0 0 8px rgba(197, 168, 128, 0.15);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.marker-cluster-small:hover div, .marker-cluster-medium:hover div, .marker-cluster-large:hover div {
    background-color: var(--accent) !important;
    color: #0b0c0e !important;
    transform: scale(1.08);
}

/* Responsive Map Overlay */
@media (max-width: 768px) {
    body {
        overflow: hidden !important;
        height: 100dvh !important;
    }
    .mirror-container {
        height: 100dvh !important;
        padding: 10px 10px 10px 10px !important;
    }
    .map-panel {
        min-height: 350px !important;
    }
    .map-overlay {
        top: auto !important;
        bottom: 15px !important;
        right: 50% !important;
        transform: translateX(50%) !important;
        padding: 8px 14px !important;
        border-radius: 20px !important;
        width: calc(100% - 30px) !important;
        max-width: 360px !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    .map-overlay .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    .map-overlay select {
        font-size: 0.75rem !important;
        padding: 4px 10px !important;
    }
}
