/* Stili per la mappa SVG */
#svgMap {
    position: relative;
    width: 100%;
}

#svgMap svg {
    background-color: #3192fa !important;
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

#svgMap svg path {
    stroke: black !important;
}

/* Unknown origin marker overlays the SVG to stay consistent across devices */
.unknown-marker-overlay {
    position: absolute;
    transform: translate(-50%, -50%) scale(var(--unknown-marker-scale, 1));
    transform-origin: center;
    pointer-events: none;
    z-index: 15;
    transition: transform 0.2s ease;
}

.unknown-marker-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: radial-gradient(circle at 30% 30%, #ffc1c1, #7b0000);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    animation: pulse-marker 2s infinite;
    pointer-events: auto;
    cursor: help;
}

@keyframes pulse-marker {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.unknown-marker-tooltip {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translate(-50%, -10px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.unknown-marker-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

.unknown-marker-tooltip strong {
    display: block;
    font-size: 0.9rem;
}

.unknown-marker-tooltip small {
    display: block;
    font-size: 0.7rem;
    color: #d6d6d6;
}

.unknown-marker-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -20px);
}

/* Card con ombra leggera */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    border: none;
}

/* Sezione dataset */
.dataset-section {
    border-radius: 8px;
    padding: 1.2rem;
    border-left: 3px solid #007bff;
}

/* Stile specifico per la sezione statistiche aggregate */
.aggregated-dataset-section {
    border-radius: 8px;
    padding: 1.2rem;
    border-left: 3px solid #28a745; /* Verde invece di blu */
}

/* Lista con scroll personalizzato */
.country-list::-webkit-scrollbar {
    width: 4px;
}

.country-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.country-list::-webkit-scrollbar-thumb {
    background: #3192fa;
    border-radius: 2px;
}

/* Stili per il pannello filtri */
.filters-toggle {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.filters-panel {
    position: fixed;
    top: 150px;
    right: 20px;
    width: 350px;
    z-index: 999;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Stile per l'overlay quando non ci sono dati */
#no-data-overlay {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive map height */
@media (max-width: 768px) {
    .filters-toggle {
        top: 80px;
        right: 10px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .filters-panel {
        width: 90%;
        right: 5%;
        top: 130px;
    }
}

@media (max-width: 576px) {
}

/* Stile per card più compatte */
.dataset-card {
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid #007bff;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

/* Quando c'è un solo dataset, occupa tutta la larghezza */
.single-dataset .dataset-card {
    padding: 1.2rem;
    border-left: 3px solid #007bff;
}

.single-dataset .dataset-card h6 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.single-dataset .stats-row {
    margin-bottom: 1rem;
}

.single-dataset .stats-row h4 {
    font-size: 2rem;
}

.single-dataset .country-list-compact {
    max-height: 300px;
}

.single-dataset .country-list-compact .list-group-item {
    padding: 0.75rem 0;
    font-size: 1rem;
}

.single-dataset .country-header {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.dataset-card h6 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.stats-row {
    margin-bottom: 0.75rem;
}

.stats-row h4 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stats-row small {
    font-size: 0.8rem;
}

.country-list-compact {
    max-height: 200px;
    overflow-y: auto;
}

.country-list-compact .list-group-item {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.country-header {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}