/* ================================================================
   DC Map & Latency Block
   ================================================================ */

.dc-map-latency {
    background: #f7f9fc;
    padding: 60px 0 40px;
}

.dc-map-latency .container {
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ────────────────────────────────────────────────────── */

.dc-map-header {
    text-align: center;
    margin-bottom: 30px;
}

.dc-map-title {
    font-size: 34px;
    font-weight: 700;
    color: #182A51;
    margin: 0 0 18px;
    line-height: 1.5;
}

.dc-map-subtitle {
    font-size: 18px;
    color: #5A6C8F;
    margin: 0 0 44px;
    line-height: 1.5;
}

/* ── User Location Badge ───────────────────────────────────────── */

.dc-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
}

.dc-user-badge__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #2B5CED;
    border-radius: 50%;
}

.dc-user-badge__icon svg {
    width: 20px;
    height: 20px;
}

.dc-user-badge__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dc-user-badge__label {
    font-size: 14px;
    color: #5A6C8F;
    display: block;
    line-height: 1.5;
}

.dc-user-badge__value {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.5;
    color: #182A51;
}

/* ── Map Container ─────────────────────────────────────────────── */

.dc-map-container {
    background: #f0f4fa;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.dc-map-container svg {
    display: block;
    width: 100%;
    height: auto;
    padding: 32px;
    background-color: #fff;
}

.dc-map-container svg circle:has(:not(.dc-marker--top)) {
    pointer-events: none;
}

/* ── Top 3 Cards ───────────────────────────────────────────────── */

.dc-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dc-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dc-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dc-card__pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #2B5CED1A;
    border-radius: 50%;
}

.dc-card__rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #3B5FE5;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
}

.dc-card__name {
    font-size: 20px;
    line-height: 1.5;
    font-weight: 700;
    color: #182A51;
    margin: 0 0 16px;
}

.dc-card__country {
    font-size: 14px;
    line-height: 1.5;
    color: #5A6C8F;
    margin: 0 0 13px;
}

.dc-card__distance,
.dc-card__latency {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
    background: #F0F4FB;
    border-radius: 10px;
    min-height: 73px;
}

.dc-card__distance {
    margin-bottom: 13px;
}

.dc-card__distance-label {
    display: block;
    font-size: 12px;
    color: #5A6C8F;
    margin-bottom: 5px;
}

.dc-card__distance-value {
    font-size: 18px;
    font-weight: 700;
    color: #2B5CED;
}

/* ── Latency Button & Result ───────────────────────────────────── */

.dc-latency-btn {
    background: none;
    border: none;
    color: #5A6C8F;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
    transition: color 0.15s;
}

.dc-latency-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.dc-latency-gif {
  max-width: 40px;  
}

.dc-latency-btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    border: 2px solid #3B5FE5;
    border-top-color: transparent;
    border-radius: 50%;
    animation: dc-spin 0.6s linear infinite;
    vertical-align: middle;
}

.dc-latency-gif {
    display: block;
    max-height: 40px;
    width: auto;
}

@keyframes dc-spin {
    to { transform: rotate(360deg); }
}

.dc-latency-result__label {
    display: block;
    font-size: 12px;
    color: #5A6C8F;
    margin-bottom: 5px;
}

.dc-latency-result__value {
    font-size: 18px;
    font-weight: 700;
    color: #10B981;
}

.dc-latency-result__value.error {
    color: #ef4444;
    font-size: 13px;
    font-weight: 400;
}

/* ── Full DC List ──────────────────────────────────────────────── */

.dc-list-section {
    margin-bottom: 32px;
}

.dc-list-title {
    font-size: 22px;
    font-weight: 600;
    color: #182A51;
    text-align: center;
    margin: 0 0 24px;
}

.dc-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.dc-list-item {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.dc-list-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.dc-list-item--highlighted {
    background: #3B5FE5;
    border-color: #3B5FE5;
}

.dc-list-item--highlighted .dc-list-item__name,
.dc-list-item--highlighted .dc-list-item__country,
.dc-list-item--highlighted .dc-list-item__distance {
    color: #fff;
}

.dc-list-item--highlighted .dc-latency-btn {
    color: rgba(255, 255, 255, 0.85);
}

.dc-list-item--highlighted .dc-latency-btn:hover {
    color: #fff;
}

.dc-list-item--highlighted .dc-latency-result__label {
    color: rgba(255, 255, 255, 0.7);
}

.dc-list-item--highlighted .dc-latency-result__value {
    color: #a7f3d0;
}

.dc-list-item__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #17307A;
    margin-bottom: 2px;
}

.dc-list-item__country {
    display: block;
    font-size: 12px;
    color: #8896a6;
    margin-bottom: 6px;
}

.dc-list-item__distance {
    display: block;
    font-size: 12px;
    color: #5a6a80;
    margin-bottom: 6px;
}

.dc-list-item__latency {
    display: block;
}

.dc-list-item__latency .dc-latency-btn {
    font-size: 12px;
    color: #8AA3F7;
}

.dc-list-item__latency .dc-latency-result__value {
    font-size: 15px;
}

/* ── ProTip ────────────────────────────────────────────────────── */

.dc-protip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #EFF6FF;
    border-radius: 10px;
    padding: 16px 24px;
    margin-bottom: 32px;
    font-size: 14px;
    color: #333;
}

.dc-protip__icon {
    flex-shrink: 0;
    display: flex;
}

.dc-protip__label {
    font-weight: 700;
    color: #17307A;
    white-space: nowrap;
}

.dc-protip__text {
    color: #5a6a80;
}

/* ── CTA ───────────────────────────────────────────────────────── */

.dc-map-cta {
    text-align: center;
    margin-top: 8px;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 920px) {
    .dc-map-title {
        font-size: 28px;
    }

    .dc-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dc-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .dc-map-latency {
        padding: 40px 0 24px;
    }

    .dc-map-title {
        font-size: 24px;
    }

    .dc-cards {
        grid-template-columns: 1fr;
    }

    .dc-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .dc-protip {
        flex-direction: column;
        text-align: center;
    }

    .dc-user-badge {
        flex-direction: column;
        padding: 12px 20px;
    }
}