/* Override stats-grid for event detail page - single row */
.event-details-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 1rem;
        margin-bottom: 2rem;
        overflow-x: auto;
}

.event-details-grid .stat-card {
        flex: 1 1 0;
        min-width: 180px;
        background: white;
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        cursor: pointer;
}

.event-details-grid .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 12px rgba(42, 82, 152, 0.2);
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.event-details-grid .stat-card h4 {
        color: #666;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.5rem;
        transition: color 0.3s ease;
}

.event-details-grid .stat-card:hover h4 {
        color: #2a5298;
}

.event-details-grid .stat-card .value {
        font-size: 1.5rem;
        font-weight: bold;
        color: #2a5298;
        transition: color 0.3s ease, transform 0.3s ease;
}

.event-details-grid .stat-card:hover .value {
        color: #1e3c72;
        transform: scale(1.05);
}

/* Map container styles */
.states-map-container {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        padding: 1.5rem;
        margin-bottom: 1.5rem;
}

.states-map-container h3 {
        margin: 0 0 1rem 0;
        color: #2a5298;
}

#statesMap {
        height: 560px;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
        background: #1a2a4a;
}

.states-inset-row {
        margin-top: 0.9rem;
        display: flex;
        align-items: stretch;
        justify-content: center;
        gap: 0.7rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
}

.states-inset-card {
        position: relative;
        background: #f8f9fb;
        border: 1px solid #dbe3ef;
        border-radius: 6px;
        padding: 0.2rem;
        flex: 0 0 auto;
        width: 156px;
        height: 106px;
}

.states-inset-card.alaska {
        width: 170px;
        height: 120px;
}

.states-inset-card.hawaii {
        width: 150px;
        height: 108px;
}

.states-inset-card.puerto-rico {
        width: 148px;
        height: 108px;
}

.states-inset-card.guam,
.states-inset-card.virgin-islands {
        width: 130px;
        height: 100px;
}

.states-inset-label {
        position: absolute;
        top: 4px;
        left: 4px;
        z-index: 3;
        font-size: 0.67rem;
        font-weight: 600;
        color: #fff;
        background: rgba(42, 82, 152, 0.92);
        border-radius: 3px;
        padding: 1px 6px;
        pointer-events: none;
}

.states-inset-map {
        width: 100%;
        height: 100%;
        border-radius: 5px;
        background: #1a2a4a;
}

.inset-unavailable {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #f7fafc;
        font-size: 0.72rem;
        text-align: center;
}

.map-legend {
        display: flex;
        gap: 1.5rem;
        margin-top: 0.9rem;
        padding-top: 0.9rem;
        border-top: 1px solid #e0e0e0;
}

.legend-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.9rem;
        color: #555;
}

.legend-color {
        width: 20px;
        height: 20px;
        border-radius: 4px;
        border: 1px solid rgba(0,0,0,0.2);
}

.legend-affected {
        background: #dc3545;
}

.legend-unaffected {
        background: #ffffff;
        border: 1px solid #999999;
}

/* Responsive: allow wrapping on smaller screens */
@media (max-width: 1200px) {
        .event-details-grid {
                flex-wrap: wrap;
        }

        .event-details-grid .stat-card {
                flex: 1 1 calc(50% - 0.5rem);
                min-width: 200px;
        }
}

@media (max-width: 1000px) {
        .event-details-grid {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                gap: 0.75rem;
        }

        .event-details-grid .stat-card {
                flex: none;
                min-width: unset;
                padding: 1rem;
        }

        .event-details-grid .stat-card h4 {
                font-size: 0.75rem;
                margin-bottom: 0.25rem;
        }

        .event-details-grid .stat-card .value {
                font-size: 1.1rem !important;
        }

        .states-map-container {
                margin-left: -1rem;
                margin-right: -1rem;
                border-radius: 0;
                padding: 1rem;
                width: calc(100% + 2rem);
                max-width: 100vw;
        }

        #statesMap {
                height: 360px;
                border-radius: 0;
        }

        .states-inset-card.alaska {
                width: 128px;
                height: 92px;
        }

        .states-inset-card.hawaii {
                width: 114px;
                height: 84px;
        }

        .states-inset-card.puerto-rico {
                width: 112px;
                height: 84px;
        }

        .states-inset-card.guam,
        .states-inset-card.virgin-islands {
                width: 102px;
                height: 78px;
        }

        .states-inset-label {
                font-size: 0.58rem;
                padding: 1px 4px;
        }
}

@media (max-width: 480px) {
        .states-inset-row {
                gap: 0.5rem;
        }

        .states-inset-card.alaska {
                width: 102px;
                height: 74px;
        }

        .states-inset-card.hawaii {
                width: 92px;
                height: 68px;
        }

        .states-inset-card.puerto-rico {
                width: 90px;
                height: 68px;
        }

        .states-inset-card.guam,
        .states-inset-card.virgin-islands {
                width: 84px;
                height: 64px;
        }
}
