/* CSS per la visualizzazione eventi in stile Instagram */
/* VERSIONE AGGIORNATA CON CORREZIONI - Organizzato e ottimizzato */

/* ===============================================
   LAYOUT DI BASE
   =============================================== */
.event-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ===============================================
   BOTTONI E TOGGLE
   =============================================== */
/* Pulsante toggle filtri */
.filter-toggle-container {
    margin-bottom: 20px;
    text-align: left;
}

.filter-toggle-button,
a.filter-toggle-button {
    padding: 10px 15px;
    background-color: #0073aa;
    color: white !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s;
    text-decoration: none !important;
}

.filter-toggle-button:hover,
a.filter-toggle-button:hover,
a.filter-toggle-button:focus,
a.filter-toggle-button:active {
    background-color: #005177;
    color: white !important;
    text-decoration: none !important;
}

.filter-toggle-button.active-filters,
.filter-toggle-button.has-date-range {
    background-color: #d63638;
}

.filter-toggle-button .dashicons {
    margin-right: 8px;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    background-color: #fff;
    color: #d63638;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Tab di visualizzazione */
.event-view-toggle {
    display: flex;
    margin: 0 0 -1px 0;
    border-bottom: none;
}

.view-toggle-button {
    padding: 12px 20px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    color: #555 !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-toggle-button.active {
    background-color: white;
    color: #0073aa !important;
    border-bottom: 1px solid white;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.view-toggle-button:hover:not(.active) {
    background-color: #e0e0e0;
    color: #333 !important;
}

.view-toggle-button .dashicons {
    margin-right: 5px;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Bottoni form filtro */
.filter-button,
.reset-button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.reset-button {
    background-color: #6c757d;
}

.filter-button:hover {
    background-color: #005177;
}

.reset-button:hover {
    background-color: #5a6268;
}

.load-more-container {
    text-align: center;
    margin: 30px 0;
}

.load-more-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.load-more-button:hover {
    background-color: #005177;
}

/* ===============================================
   PANNELLO FILTRI
   =============================================== */
.event-grid-filters {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    margin-bottom: 15px;
}

.filter-col {
    flex: 1;
    padding: 0 10px;
    min-width: 250px;
    margin-bottom: 15px;
}

.filter-col-data {
    max-width: 250px;
}

.event-grid-filters label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.event-grid-filters input,
.event-grid-filters select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.indented-select {
    padding-left: 15px !important;
}

/* ===============================================
   CORREZIONE: BOTTONI CANCELLA DATA INLINE
   =============================================== */

/* Container per campo data + bottone inline */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Bottone cancella inline */
.clear-date-inline {
    display: none;
    background: #dc3545;
    border: none;
    color: white;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.clear-date-inline:hover {
    background: #c82333;
    transform: scale(1.05);
}

.clear-date-inline:active {
    transform: scale(0.95);
}

.clear-date-inline .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    line-height: 12px;
}

/* Assicura che i campi data abbiano larghezza corretta nel wrapper */
.date-input-wrapper input[type="text"] {
    flex: 1;
    min-width: 0;
}

/* Nascondi i bottoni grandi originali */
.clear-date-button,
#clear-range-filter {
    display: none !important;
}

/* ===============================================
   FILTRI DATE RANGE
   =============================================== */
/* Tab per selezione tipo filtro data */
.date-filter-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.date-tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.date-tab-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
    font-weight: 600;
}

.date-tab-btn:hover:not(.active) {
    color: #333;
    background-color: rgba(0, 115, 170, 0.1);
}

/* Pannelli date */
.date-panel {
    display: none;
}

.date-panel.active {
    display: block;
}

/* Container range date */
.date-range-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-range-field {
    display: flex;
    flex-direction: column;
}

.date-range-field label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

/* ✅ CORREZIONE 4: Campo data singola con larghezza limitata */
#filter-data {
    width: 100% !important;
    max-width: 200px !important; /* ✅ NUOVO: Limita la larghezza massima */
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: white !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

/* ✅ CORREZIONE 5: Assicura che tutti i campi data abbiano la stessa dimensione */
#filter-date-start,
#filter-date-end {
    width: 100% !important;
    max-width: 200px !important; /* ✅ Stesso valore del campo singolo */
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background-color: white !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

/* ✅ CORREZIONE 6: Container data singola con wrapper corretto */
.date-filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 250px; /* ✅ NUOVO: Limita il container */
}

/* Assicura che i focus state siano uniformi */
#filter-data:focus,
#filter-date-start:focus,
#filter-date-end:focus {
    outline: none !important;
    border-color: #0073aa !important;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2) !important;
}

.date-filter-container .date-input-wrapper {
    flex: 1;
    min-width: 0;
}


#filter-date-start:focus,
#filter-date-end:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Filtri rapidi */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-filter-btn {
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
}

.quick-filter-btn:hover,
.quick-filter-btn.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.quick-filter-btn.active {
    border-color: #005177;
}

/* Stato di caricamento per i filtri */
.filter-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===============================================
   CORREZIONE: SELECT2 CATEGORIE - FIX SOVRAPPOSIZIONE
   =============================================== */

/* ✅ CORREZIONE 1: Fix per evitare sovrapposizione label con pulsante X */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #0073aa !important;
    border-color: #005177 !important;
    color: white !important;
    padding: 2px 8px 2px 8px !important; /* ✅ CORREZIONE: Padding uniforme */
    margin-right: 3px !important;
    margin-bottom: 3px !important;
    max-width: calc(100% - 30px) !important;
    position: relative !important;
    word-wrap: break-word !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-flex !important; /* ✅ NUOVO: Usa flexbox */
    align-items: center !important; /* ✅ NUOVO: Centra verticalmente */
    gap: 6px !important; /* ✅ NUOVO: Spazio tra testo e pulsante */
    border-radius: 3px !important;
}

/* ✅ CORREZIONE 2: Posizionamento corretto del pulsante X */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255,255,255,0.8) !important;
    position: static !important; /* ✅ CORREZIONE: Cambiato da absolute a static */
    margin-right: 0 !important; /* ✅ CORREZIONE: Reset margin */
    margin-left: auto !important; /* ✅ NUOVO: Spinge il pulsante a destra */
    font-weight: bold !important;
    border-radius: 50% !important;
    width: 16px !important; /* ✅ NUOVO: Dimensione fissa */
    height: 16px !important; /* ✅ NUOVO: Dimensione fissa */
    display: flex !important; /* ✅ NUOVO: Flexbox per centrare */
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important; /* ✅ NUOVO: Non ridursi */
    transition: all 0.2s ease !important;
    order: 1 !important; /* ✅ NUOVO: Assicura che sia sempre per ultimo */
}

/* ✅ CORREZIONE 3: Assicura che il testo non vada sotto il pulsante */
.select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__display {
    flex: 1 !important; /* ✅ NUOVO: Prende tutto lo spazio disponibile */
    min-width: 0 !important; /* ✅ NUOVO: Permette il wrapping del testo */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    order: 0 !important; /* ✅ NUOVO: Assicura che sia sempre per primo */
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: white !important;
    background: rgba(255,255,255,0.2) !important;
    transform: scale(1.1) !important; /* ✅ NUOVO: Effetto hover */
}

.select2-container--default .select2-selection--multiple {
    border-color: #ddd;
    min-height: 38px;
}

.select2-selection__choice[title="Tutte le categorie"] {
    background-color: #0073aa !important;
    color: white !important;
}

/* ===============================================
   CONTENITORI PRINCIPALI
   =============================================== */
.event-grid, 
.event-blog {
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    padding: 15px;
    background-color: white;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* ===============================================
   EVENTI IN GRIGLIA
   =============================================== */
.evento-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: white;
}

.evento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.evento-image-container {
    position: relative;
    padding-top: 130%;
    overflow: hidden;
}

.evento-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.evento-item:hover .evento-image {
    transform: scale(1.05);
}

/* Badge e contatori */
.evento-badges-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 10;
}

.evento-categoria-badge {
    padding: 4px 10px;
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.evento-comune-badge {
    padding: 4px 10px;
    border-radius: 20px;
    background-color: #000;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.evento-counters-container {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 10;
}

.evento-views-badge {
    background-color: rgba(249, 92, 34, 0.85);
    color: white;
    border-radius: 20px;
    height: 28px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    padding: 0 10px;
}

.evento-views-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    margin-right: 4px;
}

.evento-reactions-group {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    padding: 1px 4px;
    gap: 6px;
    line-height: 1;
    height: 18px;
}

.evento-likes-badge,
.evento-dislikes-badge {
    color: white;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0;
    line-height: 1;
    height: 16px;
}

.evento-likes-badge .dashicons,
.evento-dislikes-badge .dashicons {
    color: white;
    font-size: 11px;
    width: 11px;
    height: 11px;
    line-height: 1;
    margin-right: 2px;
}

/* Dettagli evento */
.evento-details {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    background-color: white;
    min-height: 65px;
}

.evento-meta-data {
    margin-bottom: 1px;
}

.evento-data-ora {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.2;
}

.evento-meta-luogo {
    margin-bottom: 1px;
}

.evento-luogo {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.2;
}

.evento-title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.2;
    min-height: 17px;
}

.evento-categoria {
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 2px;
}

.evento-data-ora .dashicons,
.evento-luogo .dashicons {
    font-size: 13px;
    width: 15px;
    height: 15px;
    line-height: 15px;
    vertical-align: text-bottom;
    margin-right: 2px;
}

.evento-meta .dashicons {
    font-size: 14px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    vertical-align: text-bottom;
    margin-right: 5px;
}

/* ===============================================
   EVENTI IN VISTA BLOG/LISTA
   =============================================== */
.event-blog-item {
    display: flex;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    background-color: white;
    transition: transform 0.3s, box-shadow 0.3s;
}

.event-blog-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.event-blog-image {
    width: 300px;
    min-width: 300px;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.event-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.event-blog-item:hover .event-blog-image img {
    transform: scale(1.05);
}

.event-blog-content {
    flex: 1;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
}

.event-blog-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
    line-height: 1.3;
}

.event-blog-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 700;
}

.event-blog-title a:hover {
    color: #0073aa;
}

.event-city-badge {
    display: inline-block;
    padding: 5px 12px;
    background-color: #000;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.event-blog-location {
    margin-bottom: 10px;
    color: #444;
    font-weight: 500;
}

.event-blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 15px;
    color: #555;
}

.event-blog-meta span {
    display: flex;
    align-items: center;
}

.event-blog-meta .dashicons {
    margin-right: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.event-blog-categories {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-blog-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    color: white !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

.event-blog-keywords {
    margin: 10px 0;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.event-blog-keywords .dashicons {
    margin-right: 5px;
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.event-blog-keywords .keywords-label {
    font-weight: 600;
    color: #333;
}

.event-blog-readmore {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    margin-top: auto;
    align-self: flex-start;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

.event-blog-readmore:hover {
    background-color: #005177;
    color: white !important;
}

.event-blog-readmore .dashicons {
    margin-left: 5px;
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.event-blog-readmore:hover .dashicons {
    transform: translateX(3px);
}

/* Contatori vista blog */
.event-blog-item .evento-counters-container {
    top: 15px;
    left: 0;
    right: 0;
    padding: 0 15px;
    z-index: 10;
}

.event-blog-item .evento-views-badge {
    height: 32px;
    font-size: 13px;
    padding: 0 12px;
}

.event-blog-item .evento-views-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.event-blog-item .evento-reactions-group {
    padding: 2px 6px;
    height: 22px;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.4);
}

.event-blog-item .evento-likes-badge,
.event-blog-item .evento-dislikes-badge {
    font-size: 12px;
    height: 18px;
}

.event-blog-item .evento-likes-badge .dashicons,
.event-blog-item .evento-dislikes-badge .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    margin-right: 3px;
}

/* ===============================================
   VISUALIZZAZIONE MAPPA
   =============================================== */


/* ===============================================
   CONTROLLI MAPPA
   =============================================== */


/* ===============================================
   POPUP MAPPA
   =============================================== */


/* ===============================================
   STILI CLUSTER MAPPA
   =============================================== */


/* ===============================================
   ELEMENTI DI SUPPORTO
   =============================================== */
.event-grid-loader {
    text-align: center;
    padding: 20px;
    display: none;
}

.loader-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.no-events-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.no-events-message strong {
    color: #c00;
    display: block;
    margin-bottom: 5px;
}

.close-message {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
}

.close-message:hover {
    background: rgba(255, 255, 255, 0.3);
}

.close-message .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================================
   COMPONENTI UI
   =============================================== */
.flatpickr-calendar {
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover, 
.flatpickr-day.selected.prevMonthDay, 
.flatpickr-day.startRange.prevMonthDay, 
.flatpickr-day.endRange.prevMonthDay, 
.flatpickr-day.selected.nextMonthDay, 
.flatpickr-day.startRange.nextMonthDay, 
.flatpickr-day.endRange.nextMonthDay {
    background: #0073aa;
    border-color: #0073aa;
}

.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), 
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), 
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
    box-shadow: -10px 0 0 #0073aa;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    appearance: menulist;
}

/* ===============================================
   MEDIA QUERIES RESPONSIVE
   =============================================== */
@media (max-width: 1023px) {
    .event-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .event-grid, 
    .event-blog {
        padding: 10px 5px;
        border-radius: 0;
    }
    
    .view-toggle-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .filter-toggle-container {
        text-align: center;
    }
    
    .filter-toggle-button {
        width: 100%;
        justify-content: center;
    }
    
    .filter-badge {
        min-width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-col {
        width: 100%;
    }
    
    .filter-col-data {
        max-width: 100%;
    }
    
    /* ✅ CORREZIONE 7: Su mobile i campi data prendono tutta la larghezza */
    #filter-data,
    #filter-date-start,
    #filter-date-end {
        max-width: 100% !important;
    }
    
    .date-filter-container {
        max-width: 100% !important;
    }
    
    /* ✅ CORREZIONE 8: Select2 su mobile migliorato */
    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        font-size: 12px !important;
        padding: 1px 6px 1px 6px !important;
        gap: 4px !important;
    }
    
    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
        width: 14px !important;
        height: 14px !important;
        font-size: 10px !important;
    }
    
    /* ✅ CORREZIONE: Responsive per bottoni inline */
    .date-input-wrapper {
        gap: 6px;
    }
    
    .clear-date-inline {
        width: 32px;
        height: 32px;
    }
    
    .clear-date-inline .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
    
    .event-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .evento-badges-container {
        bottom: 7px;
        left: 7px;
        gap: 3px;
    }

    .evento-categoria-badge,
    .evento-comune-badge {
        padding: 3px 8px;
        font-size: 10px;
        max-width: 100px;
    }

    .evento-details {
        padding: 6px 8px 8px;
        min-height: 60px;
    }
    
    .evento-data-ora,
    .evento-luogo {
        font-size: 11px;
    }
    
    .evento-title {
        font-size: 12px;
    }

    .evento-data-ora .dashicons,
    .evento-luogo .dashicons {
        font-size: 11px;
        width: 13px;
        height: 13px;
        line-height: 13px;
        margin-right: 1px;
    }
    
    .evento-counters-container {
        top: 5px;
        padding: 0 7px;
    }
    
    .evento-views-badge {
        height: 24px;
        font-size: 10px;
        padding: 0 8px;
    }
    
    .evento-views-badge .dashicons {
        font-size: 12px;
        width: 12px;
        height: 12px;
        line-height: 12px;
        margin-right: 3px;
    }
    
    .evento-reactions-group {
        padding: 1px 3px;
        gap: 5px;
        height: 16px;
    }
    
    .evento-likes-badge,
    .evento-dislikes-badge {
        font-size: 9px;
        height: 14px;
    }
    
    .evento-likes-badge .dashicons,
    .evento-dislikes-badge .dashicons {
        font-size: 10px;
        width: 10px;
        height: 10px;
        line-height: 1;
        margin-right: 1px;
    }
    
  
    .event-blog-item {
        flex-direction: column;
    }
    
    .event-blog-image {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }
    
    .event-blog-content {
        padding: 15px;
    }
    
    .event-blog-title {
        font-size: 20px;
    }
    
    .event-blog-location {
        font-size: 16px;
    }
    
    .event-city-badge {
        font-size: 13px;
    }
    
    .event-blog-meta {
        gap: 10px;
        font-size: 14px;
    }
    
    .event-blog-categories {
        margin: 10px 0;
    }
    
    .event-blog-category {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .event-blog-keywords {
        font-size: 12px;
        margin: 8px 0;
    }
    
    .event-blog-readmore {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .event-blog-item .evento-counters-container {
        top: 10px;
        padding: 0 10px;
    }
    
    .event-blog-item .evento-views-badge {
        height: 28px;
        font-size: 12px;
    }
    
    .flatpickr-calendar {
        width: 307px !important;
    }
    
    .event-popup-single {
        min-width: 260px;
        max-width: 280px;
    }
    
    .popup-image-top {
        height: 120px;
        margin-bottom: 10px;
    }
    
    .popup-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .popup-meta > div {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .popup-link {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .multi-event-popup {
        min-width: 260px;
        max-width: 300px;
    }
    
    .multi-events-list {
        max-height: 250px;
    }
    
    .multi-event-image {
        width: 60px;
        height: 40px;
    }
    
    .multi-event-info h4 {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .multi-event-meta {
        font-size: 10px;
    }
    
    .multi-event-link {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    /* ✅ CORREZIONE: Responsive per filtri date range */
    .date-filter-tabs {
        justify-content: center;
    }
    
    .date-tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .date-range-container {
        gap: 12px;
    }
    
    .quick-filters {
        justify-content: center;
    }
    
    .quick-filter-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .event-grid, 
    .event-blog {
        padding: 8px 4px;
    }
    
    .event-grid {
        gap: 6px;
    }

    .evento-image-container {
        padding-top: 140%;
    }
}

@media (max-width: 360px) {
    .event-grid, 
    .event-blog {
        padding: 5px 2px;
    }
    
    .event-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .evento-details {
        padding: 5px 7px 7px;
    }
    
    .evento-data-ora,
    .evento-luogo {
        font-size: 10px;
    }
    
    .evento-title {
        font-size: 11px;
    }
    
    .evento-data-ora .dashicons,
    .evento-luogo .dashicons {
        font-size: 10px;
        width: 12px;
        height: 12px;
        line-height: 12px;
    }
    
    .view-toggle-button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .view-toggle-button .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
}