/* =========================================================
   city_switcher.css — Alpine.js powered, premium modal
   ========================================================= */

/* ---- Overlay ---- */
.city-switcher-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ---- Panel ---- */
.city-switcher-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(253, 200, 8, 0.25);
    border-radius: 28px;
    color: #331603;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    padding: 0;
}

/* Scrollbar styling */
.city-switcher-panel::-webkit-scrollbar { width: 6px; }
.city-switcher-panel::-webkit-scrollbar-track { background: transparent; }
.city-switcher-panel::-webkit-scrollbar-thumb { background: rgba(51, 22, 3, 0.15); border-radius: 3px; }

/* ---- Header ---- */
.cs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(51, 22, 3, 0.08);
}

.cs-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #331604;
    margin: 0 0 4px;
}

.cs-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #331603;
    margin: 0;
    line-height: 1.2;
}

.cs-close-btn {
    background: rgba(51, 22, 3, 0.07);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #331603;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.cs-close-btn:hover {
    background: rgba(51, 22, 3, 0.15);
    transform: rotate(90deg);
}

/* ---- Map ---- */
#cs-map {
    height: 220px;
    width: 100%;
    z-index: 1;
    border-top: none;
    border-bottom: 1px solid rgba(51, 22, 3, 0.08);
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    border-radius: 14px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
    font-family: inherit !important;
}
.leaflet-popup-tip {
    background: #fff !important;
}

/* ---- City List ---- */
.cs-city-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 20px 20px;
}

@media (min-width: 500px) {
    .cs-city-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* City Items */
.city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(51, 22, 3, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: #331603;
}

.city-item:hover {
    background: #fff;
    border-color: #fdc808;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(253, 200, 8, 0.25);
    text-decoration: none;
    color: #331603;
}

.city-item.active {
    background: #fff;
    border-color: #fdc808;
    border-width: 2px;
    box-shadow: 0 6px 16px -3px rgba(253, 200, 8, 0.3);
}

.city-item.global-hub {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(253, 200, 8, 0.12) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-color: rgba(253, 200, 8, 0.3);
}

.city-item.global-hub:hover {
    background: linear-gradient(135deg, rgba(253, 200, 8, 0.2) 0%, #fff 100%);
}

.city-info { flex: 1; min-width: 0; }

.city-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-info p {
    margin: 3px 0 0;
    font-size: 0.8rem;
    opacity: 0.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.country-badge {
    background: rgba(51, 22, 3, 0.06);
    color: #331603;
    padding: 5px 11px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    margin-left: 10px;
    flex-shrink: 0;
}

.city-item.active .country-badge {
    background: #fdc808;
}

/* ---- Trigger Button ---- */
.city-switcher-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 6px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(51, 22, 3, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: #331603;
    white-space: nowrap;
}

.city-switcher-trigger:hover {
    border-color: #fdc808;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.city-switcher-trigger svg { color: #fdc808; }

/* ---- Suggestion Banner ---- */
.suggestion-banner {
    background: #fff;
    color: #331603;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(253, 200, 8, 0.25);
    flex-wrap: wrap;
    animation: slideInBanner 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInBanner {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.suggestion-banner i { color: #fdc808; font-size: 1.1rem; }

.suggestion-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-banner {
    background: #fdc808;
    color: #331603;
    border: none;
    padding: 7px 18px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-banner:hover { background: #e0b400; transform: scale(1.02); }

.btn-banner-outline {
    background: rgba(51, 22, 3, 0.04);
    color: #331603;
    border: 1px solid rgba(51, 22, 3, 0.1);
}

.btn-banner-outline:hover { background: rgba(51, 22, 3, 0.1); }

/* ---- Map Marker (Leaflet custom icons) ---- */
.custom-div-icon { background: none; border: none; }

.marker-pin {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: #fdc808;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -14px 0 0 -14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    transition: transform 0.2s;
}

.marker-pin::after {
    content: '';
    width: 10px;
    height: 10px;
    margin: 7px 0 0 7px;
    background: #331603;
    position: absolute;
    border-radius: 50%;
}

/* ---- Global Index Full-Page Map ---- */
#global-city-map {
    width: 100%;
    height: 460px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    z-index: 1;
}

@media (max-width: 640px) {
    #global-city-map { height: 300px; }
}

/* ---- [x-cloak] hide until Alpine ready ---- */
[x-cloak] { display: none !important; }


/* Make the attribution tiny and semi-transparent */
.leaflet-control-attribution {
    font-size: 8px !important;
    opacity: 0.5;
    background: transparent !important;
}

/* Or hide it only on mobile to save space */
@media (max-width: 768px) {
    .leaflet-control-attribution {
        display: none !important;
    }
}