/* Stili di base del plugin */
.gps-user-input-panel { max-width: 800px; margin: 20px auto; padding: 30px; background-color: #ffffff; border: 1px solid #e0e0e0; border-radius: 12px; font-family: sans-serif; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07); }
.gps-user-input-panel h3 { color: #2c3e50; text-align: center; margin-top: 0; margin-bottom: 15px; font-size: 1.8em; }
.gps-user-input-panel form > br { display: none; }
.gps-user-input-panel form > label[for="gps_accommodation_select"] { display: block; font-weight: bold; color: #555; margin-bottom: 8px; }
#gps_accommodation_select { margin-bottom: 25px; }
.gps-form-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.gps-form-field { flex: 1 1 45%; display: flex; flex-direction: column; }
.gps-input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.gps-submit-button { width: 100%; padding: 15px; background-color: #2ecc71; color: white; border: none; border-radius: 4px; font-size: 1.2em; cursor: pointer; transition: background-color 0.3s ease; }
.gps-submit-button:hover { background-color: #27ae60; }

/* Stili del calendario */
.gps-calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: normal; }
.gps-calendar-header h3 { margin: 0; font-size: 1.2em; color: #333; text-align: center; }
.gps-calendar-header button { background-color: #f0f0f0; border: 1px solid #ccc; padding: 8px 12px; font-size: 1em; cursor: pointer; border-radius: 4px; width: auto; height: auto; display: flex; justify-content: center; align-items: center; }
.gps-calendar-header button:hover { background-color: #e0e0e0; }

/* Griglia Calendario (Sia grande che piccola) */
.gps-calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    gap: 5px; 
    padding: 10px; 
    background-color: #fff; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    text-align: center; 
}
.gps-day-name { font-weight: normal; color: #666; padding-bottom: 5px; }
.gps-day { padding: 10px; border: 1px solid #eee; cursor: pointer; border-radius: 4px; }
.gps-day.booked { background-color: #9b59b6; color: #fff; cursor: not-allowed; }
.gps-day.blocked { background-color: #ccc; color: #666; cursor: not-allowed; }
.gps-day.available { background-color: #2ecc71; color: #fff; }
.gps-day.selected { background-color: #3498db; color: #fff; }

/* Stile per il riquadro del messaggio UTENTE */
.gps-message-box { margin-top: 20px; padding: 20px; border-radius: 8px; text-align: center; font-weight: bold; display: none; font-size: 1.5em; }
.gps-message-box.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.gps-message-box.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- STILI ADMIN --- */
.gps-admin-message-box { margin-bottom: 20px; padding: 20px; border-radius: 8px; text-align: center; font-weight: bold; display: none; font-size: 1.2em; }
.gps-admin-message-box.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
.gps-admin-message-box.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }
body.wp-admin .wrap.gps-bookings-panel { max-width: 100% !important; width: 100% !important; box-sizing: border-box !important; }
body.wp-admin .wrap.gps-bookings-panel .card, body.wp-admin .wrap.gps-bookings-panel .wp-list-table { width: 100% !important; table-layout: auto !important; white-space: normal; }
.wp-list-table thead th { background-color: #f7f7f0; font-weight: normal; }
.booking-status-pending { background-color: #ffc107 !important; }
.booking-status-assigned { background-color: #28a745 !important; color: #fff; }
.booking-status-cancelled { background-color: #dc3545 !important; color: #fff; }
.wp-list-table button { background-color: #f0f0f0 !important; border: 1px solid #ccc !important; color: #333 !important; padding: 4px 8px; border-radius: 4px; font-weight: normal !important; text-shadow: none !important; }
.wp-list-table button:hover { background-color: #e0e0e0 !important; }
body.wp-admin .wrap .form-table th { width: 1250px; } body.wp-admin .wrap .form-table td { width: 100%; } body.wp-admin .wrap .form-table .large-text { width: 100%; }
.gps-hidden { display: none; }

/* Stili per la responsività */
@media (max-width: 600px) { .gps-calendar-grid { font-size: 14px; } .gps-day { padding: 8px; } .gps-form-row { flex-direction: column; gap: 0; } .gps-user-input-panel { padding: 20px; } }

/* --- Stili Master Calendar (ORA PIÙ SPECIFICI) --- */
.gps-master-calendar-panel { max-width: 100%; width: 100%; margin: 20px auto; }
.gps-master-calendar-panel .gps-master-calendar-nav { display: flex; justify-content: space-between; align-items: center; padding: 20px; margin-bottom: 20px; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 12px; }
.gps-master-calendar-panel .gps-master-calendar-nav h3 { margin: 0; color: #333; }
.gps-master-calendar-panel .gps-master-calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 20px; 
}
.gps-master-calendar-panel .gps-calendar-wrapper { padding: 15px; border: 1px solid #ddd; border-radius: 8px; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); }
.gps-master-calendar-panel .gps-calendar-wrapper h4 { text-align: center; margin-top: 0; margin-bottom: 10px; color: #444; }

/* Versione "small" del calendario (ORA PIÙ SPECIFICA) */
/* Questa è la regola chiave che risolve il problema dei giorni in colonna */
.gps-calendar-wrapper .gps-calendar-grid.small { 
    display: grid !important; /* Forza la griglia */
    grid-template-columns: repeat(7, 1fr) !important; /* Forza le 7 colonne */
    gap: 2px; 
    padding: 5px; 
    border: none; 
    background: none; 
}
.gps-calendar-wrapper .gps-day.small { padding: 5px; font-size: 0.9em; cursor: default; border-radius: 2px; border: 1px solid #f4f4f4; }
.gps-calendar-wrapper .gps-day.small.available { background-color: #fff; color: #333; }
.gps-calendar-wrapper .gps-day.small.booked { background-color: #9b59b6; color: #fff; }
.gps-calendar-wrapper .gps-day.small.blocked { background-color: #ccc; color: #666; }
.gps-calendar-wrapper .gps-calendar-grid.small .gps-day-name { font-size: 0.9em; padding-bottom: 2px; font-weight: bold; color: #777; }
.gps-master-calendar-panel .gps-calendar-container-small p { text-align: center; color: #888; }

/* --- STILI PER LA LEGENDA (Form Utente e Admin) --- */
.gps-calendar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-bottom: 25px; padding: 15px; background-color: #f8f8f8; border: 1px solid #e0e0e0; border-radius: 8px; }
.legend-item { display: flex; align-items: center; font-size: 0.9em; color: #555; }
.legend-color-box { width: 18px; height: 18px; border: 1px solid rgba(0,0,0,0.1); border-radius: 4px; margin-right: 8px; flex-shrink: 0; }
.legend-color-box.available { background-color: #2ecc71; }
.legend-color-box.blocked { background-color: #ccc; }
.legend-color-box.selected { background-color: #3498db; }
.legend-color-box.booked { background-color: #9b59b6; }
.legend-color-box.admin-available { background-color: #fff; border: 1px solid #bbb !important; }

/* --- STILI PER SELECT2 --- */
.select2-container--default .select2-selection--single { border: 1px solid #ccc !important; border-radius: 4px !important; height: auto !important; padding: 8px 12px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: normal !important; padding-left: 0 !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: calc(100% - 2px) !important; right: 5px !important; }
.select2-dropdown { border: 1px solid #ccc !important; border-radius: 4px !important; }
.select2-container.error .select2-selection--single { border-color: red !important; }

/* --- STILI IMPAGINAZIONE TABELLA --- */
.wp-list-table .gps-datetime-col { width: 140px; }
.wp-list-table .gps-actions-cell-inline { white-space: nowrap; }
.gps-actions-cell-inline button { margin: 2px !important; }

/* --- STILI MODULO ESPORTAZIONE --- */
.gps-export-form { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; padding: 20px; background-color: #f9f9f9; }
.gps-export-field { display: flex; flex-direction: column; }
.gps-export-field label { font-weight: bold; margin-bottom: 5px; font-size: 0.9em; color: #444; }
.gps-export-field input[type="date"] { padding: 8px; border: 1px solid #ccc; border-radius: 4px; height: 40px; }
.gps-export-form .button { height: 40px; margin-bottom: 0; }

/* --- STILI MODULO PULIZIA --- */
.gps-purge-form { padding: 20px; background-color: #fff9f9; border: 1px solid #dc3545; border-radius: 8px; }
.gps-purge-field { display: flex; flex-direction: column; margin-bottom: 15px; }
.gps-purge-field label { font-weight: bold; margin-bottom: 5px; color: #444; }
.gps-purge-field input[type="date"] { padding: 8px; border: 1px solid #ccc; border-radius: 4px; max-width: 200px; }
.button-danger { background-color: #dc3545 !important; border-color: #dc3545 !important; color: white !important; text-shadow: none !important; }
.button-danger:hover { background-color: #c82333 !important; border-color: #bd2130 !important; color: white !important; }