/* ==========================================================================
   Gujarat Map Interactive Styles
   ========================================================================== */

.map-interactive-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

/* Colors for Zones */
:root {
    --zone-center: #F59E0B;
    /* Gold/Orange */
    --zone-north: #10B981;
    /* Emerald Green */
    --zone-south: #3B82F6;
    /* Royal Blue */
    --zone-west: #EC4899;
    /* Rose Pink */
}

/* ================== MAP VISUAL ================== */
.gujarat-map-visual {
    flex: 1 1 500px;
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

/* Inner container scales exactly with the SVG map aspect ratio (800x533) */
.map-inner-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 800 / 533;
}

svg#Layer_1 {
    width: 100%;
    height: 100%;
    display: block;
}

/* Base district styling */
.district-path {
    transition: fill 0.3s ease, stroke 0.3s ease, stroke-width 0.3s ease;
    cursor: pointer;
}

/* Inactive districts (non-society) styling */
.district-path.inactive-district {
    cursor: default !important;
    pointer-events: none !important;
}

/* Zone colors (soft fill with clear borders) */
.district-path[data-zone="north"] {
    fill: rgba(16, 185, 129, 0.12);
    stroke: rgba(16, 185, 129, 0.45);
    stroke-width: 0.8px;
}

.district-path[data-zone="center"] {
    fill: rgba(245, 158, 11, 0.12);
    stroke: rgba(245, 158, 11, 0.45);
    stroke-width: 0.8px;
}

.district-path[data-zone="south"] {
    fill: rgba(59, 130, 246, 0.12);
    stroke: rgba(59, 130, 246, 0.45);
    stroke-width: 0.8px;
}

.district-path[data-zone="west"] {
    fill: rgba(236, 72, 153, 0.12);
    stroke: rgba(236, 72, 153, 0.45);
    stroke-width: 0.8px;
}

/* Hover highlights in primary zone colors */
.district-path[data-zone="north"]:hover,
.district-path[data-zone="north"].active,
.district-path[data-zone="north"].highlighted {
    fill: rgba(16, 185, 129, 0.75) !important;
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
}

.district-path[data-zone="center"]:hover,
.district-path[data-zone="center"].active,
.district-path[data-zone="center"].highlighted {
    fill: rgba(245, 158, 11, 0.75) !important;
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
}

.district-path[data-zone="south"]:hover,
.district-path[data-zone="south"].active,
.district-path[data-zone="south"].highlighted {
    fill: rgba(59, 130, 246, 0.75) !important;
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
}

.district-path[data-zone="west"]:hover,
.district-path[data-zone="west"].active,
.district-path[data-zone="west"].highlighted {
    fill: rgba(236, 72, 153, 0.75) !important;
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
}

/* Hide SVG text labels from blocking pointer events */
svg#Layer_1 text {
    pointer-events: none;
    user-select: none;
    fill: #1e293b;
    font-weight: bold;
    font-size: 8px !important;
    /* Make font slightly cleaner */
}

/* Dim others logic when a district is active */
.gujarat-map-visual.dim-others .district-path:not(.active):not(.highlighted) {
    opacity: 0.3;
}

/* Floating custom map tooltip */
.map-floating-tooltip {
    position: absolute;
    z-index: 9999;
    background: #0b132b;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -105%) scale(0.95);
    transition: transform 0.15s ease, opacity 0.15s ease, visibility 0.15s ease;
    box-shadow: 0 10px 30px rgba(11, 19, 43, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.map-floating-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -105%) scale(1);
}

/* Map Nodes */
.map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-node:hover,
.map-node.active,
.map-node.zone-active {
    z-index: 10;
}

/* Map Pin */
.map-pin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--node-color, #ffba00);
    box-shadow: 0 0 10px var(--node-color, #ffba00);
    border: 2px solid #ffffff;
    transition: all 0.3s ease;
    position: relative;
}

/* Pulse expansion effect behind pin */
.map-pin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--node-color, #ffba00);
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pinPulse 2.4s infinite ease-out;
}

@keyframes pinPulse {
    0% {
        width: 10px;
        height: 10px;
        opacity: 0.8;
    }

    100% {
        width: 32px;
        height: 32px;
        opacity: 0;
    }
}

/* Custom interactive region boundary highlight */
.map-boundary-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    border: 2px solid var(--node-color, #ffba00);
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    pointer-events: none;
    background-color: rgba(var(--node-color-rgb, 245, 158, 11), 0.08);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: inset 0 0 20px rgba(var(--node-color-rgb, 245, 158, 11), 0.15),
        0 0 15px rgba(var(--node-color-rgb, 245, 158, 11), 0.1);
}

.map-node:hover .map-pin,
.map-node.active .map-pin,
.map-node.zone-active .map-pin {
    transform: scale(1.3);
    background-color: #ffffff;
    border-color: var(--node-color, #ffba00);
}

.map-node:hover .map-boundary-glow,
.map-node.active .map-boundary-glow,
.map-node.zone-active .map-boundary-glow {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.0);
    animation: morphGlow 8s infinite alternate ease-in-out, rotateGlow 25s infinite linear;
}

@keyframes morphGlow {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 50% 50% 30% 70% / 50% 60% 40% 60%;
    }

    100% {
        border-radius: 70% 30% 50% 50% / 30% 50% 50% 70%;
    }
}

@keyframes rotateGlow {
    from {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

/* Zone Specific Styles for Nodes */
.map-node[data-zone="center"] {
    --node-color: var(--zone-center);
    --node-color-rgb: 245, 158, 11;
}

.map-node[data-zone="north"] {
    --node-color: var(--zone-north);
    --node-color-rgb: 16, 185, 129;
}

.map-node[data-zone="south"] {
    --node-color: var(--zone-south);
    --node-color-rgb: 59, 130, 246;
}

.map-node[data-zone="west"] {
    --node-color: var(--zone-west);
    --node-color-rgb: 236, 72, 153;
}

/* Dim state when another node/zone is active */
.gujarat-map-visual.dim-others .map-node:not(.zone-active):not(.active) {
    opacity: 0.25;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Tooltip container */
.map-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -10px) scale(0.9);
    background: #0b132b;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(11, 19, 43, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
}

.map-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #0b132b transparent transparent transparent;
}

/* Tooltip Typography */
.tooltip-city {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px 0;
    color: #ffffff;
    font-family: var(--ztc-family-font1);
}

.tooltip-zone {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--ztc-family-font1);
}

.tooltip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

.tooltip-count {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    color: #ffba00;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Trigger states for tooltips */
.map-node:hover .map-tooltip,
.map-node.active .map-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -15px) scale(1);
}

/* ================== LEGEND / LIST ================== */
.zone-legend-container {
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.zone-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #eee;
    transition: all 0.3s ease;
    cursor: default;
}

.zone-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Zone Specific Card Borders */
.zone-card[data-zone="center"] {
    border-left-color: var(--zone-center);
}

.zone-card[data-zone="north"] {
    border-left-color: var(--zone-north);
}

.zone-card[data-zone="south"] {
    border-left-color: var(--zone-south);
}

.zone-card[data-zone="west"] {
    border-left-color: var(--zone-west);
}

.zone-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.zone-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
}

.zone-card[data-zone="center"] .zone-dot {
    background-color: var(--zone-center);
}

.zone-card[data-zone="north"] .zone-dot {
    background-color: var(--zone-north);
}

.zone-card[data-zone="south"] .zone-dot {
    background-color: var(--zone-south);
}

.zone-card[data-zone="west"] .zone-dot {
    background-color: var(--zone-west);
}

.zone-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0C1A24;
}

.zone-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.zone-cities li {
    background: #F8F9FA;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Hover effects for cities tied to zones */
.zone-card[data-zone="center"] .zone-cities li:hover,
.zone-cities li.active[data-zone="center"] {
    background: rgba(245, 158, 11, 0.1);
    color: var(--zone-center);
    border-color: rgba(245, 158, 11, 0.3);
}

.zone-card[data-zone="north"] .zone-cities li:hover,
.zone-cities li.active[data-zone="north"] {
    background: rgba(16, 185, 129, 0.1);
    color: var(--zone-north);
    border-color: rgba(16, 185, 129, 0.3);
}

.zone-card[data-zone="south"] .zone-cities li:hover,
.zone-cities li.active[data-zone="south"] {
    background: rgba(59, 130, 246, 0.1);
    color: var(--zone-south);
    border-color: rgba(59, 130, 246, 0.3);
}

.zone-card[data-zone="west"] .zone-cities li:hover,
.zone-cities li.active[data-zone="west"] {
    background: rgba(236, 72, 153, 0.1);
    color: var(--zone-west);
    border-color: rgba(236, 72, 153, 0.3);
}

/* ================== SOCIETIES LIST GRID ================== */
.societies-list-section {
    background: #f8fafc;
    padding: 100px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.society-zone-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.society-zone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #eee;
}

.society-zone-card[data-zone="center"]::before { background: var(--zone-center); }
.society-zone-card[data-zone="north"]::before { background: var(--zone-north); }
.society-zone-card[data-zone="south"]::before { background: var(--zone-south); }
.society-zone-card[data-zone="west"]::before { background: var(--zone-west); }

.society-zone-card:hover {
    transform: translateY(-5px);
}
.society-zone-card[data-zone="center"]:hover { box-shadow: 0 15px 40px rgba(245, 158, 11, 0.12); }
.society-zone-card[data-zone="north"]:hover { box-shadow: 0 15px 40px rgba(16, 185, 129, 0.12); }
.society-zone-card[data-zone="south"]:hover { box-shadow: 0 15px 40px rgba(59, 130, 246, 0.12); }
.society-zone-card[data-zone="west"]:hover { box-shadow: 0 15px 40px rgba(236, 72, 153, 0.12); }

.zone-card-header {
    margin-bottom: 24px;
}

.zone-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge-center {
    background: rgba(245, 158, 11, 0.1);
    color: var(--zone-center);
}
.badge-north {
    background: rgba(16, 185, 129, 0.1);
    color: var(--zone-north);
}
.badge-south {
    background: rgba(59, 130, 246, 0.1);
    color: var(--zone-south);
}
.badge-west {
    background: rgba(236, 72, 153, 0.1);
    color: var(--zone-west);
}

.society-cities-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.society-cities-list li {
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.society-cities-list li i {
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.society-zone-card[data-zone="center"] .society-cities-list li i { color: var(--zone-center); }
.society-zone-card[data-zone="north"] .society-cities-list li i { color: var(--zone-north); }
.society-zone-card[data-zone="south"] .society-cities-list li i { color: var(--zone-south); }
.society-zone-card[data-zone="west"] .society-cities-list li i { color: var(--zone-west); }

/* Interactive Hover effect: City name highlights and pin pulses */
.society-cities-list li:hover {
    transform: translateX(6px);
}
.society-zone-card[data-zone="center"] .society-cities-list li:hover { color: var(--zone-center); }
.society-zone-card[data-zone="north"] .society-cities-list li:hover { color: var(--zone-north); }
.society-zone-card[data-zone="south"] .society-cities-list li:hover { color: var(--zone-south); }
.society-zone-card[data-zone="west"] .society-cities-list li:hover { color: var(--zone-west); }

/* Active states for cross-highlighting from map */
.society-zone-card[data-zone="center"] .society-cities-list li.active { color: var(--zone-center); font-weight: 700; transform: translateX(6px); }
.society-zone-card[data-zone="north"] .society-cities-list li.active { color: var(--zone-north); font-weight: 700; transform: translateX(6px); }
.society-zone-card[data-zone="south"] .society-cities-list li.active { color: var(--zone-south); font-weight: 700; transform: translateX(6px); }
.society-zone-card[data-zone="west"] .society-cities-list li.active { color: var(--zone-west); font-weight: 700; transform: translateX(6px); }

/* Responsive */
@media (max-width: 991px) {
    .map-interactive-wrapper {
        flex-direction: column;
    }

    .gujarat-map-visual {
        min-height: 400px;
    }

    .societies-list-section {
        padding: 60px 0;
    }

    .society-zone-card {
        margin-bottom: 24px;
    }
}