/* Nearby map (admin-only preview of /api/places/map). Regular users keep
   seeing the "próxima versión" placeholder. */

.nearby-map-container {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.nearby-map-container[hidden] { display: none; }

.nearby-map-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    background: #1a1f29;
    border: 1px solid #2e3646;
    border-radius: 14px;
}
.nearby-map-summary .info {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #eef2f7;
}
.nearby-map-summary .info i { color: #f2c200; }
.nearby-map-summary .info strong { color: #fff; }
.nearby-map-admin-pill {
    background: rgba(242, 194, 0, 0.14);
    color: #f2c200;
    border: 1px solid rgba(242, 194, 0, 0.35);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nearby-map-wrap {
    position: relative;
    border: 1px solid #2e3646;
    border-radius: 18px;
    overflow: hidden;
    background: #0e1420;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
#nearby-map {
    height: 360px;
    width: 100%;
    background: #0e1420;
}

/* Score pin markers */
.score-pin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #f2c200;
    color: #191d27;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,0.55);
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
}
.score-pin span {
    transform: rotate(45deg);
    line-height: 1;
    display: block;
    font-size: 14px;
}
.score-pin.dim { background: #38445a; color: #eef2f7; }
.score-pin.hot {
    background: linear-gradient(135deg, #f5b841, #ff7a00);
    color: #17202b;
}
.score-pin.empty {
    background: #1f2631;
    color: #9ca9bb;
    border-color: #38445a;
}
.score-pin.empty span { font-size: 16px; }

/* Leaflet popup theming */
.leaflet-popup-content-wrapper {
    background: #1a1f29;
    color: #eef2f7;
    border: 1px solid #2e3646;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.55);
    padding: 0;
}
.leaflet-popup-content {
    margin: 0 !important;
    padding: 0.75rem 0.85rem 0.8rem;
    width: 220px !important;
    font-family: 'Manrope', sans-serif;
}
.leaflet-popup-tip {
    background: #1a1f29;
    border: 1px solid #2e3646;
}
.leaflet-popup-close-button {
    color: #9ca9bb !important;
    font-size: 20px !important;
    padding: 6px 8px !important;
}
.nearby-pop-head {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.55rem;
}
.nearby-pop-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f2c200 0%, #c06800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.nearby-pop-logo .nearby-pop-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nearby-pop-logo .nearby-pop-logo-fallback { font-size: 18px; display: flex; align-items: center; justify-content: center; }
.nearby-pop-logo .nearby-pop-logo-fallback .activity-cover-placeholder-icon {
    width: 24px;
    height: 24px;
}
/* Venue-card avatar (44x44): when no logo is uploaded, the same shared
   placeholder SVG renders directly inside `.avatar` — size it to the box. */
.nearby-venue-card .avatar > .activity-cover-placeholder-icon {
    width: 28px;
    height: 28px;
}
.nearby-pop-heading { min-width: 0; }
.nearby-pop-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nearby-pop-sub {
    font-size: 0.72rem;
    color: #9ca9bb;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.nearby-pop-sub i { color: #f2c200; }
.nearby-pop-row {
    background: #171d27;
    border: 1px solid #2e3646;
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.nearby-pop-row .label {
    font-size: 0.82rem;
    color: #eef2f7;
    font-weight: 600;
}
.nearby-pop-row .score {
    font-size: 0.92rem;
    font-weight: 800;
    color: #f2c200;
}
.nearby-pop-row .score.muted { color: #9ca9bb; }
.nearby-pop-meta {
    margin-top: 0.55rem;
    display: flex;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: #9ca9bb;
    flex-wrap: wrap;
}
.nearby-pop-meta span {
    background: #171d27;
    border: 1px solid #2e3646;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
}

/* Venue list under the map */
.nearby-map-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.nearby-venue-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    background: #1a1f29;
    border: 1px solid #2e3646;
    border-radius: 14px;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.nearby-venue-card:hover {
    border-color: #f5b841;
    transform: translateY(-1px);
}
.nearby-venue-card.active {
    border-color: #f2c200;
    box-shadow: 0 0 0 1px rgba(242, 194, 0, 0.3);
}
.nearby-venue-card .avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f2c200 0%, #c06800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
    flex-shrink: 0;
}
.nearby-venue-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nearby-venue-card .body { min-width: 0; }
.nearby-venue-card .name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nearby-venue-card .sub {
    font-size: 0.75rem;
    color: #9ca9bb;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nearby-venue-card .sub i { color: #f2c200; font-size: 0.7rem; }
.nearby-venue-card .right { text-align: right; min-width: 55px; }
.nearby-venue-card .right .score {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f2c200;
    line-height: 1;
}
.nearby-venue-card .right .score.muted { color: #9ca9bb; }
.nearby-venue-card .right .count {
    font-size: 0.7rem;
    color: #7f8da3;
    margin-top: 0.2rem;
}

.nearby-map-empty {
    text-align: center;
    padding: 1.2rem 1rem;
    color: #9ca9bb;
    font-size: 0.82rem;
}

/* --- Admin coords editor (inside admin panel) --- */

.admin-coords-section { margin-top: 1.5rem; }
.admin-coords-section .admin-hint {
    font-size: 0.8rem;
    color: #9ca9bb;
    margin-bottom: 0.7rem;
    line-height: 1.4;
}
.admin-coords-section .admin-hint code {
    background: #101623;
    border: 1px solid #2e3646;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.78rem;
}
.admin-coords-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.admin-coords-place {
    background: #1a1f29;
    border: 1px solid #2e3646;
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
}
.admin-coords-place header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}
.admin-coords-place header h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}
.admin-coords-place header .count {
    font-size: 0.7rem;
    color: #9ca9bb;
}
.admin-coords-row {
    display: grid;
    grid-template-columns: 1fr 100px 100px auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0;
    border-top: 1px dashed #2e3646;
}
.admin-coords-row:first-of-type { border-top: 0; }
.admin-coords-row .addr {
    font-size: 0.8rem;
    color: #eef2f7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-coords-row input {
    width: 100%;
    background: #101623;
    border: 1px solid #2e3646;
    color: #eef2f7;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
    font-family: inherit;
}
.admin-coords-row input:focus {
    outline: none;
    border-color: #f5b841;
}
.admin-coords-save {
    background: #f2c200;
    color: #17202b;
    border: 0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}
.admin-coords-save:disabled {
    opacity: 0.55;
    cursor: default;
}
.admin-coords-row.saved .admin-coords-save {
    background: #38c06b;
    color: #0b1a10;
}

@media (max-width: 480px) {
    .admin-coords-row {
        grid-template-columns: 1fr 1fr;
        row-gap: 0.4rem;
    }
    .admin-coords-row .addr { grid-column: 1 / -1; }
    .admin-coords-save { grid-column: 1 / -1; justify-self: end; }
}
