/* Frontend Map Styles */
.ipm-map-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

.ipm-base-image {
    width: 100%;
    height: auto;
    display: block;
}

.ipm-marker {
    position: absolute;
    transform: translate(-50%, -100%); /* Center horizontally, align bottom to the point */
    cursor: pointer;
    z-index: 10;
}

.ipm-marker-icon {
    color: #e74c3c; /* Marker color */
    transition: transform 0.2s ease;
    filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.3));
}

.ipm-marker:hover .ipm-marker-icon {
    transform: scale(1.2) translateY(-2px);
}

.ipm-tooltip {
    position: absolute;
    bottom: 120%; /* Position above the marker */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ipm-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.ipm-marker:hover .ipm-tooltip {
    opacity: 1;
    visibility: visible;
}

.ipm-city-name {
    font-weight: 600;
}

/* SVG Map specific styles */
.ipm-map-container {
    text-align: center;
    max-width: 100%;
}

.ipm-map-container svg {
    width: 100%;
    max-height: 80vh;
    height: 100%;
    display: block;
    margin: 0 auto;
}

.ipm-map-container svg path {
    fill: #f0f0f0; /* Default map color */
    stroke: #dcdcdc;
    stroke-width: 1px;
    transition: fill 0.3s ease;
}

.ipm-map-container svg path.ipm-active-state {
    /* Active states will have their inline style fill applied */
    stroke: #ffffff;
    stroke-width: 1.5px;
}

.ipm-map-container svg path.ipm-active-state:hover {
    filter: brightness(0.9);
    cursor: pointer;
}

/* State Labels */
#ipm-labels-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ipm-state-label {
    position: absolute;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 20;
    text-align: center;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ipm-custom-icon {
    width: 24px;
    height: auto;
    display: block;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

/* --- Premium Layout Styles --- */
.ipm-premium-container {
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
    font-family: inherit;
}

.ipm-main-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #222;
    text-transform: uppercase;
    margin-bottom: 50px;
    letter-spacing: 0.5px;
}

.ipm-layout-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ipm-map-wrapper {
    flex: 1 1 70%;
    min-width: 300px;
}

.ipm-map-container svg {
    /* 3D Map shadow effect */
    filter: drop-shadow(5px 15px 15px rgba(0,0,0,0.25)) drop-shadow(0px 5px 5px rgba(0,0,0,0.15));
}

/* Override state label for premium look (dark text outside map) */
.ipm-state-label {
    color: #111;
    text-shadow: none;
    font-size: 18px;
    font-weight: 500;
}

.ipm-info-box {
    flex: 0 1 350px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.05);
    margin-left: 30px;
    z-index: 10;
}

.ipm-info-title {
    font-size: 16px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    color: #000;
    text-transform: uppercase;
}

.ipm-info-content ul {
    margin: 0;
    padding-left: 20px;
    color: #444;
    font-size: 14px;
    line-height: 1.6;
}
.ipm-info-content li {
    margin-bottom: 8px;
}

.ipm-legend-box {
    max-width: 800px;
    margin: 40px auto 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 20px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.ipm-legend-title {
    font-size: 14px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    color: #000;
    text-transform: uppercase;
}

.ipm-legend-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.ipm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.ipm-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.ipm-legend-footer {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

@media (max-width: 900px) {
    .ipm-info-box {
        margin-left: 0;
        margin-top: 30px;
        flex: 1 1 100%;
    }
}
