/* Reset e Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    padding-bottom: 2rem;
}

.main-header {
    background-color: #1c1c1b;
    color: white;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

#events-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card Evento Base */
.event-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header Compatto (Sempre visibile) */
.card-header {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.card-header:hover {
    background: #fafafa;
}

/* Elementi dell'Header */
.event-date {
    flex: 0 0 50px;
    text-align: center;
    line-height: 1.1;
    border-right: 2px solid #eaeaea;
    padding-right: 10px;
    margin-right: 10px;
}

.event-date .day {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.event-date .month {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
}

.event-title {
    flex: 1;
    font-weight: bold;
    font-size: 0.95rem;
    color: #1c1c1b;
}

.event-type {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

/* Mappatura Colori da Calendario ESN UCM */
.type-culture { background-color: #2e3192; }
.type-leisure { background-color: #ec008c; }
.type-sports { background-color: #00aeef; }
.type-tandem { background-color: #f47b20; }
.type-socialimpact { background-color: #7ac143; }
.type-trips { background-color: #7B1FA2; }
.type-parties { background-color: #1c1c1b; }

/* Corpo Espandibile (Nascosto di default) */
.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    background: #fdfdfd;
    padding: 0 1rem;
}

/* Stato Espanso */
.event-card.expanded .card-body {
    max-height: 800px;
    padding: 1rem;
    border-top: 1px solid #eaeaea;
}

/* Dettagli nel Body */
.event-time {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.8rem;
    font-weight: bold;
}

.event-description {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: #444;
}

.btn-container {
    text-align: center;
    margin-bottom: 1rem;
}

.subscribe-btn {
    display: inline-block;
    background-color: #00aeef;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.subscribe-btn:hover {
    background-color: #008cc0;
}

/* --- Nuovo Header Layout --- */
.main-header {
    background-color: #1c1c1b;
    color: white;
    padding: 1rem 1.5rem; /* Padding ridotto per un look più 'app' */
    margin-bottom: 2rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between; /* Spazia icone e testo */
    align-items: center; /* Centra verticalmente */
    max-width: 450px; /* Allinea col container eventi */
    margin: 0 auto;
}

.header-titles {
    text-align: center;
    flex: 1; /* Prende lo spazio centrale */
}

.header-titles h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.header-titles p {
    font-size: 0.85rem;
    color: #ccc;
}

/* Stili per i link-icona */
.header-icon-link {
    color: white; /* Colore iniziale dell'icona */
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    padding: 10px; /* Area cliccabile più grande */
}

/* Hover effect: diventa Ciano ESN */
.header-icon-link:hover {
    color: #00aeef;
}

/* Dimensione delle icone SVG */
.icon-svg {
    width: 24px;
    height: 24px;
    fill: currentColor; /* Prende il colore dal parent (.header-icon-link) */
}

.event-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.event-time {
    font-size: 0.85rem;
    color: #555;
    font-weight: bold;
}

.event-cost {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
}

.price-free {
    color: #7ac143; /* Verde ESN */
    background-color: #f0f9eb;
}

.price-paid {
    color: #1c1c1b;
    background-color: #eee;
}