/* Signal.ge Server Locations - svgMap integration */
.locations-svgmap-section {
    padding-top: 0;
}

.locations-svgmap-shell,
.locations-directory-card,
.locations-network-card {
    border: 1px solid var(--site-card-border);
    border-radius: 24px;
    background: var(--site-card-bg);
    box-shadow: var(--site-card-shadow);
    overflow: hidden;
}

.locations-svgmap-head,
.locations-directory-head,
.locations-network-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.4rem 1.5rem;
    border-bottom: 1px solid var(--site-card-border);
}

.locations-svgmap-caption {
    font-size: 1.12rem;
    color: var(--site-text-main);
    margin-bottom: .35rem;
}

.locations-svgmap-hint,
.locations-network-text,
.locations-directory-text {
    color: var(--site-text-soft);
    line-height: 1.75;
}

.locations-svgmap-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr);
    gap: 0;
}

.locations-svgmap-map-wrap {
    position: relative;
    min-height: 590px;
    padding: 1rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(8, 121, 250, .10), transparent 30%),
        radial-gradient(circle at 86% 36%, rgba(44, 145, 255, .12), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.locations-map-overlay[hidden] {
    display: none !important;
}

.locations-map-overlay {
    position: absolute;
    inset: 1rem;
    z-index: 18;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(15, 23, 42, .22);
}

.locations-map-overlay.is-visible {
    display: flex;
}

.locations-map-overlay-card {
    position: relative;
    width: min(340px, 100%);
    border: 1px solid var(--server-locations-tooltip-border);
    border-radius: 18px;
    background: var(--server-locations-tooltip-bg);
    color: var(--server-locations-tooltip-text);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    overflow: hidden;
}

.locations-map-overlay-close {
    position: absolute;
    top: .7rem;
    right: .7rem;
    z-index: 1;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
}

.locations-map-overlay-body {
    display: grid;
    gap: .85rem;
    padding: 1rem 1.05rem;
    padding-right: 2.8rem;
}

.locations-map-overlay-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.locations-map-overlay-flag {
    font-size: 1.65rem;
    line-height: 1;
    flex: 0 0 auto;
}

.locations-map-overlay-copy {
    min-width: 0;
}

.locations-map-overlay-title {
    display: block;
    margin: 0;
    color: inherit;
    font-size: 1rem;
    line-height: 1.3;
}

.locations-map-overlay-subtitle {
    display: block;
    margin-top: .2rem;
    color: var(--server-locations-tooltip-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.locations-map-overlay-list {
    display: grid;
    gap: .5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.locations-map-overlay-item {
    display: grid;
    gap: .12rem;
    padding-top: .5rem;
    border-top: 1px solid var(--server-locations-tooltip-divider);
}

.locations-map-overlay-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.locations-map-overlay-item-title {
    display: block;
    margin: 0;
    color: inherit;
    font-size: .9rem;
    line-height: 1.35;
}

.locations-map-overlay-item-meta {
    display: block;
    color: var(--server-locations-tooltip-muted);
    font-size: .78rem;
    line-height: 1.5;
}

.server-locations-svgmap {
    width: 100%;
    min-height: 560px;
    border-radius: 22px;
    overflow: hidden;
}

.server-locations-svgmap .svgMap-map-wrapper {
    min-height: 100%;
    padding-top: 58%;
    border-radius: 22px;
}

.server-locations-svgmap .svgMap-map-image {
    width: 100% !important;
    height: 100% !important;
}

.locations-svgmap-side {
    display: grid;
    align-content: start;
    gap: 1rem;
    border-left: 1px solid var(--site-card-border);
    background: rgba(248, 251, 255, .72);
    padding: 1.25rem;
}

.locations-map-tooltip {
    display: grid;
    gap: .85rem;
    min-width: 250px;
    max-width: 290px;
    padding: 1rem 1.05rem;
    color: inherit;
}

.locations-map-tooltip-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.locations-map-tooltip-flag {
    font-size: 1.65rem;
    line-height: 1;
    flex: 0 0 auto;
}

.locations-map-tooltip-copy {
    min-width: 0;
}

.locations-map-tooltip-title {
    display: block;
    margin: 0;
    color: inherit;
    font-size: 1rem;
    line-height: 1.3;
}

.locations-map-tooltip-subtitle {
    display: block;
    margin-top: .2rem;
    color: var(--server-locations-tooltip-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.locations-map-tooltip-list {
    display: grid;
    gap: .5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.locations-map-tooltip-node {
    display: grid;
    gap: .12rem;
    padding-top: .5rem;
    border-top: 1px solid var(--server-locations-tooltip-divider);
}

.locations-map-tooltip-node:first-child {
    padding-top: 0;
    border-top: 0;
}

.locations-map-tooltip-node strong {
    display: block;
    margin: 0;
    color: inherit;
    font-size: .9rem;
    line-height: 1.35;
}

.locations-map-tooltip-node span {
    display: block;
    color: var(--server-locations-tooltip-muted);
    font-size: .78rem;
    line-height: 1.5;
}

.locations-mobile-country-picker-title {
    margin: 1rem 0 .7rem;
    color: var(--site-text-soft);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.locations-mobile-country-picker {
    display: block;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, .18);
}

.locations-svgmap-side .locations-mobile-country-picker {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.locations-svgmap-side .locations-mobile-country-picker-title {
    margin-top: 0;
}

.locations-mobile-country-list {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.locations-mobile-country {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .65rem;
    width: 100%;
    min-width: 0;
    min-height: 74px;
    padding: .85rem .95rem;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    color: var(--site-text-main);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    text-align: left;
    touch-action: manipulation;
    overflow: hidden;
}

.locations-mobile-country.is-active {
    border-color: rgba(8, 121, 250, .34);
    background: rgba(8, 121, 250, .09);
    box-shadow: 0 14px 30px rgba(8, 121, 250, .12);
}

.locations-mobile-country-flag {
    font-size: 1.2rem;
    line-height: 1;
    flex: 0 0 auto;
}

.locations-mobile-country-copy {
    display: grid;
    gap: .12rem;
    min-width: 0;
    text-align: left;
    overflow: hidden;
}

.locations-mobile-country-copy strong {
    display: block;
    color: inherit;
    font-size: .92rem;
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.locations-mobile-country-copy span {
    display: block;
    color: var(--site-text-soft);
    font-size: .76rem;
    line-height: 1.45;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* svgMap overrides */
.server-locations-svgmap .svgMap-map-wrapper,
.server-locations-svgmap .svgMap-map-container,
.server-locations-svgmap .svgMap-map-controls-wrapper {
    background: transparent !important;
}

.server-locations-svgmap .svgMap-map-continent-controls-wrapper {
    display: none !important;
}

.server-locations-svgmap .svgMap-country {
    stroke: rgba(255, 255, 255, .88);
    stroke-width: .7;
    touch-action: manipulation;
}

.server-locations-svgmap .svgMap-country.is-node-country {
    cursor: pointer;
}

.server-locations-svgmap .svgMap-country.is-node-country:hover,
.server-locations-svgmap .svgMap-country.is-node-country.svgMap-active {
    stroke: #0f172a;
    stroke-width: 1.35;
}

body.server-locations-has-map {
    --server-locations-map-base-fill: #dce7f2;
    --server-locations-tooltip-bg: rgba(255, 255, 255, .96);
    --server-locations-tooltip-border: rgba(148, 163, 184, .35);
    --server-locations-tooltip-divider: rgba(148, 163, 184, .22);
    --server-locations-tooltip-muted: #5f7084;
    --server-locations-tooltip-text: #102033;
}

body.server-locations-has-map .svgMap-tooltip {
    border: 1px solid var(--server-locations-tooltip-border) !important;
    border-radius: 18px !important;
    background: var(--server-locations-tooltip-bg) !important;
    color: var(--server-locations-tooltip-text) !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18) !important;
    z-index: 16 !important;
}

body.server-locations-has-map .svgMap-tooltip.svgMap-tooltip-flipped {
    border-top: 1px solid var(--server-locations-tooltip-border) !important;
}

body.server-locations-has-map .svgMap-tooltip .svgMap-tooltip-content-wrapper {
    font-family: inherit !important;
    white-space: normal !important;
}

body.server-locations-has-map .svgMap-tooltip .svgMap-tooltip-pointer::after {
    background: var(--server-locations-tooltip-bg) !important;
    border-color: var(--server-locations-tooltip-border) !important;
}

[data-bs-theme="dark"] .locations-svgmap-map-wrap,
.dark-mode .locations-svgmap-map-wrap {
    background:
        radial-gradient(circle at 20% 20%, rgba(8, 121, 250, .18), transparent 30%),
        radial-gradient(circle at 86% 36%, rgba(44, 145, 255, .16), transparent 28%),
        linear-gradient(180deg, #0b1220 0%, #111827 100%);
}

[data-bs-theme="dark"] .locations-svgmap-side,
.dark-mode .locations-svgmap-side {
    background: rgba(15, 23, 42, .62);
}

[data-bs-theme="dark"] .locations-mobile-country,
.dark-mode .locations-mobile-country {
    background: rgba(17, 24, 39, .88);
    border-color: rgba(148, 163, 184, .16);
}

[data-bs-theme="dark"] .locations-mobile-country-copy strong,
.dark-mode .locations-mobile-country-copy strong {
    color: #f8fafc;
}

[data-bs-theme="dark"] .locations-mobile-country-copy span,
.dark-mode .locations-mobile-country-copy span {
    color: #9bb0c9;
}

[data-bs-theme="dark"] .server-locations-svgmap .svgMap-country.is-node-country:hover,
.dark-mode .server-locations-svgmap .svgMap-country.is-node-country:hover,
[data-bs-theme="dark"] .server-locations-svgmap .svgMap-country.is-node-country.svgMap-active,
.dark-mode .server-locations-svgmap .svgMap-country.is-node-country.svgMap-active {
    stroke: #f8fafc;
}

[data-bs-theme="dark"] body.server-locations-has-map,
body[data-bs-theme="dark"].server-locations-has-map,
.dark-mode body.server-locations-has-map,
body.dark-mode.server-locations-has-map {
    --server-locations-map-base-fill: #27364b;
    --server-locations-tooltip-bg: rgba(10, 18, 32, .96);
    --server-locations-tooltip-border: rgba(96, 165, 250, .24);
    --server-locations-tooltip-divider: rgba(148, 163, 184, .18);
    --server-locations-tooltip-muted: #9bb0c9;
    --server-locations-tooltip-text: #f8fbff;
}

@media (max-width: 991.98px) {
    body.server-locations-map-overlay-open {
        overflow: hidden;
    }

    body.server-locations-map-overlay-open .locations-svgmap-shell,
    body.server-locations-map-overlay-open .locations-svgmap-map-wrap {
        overflow: visible;
    }

    .locations-svgmap-layout {
        grid-template-columns: 1fr;
    }

    .locations-svgmap-map-wrap {
        min-height: 0;
        padding: .85rem;
    }

    .server-locations-svgmap {
        min-height: 0;
    }

    .server-locations-svgmap .svgMap-map-wrapper {
        padding-top: 64%;
    }

    .server-locations-svgmap .svgMap-map-controls-wrapper {
        display: none !important;
    }

    .locations-svgmap-side {
        border-left: 0;
        border-top: 1px solid var(--site-card-border);
        padding: 1rem;
    }

    .locations-mobile-country-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .locations-map-overlay {
        position: fixed;
        inset: 0;
        z-index: 1080;
        padding: 1rem;
        border-radius: 0;
        background: rgba(15, 23, 42, .42);
    }

    .locations-map-overlay-card {
        width: min(360px, calc(100vw - 2rem));
        max-height: min(78vh, 560px);
        overflow: auto;
    }

    body.server-locations-has-map .svgMap-tooltip {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .locations-svgmap-head,
    .locations-network-head {
        flex-direction: column;
        padding: 1.25rem;
    }

    .locations-svgmap-map-wrap {
        min-height: 0;
        padding: .5rem;
    }

    .locations-svgmap-side {
        padding: .95rem .85rem;
    }

    .locations-map-tooltip {
        min-width: 220px;
        max-width: 250px;
        padding: .95rem;
    }

    .locations-mobile-country-picker {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .locations-mobile-country-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .locations-mobile-country {
        min-height: 70px;
        padding: .78rem .8rem;
        gap: .55rem;
    }

    .locations-mobile-country-copy strong {
        font-size: .86rem;
    }

    .locations-map-overlay-card {
        width: min(100%, 360px);
    }
}

@media (max-width: 369.98px) {
    .locations-mobile-country-list {
        grid-template-columns: 1fr;
    }
}
