/* GTA Service Map — Frontend Styles */

.gta-map-wrap {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Hide labels for non-active regions when in highlight mode */
.gta-map-wrap .label-hidden {
    display: none !important;
}

/* Scrollable zoom container */
.gta-map-viewport {
    overflow: auto;
    position: relative;
    border-radius: 8px;
}

.gta-map-wrap svg {
    display: block;
    transform-origin: 0 0;
    transition: width 0.3s ease;
}

/* Zoom controls */
.gta-zoom-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.gta-zoom-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-size: 20px;
    font-weight: 700;
    color: #1a237e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    font-family: Inter, sans-serif;
}

.gta-zoom-btn:hover {
    background: #2962FF;
    color: #fff;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

.gta-zoom-label {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-align: center;
    padding: 2px 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-family: Inter, sans-serif;
}

/* Region polygon */
.gta-map-wrap .rp {
    cursor: pointer;
    transition: filter 0.2s ease;
}

.gta-map-wrap .rp:hover {
    filter: brightness(1.12) saturate(1.15);
}

/* Greyed-out regions in highlight mode — clickable for navigation */
.gta-map-wrap .rp-disabled {
    cursor: pointer;
    transition: filter 0.2s ease;
}

.gta-map-wrap .rp-disabled:hover {
    filter: brightness(1.08);
}

/* Text labels */
.gta-map-wrap .rt {
    font-family: Inter, sans-serif;
    font-weight: 900;
    font-size: 16px;
    fill: #1a237e;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
    opacity: 0.9;
    stroke: #fff;
    stroke-width: 5px;
    paint-order: stroke fill;
    stroke-linejoin: round;
}

.gta-map-wrap .ml {
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 10px;
    fill: #1a237e;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
    stroke: #fff;
    stroke-width: 4px;
    paint-order: stroke fill;
    stroke-linejoin: round;
}

.gta-map-wrap .ms {
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 8px;
    fill: #1a237e;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: central;
    stroke: #fff;
    stroke-width: 3px;
    paint-order: stroke fill;
    stroke-linejoin: round;
}

/* Tooltip */
body #gta-tooltip {
    position: fixed;
    display: none;
    z-index: 99999999;
    min-width: 260px;
    max-width: 340px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
    animation: gtaTtFade 0.18s ease;
}

@keyframes gtaTtFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flipped animation — popup opens upward */
@keyframes gtaTtFadeUp {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#gta-tooltip.tt-flipped {
    animation: gtaTtFadeUp 0.18s ease;
}

body #gta-tooltip .tt-hdr {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    background: linear-gradient(135deg, #1a237e, #283593) !important;
    color: #fff !important;
}

#gta-tooltip .tt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

body #gta-tooltip .tt-hdr h3,
body #gta-tooltip .tt-hdr h3.entry-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.2 !important;
    border: none !important;
    letter-spacing: 0 !important;
}

body #gta-tooltip .tt-hdr div {
    color: #fff !important;
}

body #gta-tooltip .tt-badge {
    display: block !important;
    font-size: 9px !important;
    opacity: 0.85;
    font-weight: 500 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.2 !important;
}

#gta-tooltip .tt-areas {
    padding: 4px 0 4px;
    max-height: 260px;
    overflow-y: auto;
}

#gta-tooltip .tt-areas h4 {
    padding: 6px 14px 4px;
    font-size: 9px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
    margin: 0;
    font-weight: 600;
}

#gta-tooltip .tt-areas ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#gta-tooltip .tt-areas li {
    padding: 4px 14px 4px 26px;
    font-size: 11.5px;
    color: #333;
    position: relative;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.12s;
    line-height: 1.35;
}

#gta-tooltip .tt-areas li:hover {
    background: #f8f9fb;
}

#gta-tooltip .tt-areas li:last-child {
    border-bottom: none;
}

#gta-tooltip .tt-areas li::before {
    content: '•';
    position: absolute;
    left: 14px;
    color: #2962FF;
    font-weight: 900;
}

#gta-tooltip .tt-areas li a {
    color: #2962FF;
    text-decoration: none;
    font-weight: 600;
}

#gta-tooltip .tt-areas li a:hover {
    text-decoration: underline;
}

/* Municipality name links in tooltip */
#gta-tooltip .tt-areas li .tt-muni-link {
    color: #2962FF;
    text-decoration: none;
}

#gta-tooltip .tt-areas li .tt-muni-link:hover {
    text-decoration: underline;
}

#gta-tooltip .tt-areas li .tt-muni-link strong {
    color: #2962FF;
}

#gta-tooltip .tt-ftr {
    padding: 8px 14px;
    background: #f8f9fb;
    border-top: 1px solid #eee;
}

#gta-tooltip .tt-ftr a {
    display: inline-block;
    padding: 6px 14px;
    background: #2962FF;
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}

#gta-tooltip .tt-ftr a:hover {
    background: #1e50d8;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .gta-map-wrap {
        display: none !important;
    }

    .gta-zoom-controls {
        display: none !important;
    }

    #gta-tooltip {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        max-width: 100%;
        min-width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
        animation: gtaTtSlideUp 0.3s ease;
    }

    @keyframes gtaTtSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    #gta-tooltip .tt-hdr {
        padding: 16px 20px;
        border-radius: 16px 16px 0 0;
    }

    #gta-tooltip .tt-hdr h3 {
        font-size: 17px;
    }

    #gta-tooltip .tt-areas {
        padding: 8px 0 12px;
    }

    #gta-tooltip .tt-areas h4 {
        padding: 8px 20px 6px;
        font-size: 11px;
    }

    #gta-tooltip .tt-areas li {
        padding: 8px 20px 8px 34px;
        font-size: 14px;
    }

    #gta-tooltip .tt-areas li::before {
        left: 20px;
    }

    #gta-tooltip .tt-ftr {
        padding: 14px 20px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    #gta-tooltip .tt-ftr a {
        display: block;
        text-align: center;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
    }

    .gta-tooltip-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 9998;
        animation: gtaOverlayIn 0.2s ease;
    }

    @keyframes gtaOverlayIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}

/* ── Mobile Accordion ── */
.gta-mobile-regions {
    display: none;
    font-family: 'Inter', -apple-system, sans-serif;
}

@media (max-width: 768px) {
    .gta-mobile-regions {
        display: block;
        padding: 0 0 24px;
    }
}

.gta-mobile-regions .gmr-title {
    font-size: 22px;
    font-weight: 900;
    color: #1a237e;
    padding: 20px 16px 16px;
    letter-spacing: -0.5px;
}

.gta-mobile-regions .gmr-subtitle {
    font-size: 13px;
    color: #666;
    padding: 0 16px 16px;
    line-height: 1.4;
}

.gmr-region {
    margin: 0 12px 10px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}

.gmr-region-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: #fff;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.gmr-region-header:active {
    background: #f5f7fa;
}

.gmr-region-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.gmr-region-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a237e;
    flex: 1;
}

.gmr-region-count {
    font-size: 11px;
    color: #888;
    font-weight: 500;
}

.gmr-region-arrow {
    font-size: 14px;
    color: #aaa;
    transition: transform 0.25s ease;
}

.gmr-region.open .gmr-region-arrow {
    transform: rotate(180deg);
}

.gmr-region-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: #f8f9fb;
}

.gmr-region.open .gmr-region-body {
    max-height: 2000px;
}

.gmr-muni {
    border-top: 1px solid #eee;
}

.gmr-muni-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 12px 28px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.gmr-muni-header:active {
    background: #eef2f7;
}

.gmr-muni-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.gmr-muni-arrow {
    font-size: 12px;
    color: #bbb;
    transition: transform 0.2s ease;
}

.gmr-muni.open .gmr-muni-arrow {
    transform: rotate(180deg);
}

.gmr-areas {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.gmr-muni.open .gmr-areas {
    max-height: 600px;
}

.gmr-areas ul {
    list-style: none;
    padding: 4px 16px 10px 44px;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gmr-areas li {
    font-size: 12px;
    color: #555;
    background: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.gmr-areas li a {
    color: #2962FF;
    text-decoration: none;
    font-weight: 600;
}

.gmr-areas li a:hover {
    text-decoration: underline;
}

/* Municipality name links in mobile accordion */
.gmr-muni-link {
    color: #2962FF;
    text-decoration: none;
    font-weight: 600;
}

.gmr-muni-link:hover {
    text-decoration: underline;
}

.gmr-cta {
    display: block;
    margin: 16px 12px 0;
    padding: 14px;
    background: #2962FF;
    color: #fff;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: -0.2px;
    box-shadow: 0 4px 14px rgba(41, 98, 255, 0.25);
    transition: background 0.2s;
}

.gmr-cta:hover {
    background: #1e50d8;
}

@media (min-width: 769px) {
    .gta-mobile-regions {
        display: none !important;
    }
}