/* -------------------------------------------------------------
 * Common Map Stylesheet (Blue Oyster - India & Sri Lanka Maps)
 * ------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Playfair Display', Georgia, serif;
    background: #eef5fb;
    user-select: none;
    -webkit-user-select: none;
}

#wrap {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #f4f8fc 0%, #e2ecf7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .2s ease-out;
    touch-action: none;
}

/* Vector State / Region Paths */
.state {
    fill: #e1e8ed;
    stroke: #ffffff;
    stroke-width: 0.5px;
    transition: fill 0.3s ease-in-out, stroke 0.3s ease-in-out;
}

.state:hover {
    fill: #002B5B;
    stroke: #ffffff;
    stroke-width: 0.5px;
    cursor: pointer;
}

.state.active-state {
    fill: #002B5B !important;
    stroke: #38bdf8 !important;
    stroke-width: 1.2px !important;
    filter: drop-shadow(0 0 8px rgba(0, 43, 91, 0.6));
}

/* Route Lines */
.route-segment-bg {
    fill: none;
    stroke: #1a7abe;
    stroke-width: 2.5;
    stroke-dasharray: 6 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.5;
}

.route-segment {
    fill: none;
    stroke: #002B5B;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1;
    transition: stroke-dashoffset 1.2s ease-in-out;
    filter: drop-shadow(0 0 6px rgba(0, 43, 91, 0.5));
}

/* Destination Markers / Dots (ALL BLUE - No Red or Green) */
.dot {
    fill: #1a7abe !important;
    cursor: pointer;
    transition: transform 0.3s ease, r 0.3s ease, fill 0.3s ease;
    transform-origin: center;
    transform-box: fill-box;
    animation: pulse 3s infinite ease-in-out;
}

.start-dot, .end-dot, .mid-dot {
    fill: #1a7abe !important;
    animation: pulse 3s infinite ease-in-out !important;
}

.dot:hover, .dot.active {
    animation: none !important;
    r: 8.5 !important;
    fill: #002B5B !important;
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 0 8px rgba(0, 43, 91, 0.9));
}

@keyframes pulse {
    0% {
        r: 5;
        fill: #1a7abe;
        opacity: 0.85;
        filter: drop-shadow(0 0 2px rgba(26, 122, 190, 0.4));
    }
    50% {
        r: 7;
        fill: #4fc3f7;
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(79, 195, 247, 0.8));
    }
    100% {
        r: 5;
        fill: #1a7abe;
        opacity: 0.85;
        filter: drop-shadow(0 0 2px rgba(26, 122, 190, 0.4));
    }
}

.pulse-ring {
    fill: none;
    stroke: #1a7abe !important;
    stroke-width: 1.5;
    transform-origin: center;
    transform-box: fill-box;
    pointer-events: none;
    animation: expandRing 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.start-ring, .end-ring {
    stroke: #1a7abe !important;
}

@keyframes expandRing {
    0% {
        r: 6;
        opacity: 0.9;
        stroke-width: 2;
    }
    100% {
        r: 16;
        opacity: 0;
        stroke-width: 0.5;
    }
}

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

.zoom button {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(13, 43, 62, 0.15);
    background: #ffffff;
    color: #0d2b3e;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom button:hover {
    background: #f0f7ff;
    color: #1a7abe;
}

/* Connector Line Hidden (Removed per user request) */
.pop-connector-line {
    display: none !important;
    opacity: 0 !important;
}

/* Destination Tooltip Popup Card */
#popup {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    width: 260px;
    max-width: calc(100vw - 30px);
    box-shadow: 0 12px 38px rgba(13, 43, 62, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 25;
    overflow: hidden;
    border: 1px solid rgba(13, 43, 62, 0.12);
}

#popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Clean Minimal White Close Icon */
.pop-close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pop-close-btn:hover {
    opacity: 1;
    color: #ffffff !important;
    background: transparent !important;
    transform: scale(1.1);
}

.pop-image-container {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: linear-gradient(135deg, #0d2b3e, #1a7abe);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pop-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.pop-image-fallback {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
    font-family: inherit;
    text-align: center;
    padding: 0 10px;
}

.pop-body {
    padding: 16px 18px 14px;
}

.pop-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.pop-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0d2b3e;
    line-height: 1.25;
}

.pop-desc {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.45;
    font-family: 'Inter', sans-serif;
    margin-bottom: 12px;
}

.pop-hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 8px 0;
}

.pop-tours {
    display: flex;
    align-items: center;
    font-size: 0.76rem;
    color: #0d2b3e;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

/* State Click Drawer / Popup */
#state-popup {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    width: 290px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 12px 38px rgba(13, 43, 62, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 35;
    overflow: hidden;
    border: 1px solid rgba(13, 43, 62, 0.12);
    display: flex;
    flex-direction: column;
}

#state-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.state-pop-head {
    background: linear-gradient(135deg, #0d2b3e, #1a7abe);
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.state-pop-name {
    font-size: 1rem;
    font-weight: 700;
}

.state-pop-locations {
    font-size: 0.74rem;
    color: #1a7abe;
    background: #e1f5fe;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 10px;
    white-space: nowrap;
}

/* Clean Minimal White State Close Icon */
.state-pop-close {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 300;
    color: #ffffff !important;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.state-pop-close:hover {
    opacity: 1;
    color: #ffffff !important;
    transform: scale(1.1);
}

#sp-content {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    font-family: 'Inter', sans-serif;
}

.state-pop-empty {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px 10px;
}

.state-pop-city-item {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.state-pop-city-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 43, 62, 0.08);
}

.state-pop-city-img-box {
    position: relative;
    height: 90px;
    background: #e2e8f0;
}

.state-pop-city-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.state-pop-city-img-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}

.state-pop-city-body {
    padding: 10px 12px;
}

.state-pop-city-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0d2b3e;
    margin-bottom: 4px;
}

.state-pop-city-tag {
    font-size: 0.65rem;
    background: rgba(13, 43, 62, 0.85);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.state-pop-city-desc {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.35;
    margin-bottom: 6px;
}

.state-pop-city-tours {
    font-size: 0.72rem;
    color: #1a7abe;
    font-weight: 600;
}

/* Hover State Tooltip */
#state-tooltip {
    position: absolute;
    background: rgba(13, 43, 62, 0.9);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}
