/* ── ScubaGPT Leaflet map container ──────────────────────────────────────── */

#scubagpt-map.scubagpt-map-wrap {
    width: 100%;
    min-height: 280px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

#scubagpt-map .leaflet-container {
    font-family: inherit;
}

/* ── Dive Site clusters (blue) ───────────────────────────────────────────── */

.scubagpt-cluster-site {
    background-color: rgba(0, 119, 190, 0.3) !important;
}

.scubagpt-cluster-site div {
    background-color: rgba(0, 119, 190, 0.7) !important;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 5px;
}

/* ── Dive Operator clusters (orange) ─────────────────────────────────────── */

.scubagpt-cluster-operator {
    background-color: rgba(230, 138, 0, 0.3) !important;
}

.scubagpt-cluster-operator div {
    background-color: rgba(230, 138, 0, 0.7) !important;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 5px;
}

/* ── Search control ──────────────────────────────────────────────────────── */

.scubagpt-map-search {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    min-width: 240px;
    max-width: 360px;
}

.scubagpt-map-search-input {
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    background: transparent;
    color: #333;
}

.scubagpt-map-search-input::placeholder {
    color: #999;
}

.scubagpt-map-search-clear {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 18px;
    color: #888;
    line-height: 1;
    flex-shrink: 0;
}

.scubagpt-map-search-clear:hover {
    color: #333;
}

/* ── Count badge ─────────────────────────────────────────────────────────── */

.scubagpt-map-badge {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #444;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */

.scubagpt-map-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.scubagpt-map-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ── Modal card ──────────────────────────────────────────────────────────── */

.scubagpt-map-modal {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 92%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: scubagpt-modal-in 0.2s ease;
}

@keyframes scubagpt-modal-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.scubagpt-map-modal-body {
    padding: 24px 28px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.scubagpt-map-modal-body h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: #1a1a1a;
    line-height: 1.3;
}

/* ── Close button ────────────────────────────────────────────────────────── */

.scubagpt-map-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.15s;
}

.scubagpt-map-modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #000;
}

/* ── Copy button ─────────────────────────────────────────────────────────── */

.scubagpt-map-modal-copy {
    margin: 0 28px 20px;
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    align-self: flex-start;
    transition: background 0.15s, border-color 0.15s;
}

.scubagpt-map-modal-copy:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

/* ── Modal table ─────────────────────────────────────────────────────────── */

.scubagpt-modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 14px;
}

.scubagpt-modal-table td {
    padding: 5px 8px 5px 0;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.scubagpt-modal-table .modal-label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    width: 130px;
}

.scubagpt-modal-table a {
    color: #0077be;
    text-decoration: none;
    word-break: break-all;
}

.scubagpt-modal-table a:hover {
    text-decoration: underline;
}

/* ── Description block ───────────────────────────────────────────────────── */

.modal-description {
    margin: 12px 0 8px;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.modal-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.scubagpt-map-badge-resort,
.scubagpt-map-badge-liveaboard {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.scubagpt-map-badge-resort {
    background: #e8f4fd;
    color: #0077be;
}

.scubagpt-map-badge-liveaboard {
    background: #fff3e0;
    color: #e68a00;
}

/* ── Nearby dive sites list ──────────────────────────────────────────────── */

.modal-nearby {
    margin-top: 12px;
}

.modal-nearby strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.modal-nearby ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-nearby li {
    padding: 4px 0;
    font-size: 13px;
    color: #444;
    border-bottom: 1px solid #f5f5f5;
}

.modal-nearby .nearby-dist {
    color: #888;
    font-size: 12px;
}

/* ── Layer control override ──────────────────────────────────────────────── */

.leaflet-control-layers-list label {
    font-size: 13px;
    padding: 2px 0;
}
