/* --- FONT & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

#dbb-booking-container {
    font-family: 'Poppins', sans-serif;
    max-width: 600px;
    margin: 40px auto;
    /* Sfondo scuro profondo */
    background-color: #181818; 
    border: 1px solid #333;
    border-radius: 24px; /* Angoli molto curvi */
    padding: 35px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6); /* Ombra "Glow" profonda */
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* --- TITOLI STEP --- */
.dbb-step h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 35px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* --- PULSANTI DI SERVIZIO (STEP 1) --- */
.dbb-service-list {
    display: grid;
    gap: 15px;
}

.dbb-service-button {
    background: #222;
    border: 2px solid #333;
    border-radius: 16px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.dbb-service-button:hover {
    border-color: #007bff;
    background: #2a2a2a;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.15); /* Glow Blu */
}

.dbb-service-button .service-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.dbb-service-button .service-details {
    font-size: 0.85rem;
    color: #ccc;
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* ==========================================
   STEP 2: CALENDARIO "SUPER SEXY" (Premium Dark)
   ========================================== */

/* Rimuove stili nativi */
#dbb-booking-container .ui-datepicker {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Header Mese (es. NOVEMBRE 2025) */
#dbb-booking-container .ui-datepicker-header {
    background: transparent !important;
    border: none !important;
    padding: 10px 0 25px 0 !important;
    text-align: center;
    position: relative;
}

#dbb-booking-container .ui-datepicker-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Frecce Navigazione (Cerchi) */
#dbb-booking-container .ui-datepicker-prev,
#dbb-booking-container .ui-datepicker-next {
    cursor: pointer;
    top: 12px !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: #333 !important;
    transition: 0.3s;
    display: flex; 
    align-items: center; 
    justify-content: center;
    border: 1px solid #444;
}

#dbb-booking-container .ui-datepicker-prev:hover,
#dbb-booking-container .ui-datepicker-next:hover {
    background: #007bff !important;
    border-color: #007bff !important;
    box-shadow: 0 0 10px #007bff;
}

#dbb-booking-container .ui-datepicker-prev span,
#dbb-booking-container .ui-datepicker-next span {
    filter: invert(1); /* Icone bianche */
    position: static !important;
    margin: 0 !important;
    display: block;
}

/* Griglia Calendario */
#dbb-booking-container .ui-datepicker-calendar {
    border-collapse: separate;
    border-spacing: 10px; /* Spazio tra i cerchi */
    width: 100%;
}

#dbb-booking-container .ui-datepicker th {
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding-bottom: 10px;
}

#dbb-booking-container .ui-datepicker td {
    padding: 0 !important;
}

/* Cella Giorno (CERCHIO BASE) */
#dbb-booking-container .ui-datepicker td a,
#dbb-booking-container .ui-datepicker td span {
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 auto !important;
    border-radius: 50% !important; /* Cerchio perfetto */
    background: #222 !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid #333 !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effetto rimbalzo */
}

/* --- STATI DEI GIORNI --- */

/* 1. VERDE (Aperto) - Stile Neon */
#dbb-booking-container td.day-status-green a {
    border-color: #28a745 !important;
    color: #fff !important;
    background: rgba(40, 167, 69, 0.1) !important;
}
#dbb-booking-container td.day-status-green a:hover {
    background: #28a745 !important;
    transform: scale(1.15); /* Ingrandisce */
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.8); /* Glow forte verde */
    z-index: 10;
}

/* 2. ARANCIONE (Quasi Pieno) */
#dbb-booking-container td.day-status-orange a {
    border-color: #ffc107 !important;
    color: #ffc107 !important;
    background: rgba(255, 193, 7, 0.1) !important;
}
#dbb-booking-container td.day-status-orange a:hover {
    background: #ffc107 !important;
    color: #000 !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

/* 3. GRIGIO/ROSSO (Chiuso) */
#dbb-booking-container td.day-status-gray span,
#dbb-booking-container td.day-status-gray a,
#dbb-booking-container td.day-status-red span,
#dbb-booking-container td.day-status-red a {
    border-color: #333 !important;
    background: #1a1a1a !important;
    color: #444 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* 4. SELEZIONATO (Blu Elettrico) */
#dbb-booking-container td.day-selected a,
#dbb-booking-container .ui-datepicker-current-day a {
    background: #007bff !important;
    border-color: #007bff !important;
    color: #fff !important;
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.7) !important; /* Super Glow */
}

/* 5. OGGI (Bordo sottile blu interno) */
#dbb-booking-container td.ui-datepicker-today a {
    box-shadow: inset 0 0 0 2px #007bff; 
}


/* ==========================================
   STEP 3: SPLIT VIEW (TABELLA ORARI)
   ========================================== */
#dbb-split-view-container {
    background: #222;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 0;
    overflow-y: auto;
    max-height: 500px;
    
    /* Scroll Orizzontale per Mobile */
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.dbb-split-view-table {
    width: 100%;
    min-width: 450px; /* Forza scroll su mobile piccoli */
    border-collapse: separate;
    border-spacing: 0;
}

.dbb-split-view-table thead th {
    background: #1a1a1a;
    color: #888;
    padding: 18px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    border-bottom: 2px solid #444;
    position: sticky;
    top: 0;
    z-index: 20;
}

.dbb-split-view-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
    background: #222;
}

/* Colonna Orario (Sticky a sx) */
.dbb-split-view-table .dbb-slot-time {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    background: #1f1f1f;
    border-right: 2px solid #333;
    position: sticky;
    left: 0;
    z-index: 10;
}

.dbb-split-view-table thead th:first-child {
    background: #1f1f1f;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 30;
    border-right: 2px solid #333;
}

/* Bottone PRENOTA */
.dbb-split-view-slot {
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 10px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    width: 100%;
    transition: all 0.2s;
    white-space: nowrap;
}

.dbb-split-view-slot:hover {
    background: #007bff;
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
    transform: translateY(-2px);
    border-color: #007bff;
}

.dbb-slot-unavailable {
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
    font-weight: 500;
}


/* ==========================================
   STEP 4: FORM DATI & BOTTONI
   ========================================== */
#dbb-booking-form input[type="text"],
#dbb-booking-form input[type="email"],
#dbb-booking-form input[type="tel"],
#dbb-booking-form textarea {
    background: #2a2a2a !important;
    border: 2px solid #333 !important;
    border-radius: 12px !important;
    padding: 18px !important;
    color: #fff !important;
    font-size: 1rem !important;
    margin-bottom: 15px;
    transition: 0.3s;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

#dbb-booking-form input:focus,
#dbb-booking-form textarea:focus {
    border-color: #007bff !important;
    background: #333 !important;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.2);
    outline: none;
}

/* --- FIX SPUNTA PRIVACY --- */
.dbb-privacy {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    margin-top: 10px;
    padding: 10px;
    background: #222;
    border-radius: 10px;
    border: 1px solid #333;
}

#dbb-booking-form .dbb-privacy input[type="checkbox"] {
    width: 24px !important; 
    height: 24px !important;
    padding: 0 !important;
    margin: 0 15px 0 0 !important;
    border: 2px solid #555 !important;
    border-radius: 6px !important;
    background: transparent !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
}

#dbb-booking-form .dbb-privacy input[type="checkbox"]:checked {
    background-color: #007bff !important;
    border-color: #007bff !important;
}

#dbb-booking-form .dbb-privacy input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    line-height: 1;
    font-weight: bold;
}

.dbb-privacy label {
    font-size: 0.9rem;
    color: #ccc;
    cursor: pointer;
    line-height: 1.4;
}

/* --- BOTTONI NAVIGAZIONE --- */
.dbb-button {
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    letter-spacing: 1px;
}

.dbb-prev-step {
    background: #333;
    color: #aaa;
    width: 48%;
    float: left;
}
.dbb-prev-step:hover { background: #444; color: #fff; }

#dbb-submit-booking, .dbb-next-step, #dbb-submit-waiting-list {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    width: 48%;
    float: right;
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.2);
}
#dbb-submit-booking:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.4);
}
#dbb-submit-booking:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed;
    box-shadow: none;
}

#dbb-submit-waiting-list { width: 100%; float: none; background: #28a745; }

.dbb-step::after { content: ""; display: table; clear: both; }

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 640px) {
    #dbb-booking-container { padding: 20px; margin: 10px auto; border-radius: 0; border: none; box-shadow: none; background: #121212; }
    
    #dbb-booking-container .ui-datepicker td a, 
    #dbb-booking-container .ui-datepicker td span {
        width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-size: 0.95rem !important;
    }
    #dbb-booking-container .ui-datepicker-calendar { border-spacing: 4px; }
    
    .dbb-prev-step, #dbb-submit-booking, .dbb-next-step { width: 100%; float: none; margin-bottom: 15px; }
}

/* --- LOADER --- */
#dbb-loader {
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    position: absolute; top:0; left:0; right:0; bottom:0;
    z-index: 100; display: flex; justify-content: center; align-items: center;
    border-radius: 24px;
}
.dbb-spinner {
    width: 60px; height: 60px;
    border: 5px solid rgba(255,255,255,0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   FIX VISIBILITÀ DESKTOP & ECCEZIONI (PUBLIC)
   ========================================= */

/* Forza visibilità eventi FullCalendar (se usato nel pubblico) */
.fc-event, 
.fc-event-container,
.fc-timegrid-event,
.fc-timegrid-event-harness {
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Eventi background per eccezioni/chiusure */
.fc-bgevent,
.fc-bg-event,
.fc-bgevent-closed {
    opacity: 0.6 !important;
    background: #ffcccc !important;
    z-index: 1 !important;
}

/* Disabilita cursore di trascinamento */
.fc-event {
    cursor: pointer !important;
}
/* Tasto Modifica Mail */
#dbb-change-email-btn {
    transition: color 0.3s;
}
#dbb-change-email-btn:hover {
    color: #fff !important; /* Diventa bianco quando passi sopra */
}