/* Container Wrapper for both Map and Sidebar Layout */
.india-map-wrapper {
    width: 100%;
    margin: 20px 0;
    box-sizing: border-box;
}

.cmi-container {
    display: flex;
    flex-direction: row;
    position: relative;
    width: 100%;
    height: 900px;
    /* Explicit height ensures the map doesn't collapse */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Map Canvas Layout */
#india-leaflet-map {
    flex: 1;
    height: 100% !important;
    /* Force explicit expansion within flexbox */
    width: 100%;
    z-index: 1;
}

/* Sidebar Infobox Styling */
#cmi-sidebar {
    width: 450px;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    padding: 25px;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 2;
}

#cmi-sidebar.cmi-closed {
    transform: translateX(100%);
    opacity: 0;
    width: 0;
    min-width: 0;
    flex: 0 0 0;
    padding: 0;
    border-left: none;
}

.cmi-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #4a5568;
    line-height: 1px;
    z-index: 10;
    padding: 0;
	display: none;
}

.cmi-close-btn:hover {
    background: #edf2f7;
    color: #1a202c;
}

.cmi-img-wrap {
    width: 100%;
    margin-bottom: 16px;
/*     margin-top: 20px; */
}

.cmi-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Title & Description Inside the Panel */
.cmi-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.3;
}

.cmi-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Container Wrapper for both Map and Sidebar Layout */
#cmi-sidebar {
    width: 450px;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    padding: 25px;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Custom Marker Pin Layer Base Setup */
.cmi-custom-pin-container {
    background: none !important;
    border: none !important;
    position: relative;
}


.cmi-marker-bounce-wrapper {
    position: absolute;
    width: 25px;
    height: 41px;
    z-index: 2;
}

.cmi-marker-icon {
    width: 25px;
    height: 41px;
    display: block;
}

.cmi-marker-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 41px;
    height: 41px;
    z-index: 1;
    pointer-events: none;
}

/* Red Color Custom Filter */
.cmi-marker-icon.red-marker {
    filter: hue-rotate(140deg) saturate(140%) brightness(90%);
}


/* Safe CSS Bounce Effect Rule targeting only the internal element layout */
@keyframes markerBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.cmi-marker-bounce-wrapper.bouncing-marker {
    animation: markerBounce 0.6s infinite ease-in-out;
}

/* Infobox Content Change Animation (Smooth Fade & Slide up) */
.cmi-animate-content {
    animation: cmiFadeInUp 0.4s ease forwards;
}

@keyframes cmiFadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive adjustment for 450px sidebar width */
@media (max-width: 768px) {
    #cmi-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .cmi-container {
        flex-direction: column;
        height: auto;
    }

    #cmi-map {
        height: 500px;
    }

    #cmi-sidebar {
        height: 400px;
        border-left: none;
    }

    #cmi-sidebar.cmi-closed {
        transform: translateY(100%);
    }
}

.leaflet-touch .leaflet-bar a {
    text-decoration: none;
}
