:root {
    --primary-color: #4A148C; /* Viola FestMap */
    --accent-color: #0d6efd;  /* Blu */
    --success-color: #198754; /* Verde */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
}

body {
    background-color: var(--bg-color);
    font-family: sans-serif;
    margin: 0;
    padding-left: 70px;
    padding-right: 70px;
    min-height: 100vh;
    max-width: 1500px;
    color: var(--text-color);
    margin-left: auto;
    margin-right: auto;

    /* Sfondo dell'app */
    background-image:
        linear-gradient(rgba(248, 249, 250, 0.85), rgba(248, 249, 250, 0.85)),
        url('../images/sfondo-festmap.webp');
    background-size: 100%;
    background-position: top center;
    background-repeat: no-repeat;
}

/* --- Barra di Ricerca e Filtri (Sezione dedicata) --- */
.search-section {
    padding: 15px 20px;
    background-color: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.search-bar-wrapper {
    display: flex;
    gap: 10px;
}

#search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-filter {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* Pannello Filtri Avanzati */
.filters-panel {
    margin-top: 15px;
    padding: 15px;
    background: #f1f3f5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filters-panel.hidden {
    display: none !important;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #495057;
}

.filter-group select,
.filter-group input {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.range-group {
    display: flex;
    gap: 10px;
}

.range-group input {
    flex: 1;
}

.btn-primary {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

/* --- Contenuto Home e Titoli --- */
.home-content {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.home-content h2,
.upcoming-events-section h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-left: 5px;
    margin-left: 5px;
    margin-right: 5px;
    text-align: left;
}

/* --- Card Evento in stile Orizzontale --- */
.card-evento {
    background: var(--card-bg);
    border-left: 5px solid var(--accent-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.card-approvata {
    border-left: 5px solid var(--success-color);
}

.card-content-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.card-img-container {
    position: relative;
    width: 50px;
    min-width: 50px;
    height: 90px;
    background-color: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 2px;
}

.card-info-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--text-color);
}

/*.text-muted {
    margin: 0;
    font-size: 1rem;
    text-decoration-line: underline;
    color: #000000;
}*/
.card-date {
    margin: 0;
    font-size: 0.95rem; /* Leggermente più grande rispetto a prima (0.85rem) */
    font-weight: 500;
    color: #495057;     /* Grigio scuro leggibile, senza sottolineatura */
    text-decoration: none;
    line-height: 1.4; /* Spaziatura ideale tra la prima e la seconda riga */
}

.card-date .date-separator {
    color: var(--primary-color);
    font-weight: bold;
}


/* Pulsante Cuoricino in alto a destra (Preferito) */
.btn-preferito-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.cuore-icon {
    width: 18px;
    height: 18px;
    fill: transparent;
    stroke: #ff3366;
    stroke-width: 2.2;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.btn-preferito-overlay.preferito-attivo {
    transform: scale(1.1);
}

.btn-preferito-overlay.preferito-attivo .cuore-icon {
    fill: #ff3366;
    stroke: #ff3366;
    animation: battitoCuore 0.4s ease 1 forwards;
}

@keyframes battitoCuore {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.btn-preferito-overlay:hover {
    transform: scale(1.15);
}

/* --- Azioni Card (Dettagli e Mappa) --- */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.card-actions .btn,
.btn-map {
    padding: 5px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.btn-map {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

.btn-map:hover {
    background-color: #dde2e6;
}

.card-location-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #495057;
}

.map-pin-icon {
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.map-pin-icon:hover {
    transform: scale(1.2);
}

.btn-itinerario {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4285F4;
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    margin-top: 2px;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-itinerario:hover {
    background-color: #3367D6;
    color: white;
}

/* Icona della categoria in alto a sinistra sulla card */
.card-evento .card-category-badge-icon {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 40px;
    height: 40px;
    object-fit: contain;
    z-index: 15;
    pointer-events: none;
    background: rgb(255, 255, 255);
    border-radius: 50%;
    box-shadow: 0 0 2px #000000;
}

/* =================================================================
   HOME - BARRA CATEGORIE E PULSANTE SEGNALA EVENTO
   ================================================================ */

/* Stile base desktop per la barra categorie */
.home-categories-bar {
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-start; /* Di default allinea a sinistra su PC */
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

/* Stile comune dei chip */
.category-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-chip .chip-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.category-chip .folk-icon-fix {
    width: 24px;
    height: 24px;
}

/* Spinge il pulsante "Segnala Evento" verso il bordo destro su PC */
.btn-segnala-chip {
    margin-left: auto;
    background: #fff0f0 !important;
    border-color: #ff6b6b !important;
    color: #d93838 !important;
    font-weight: 600;
}

.btn-segnala-chip .chip-icon-text {
    font-size: 1.1rem;
}
