/* Stili globali e reset */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f0f2f5; /* Sfondo leggermente grigio per il "browser" */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* Contenitore principale del mockup dell'app */
.app-mockup {
    width: 100%;
    max-width: 380px; /* Larghezza tipica di un iPhone/smartphone */
    background-color: #fff;
    border-radius: 25px; /* Bordi arrotondati come un telefono */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* Assicura che i contenuti non escano dai bordi arrotondati */
    display: flex;
    flex-direction: column;
    min-height: 700px; /* Altezza minima per simulare lo schermo */
    position: relative;
}

/* Stili dell'header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 15px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
}

.app-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    margin: 0;
    text-transform: uppercase;
}

.panel-info {
    text-align: right;
    font-size: 11px;
    color: #666;
    line-height: 1.2;
    font-weight: 500;
    text-transform: uppercase;
}

/* Wrapper per i contenuti sotto l'header per un padding consistente */
.content-wrapper {
    padding: 15px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Stili generali delle sezioni */
.qr-scan-section,
.user-info-section,
.events-section,
.action-buttons,
.footer-nav {
    margin-bottom: 25px;
}

.qr-scan-section:last-child,
.user-info-section:last-child,
.events-section:last-child,
.action-buttons:last-child,
.footer-nav:last-child {
    margin-bottom: 0;
}

/* Stili per le "card" (sezione QR) */
.card {
    background-color: #f7f7f7;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.card:hover {
    background-color: #e6e6e6;
}

.qr-icon {
    font-size: 80px;
    color: #555;
    margin-bottom: 15px;
}

.qr-scan-section p {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    margin: 0;
}

/* Stili della sezione informazioni utente */
.user-info-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
}

/* Stili per l'informazione dell'evento odierno */
.today-event-info {
    font-size: 15px;
    font-weight: 500;
    color: #007bff;
    margin: -5px 0 10px;
}

.user-info-section p {
    font-size: 15px;
    color: #666;
    margin: 0 0 5px;
    line-height: 1.4;
}

.user-info-section p.email {
    font-weight: 500;
    color: #555;
}

.user-info-section p.member-status {
    font-weight: 400;
    color: #777;
}

/* NUOVO STILE: Data di associazione */
.association-date {
    font-size: 14px;
    color: #888; /* Un grigio leggermente più chiaro per non essere troppo in risalto */
    margin-top: -3px; /* Avvicina al "Socio" */
    margin-bottom: 8px; /* Spazio sotto */
}

.user-info-section p.client-code {
    font-size: 14px;
    color: #777;
    margin-top: 15px;
}

/* Stili della sezione eventi */
.events-section h3 {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin: 0 0 15px;
}

.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.events-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    transition: background-color 0.2s ease;
}

.events-list li:last-child {
    border-bottom: none;
}

/* NUOVO STILE: Righe di colore alternato */
.events-list li:nth-child(odd) {
    background-color: #fcfcfc; /* Colore più chiaro per le righe dispari */
}

.events-list li:nth-child(even) {
    background-color: #f7f7f7; /* Colore leggermente più scuro per le righe pari */
}

/* Stile per l'evento odierno (sovrascrive i colori alternati perché più specifico) */
.events-list li.today-event {
    background-color: #e0f2f7; /* Sfondo azzurro chiaro */
    font-weight: 600;
    border-radius: 5px;
    padding: 8px 10px;
    margin: 0 -10px;
}

.event-date {
    font-size: 15px;
    font-weight: 400;
    color: #555;
    min-width: 80px;
}

.event-name {
    flex-grow: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    padding-left: 10px;
}

.payment-status {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    padding-left: 10px;
    display: flex; /* Usato per allineare PAGATO e (Partecipato) */
    align-items: center;
    gap: 3px; /* Spazio tra PAGATO e (Partecipato) */
}

.payment-status.paid {
    color: #4CAF50;
}

.payment-status.unpaid {
    color: #F44336;
}

/* Stili per lo stato di partecipazione */
.participation-status {
    font-size: 13px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
}

.participation-status.participated {
    color: #28a745; /* Verde scuro per "Partecipato" */
}

.participation-status.not-participated {
    color: #dc3545; /* Rosso scuro per "Non Partecipato" */
}


/* Stili dei bottoni */
.action-buttons {
    margin-top: auto;
}

.btn {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 15px;
    border: 1px solid #ddd; /* Bordo di default, sovrascritto dai colori specifici */
    border-radius: 12px;
    background-color: #f0f0f0; /* Sfondo di default, sovrascritto dai colori specifici */
    color: #333; /* Colore testo di default, sovrascritto dai colori specifici */
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.btn i {
    font-size: 18px;
    color: inherit; /* L'icona eredita il colore del testo del bottone */
}

/* NUOVI STILI: Bottoni specifici per colore */
.btn-green {
    background-color: #4CAF50; /* Verde */
    color: #fff;
    border-color: #4CAF50;
}

.btn-green:hover {
    background-color: #45a049;
    border-color: #45a049;
}

.btn-blue {
    background-color: #007bff; /* Blu */
    color: #fff;
    border-color: #007bff;
}

.btn-blue:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Il bottone secondario della modal rimane con lo stile precedente */
.btn-secondary {
    background-color: #fff;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    color: #333; /* Assicura che il testo sia scuro */
}

.btn-secondary:hover {
    background-color: #f8f8f8;
}

.btn-secondary i {
    color: #666; /* L'icona ha un colore specifico */
}


/* Stili del link di navigazione inferiore */
.footer-nav {
    text-align: center;
    padding: 10px 0 20px;
    margin-top: 15px;
}

.back-link {
    text-decoration: none;
    color: #555;
    font-size: 16px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #333;
}

.back-link i {
    font-size: 15px;
}

/* --- Stili per le Modal (rimangono invariati, a parte il colore del testo dei bottoni) --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 350px;
    text-align: center;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    font-size: 20px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
}

#noteInput {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    outline: none;
}

#noteInput:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons .btn {
    width: auto;
    flex: 1;
    margin-bottom: 0;
}

.presence-options {
    text-align: left;
    margin-bottom: 20px;
}

.presence-options label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
    color: #444;
    cursor: pointer;
}

.presence-options input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #ccc;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.presence-options input[type="checkbox"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.presence-options input[type="checkbox"]:checked::before {
    content: '\2713';
    display: block;
    color: #fff;
    font-size: 16px;
    line-height: 18px;
    text-align: center;
}