/**
 * Interactive World Map - Frontend Styles
 */

/* Map Container */
#iwm-map-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

#map {
    width: 100%;
    height: 100%;
}

/* Popup Styles */
.iwm-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(2, 82, 115, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80%;
    overflow-y: auto;
    z-index: 10000;
    padding: 30px;
    animation: popupFadeIn 0.3s ease-in-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.iwm-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    line-height: 1;
    color: #bbb;
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 300;
    z-index: 10001;
}

.iwm-popup-close:hover {
    color: #025273;
}

.iwm-popup-content {
    position: relative;
}

.iwm-popup-content h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #025273;
    padding-right: 30px;
}

.iwm-popup-description {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #555;
}

.iwm-popup-description p {
    margin-bottom: 10px;
}

.iwm-popup-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    font-size: 16px;
}

.iwm-popup-links a {
    color: #2288b3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.iwm-popup-links a:hover {
    color: #025273;
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .iwm-popup {
        width: 95%;
        max-width: none;
        padding: 20px;
        max-height: 85%;
    }
    
    .iwm-popup-content h3 {
        font-size: 20px;
    }
    
    .iwm-popup-links a {
        text-align: center;
    }
}

/* Map cursor styles */
[id^="sm_state_"] path {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

[id^="sm_state_"] path:hover {
    opacity: 0.8;
}

/* Active region highlight */
path.iwm-region-active {
    fill: #2288b3 !important;
}

/* Loading indicator */
.iwm-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.iwm-loading::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.iwm-popup:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .iwm-popup {
        position: static;
        transform: none;
        box-shadow: none;
        max-width: 100%;
        width: 100%;
    }
    
    .iwm-popup-close {
        display: none;
    }
}
