/* PRIMA RIGA */
.vbp-first-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 10px; /* Spazio minimo tra le righe */
}

.vbp-info-section {
    flex: 1;
    min-width: 0;
}

/* Header Info Visita */
.vbp-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px; /* Ridotto */
    flex-wrap: wrap;
}

.vbp-header-info .vbp-title {
    margin: 0;
    font-size: 24px;
}

.vbp-debug-info {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6b7280;
}

.vbp-debug-info span {
    white-space: nowrap;
}

/* Descrizione breve */
.vbp-sintesi-section {
    margin-bottom: 0; /* Ridotto */
    padding: 10px 15px; /* Ridotto */
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.vbp-sintesi {
    margin: 0;
    line-height: 1.6;
}

/* Calendario Wrapper */
.vbp-calendario-wrapper {
    flex: 0 0 auto;
    min-width: 300px; /* Non deve mai essere più piccolo */
}

/* SECONDA RIGA (nascosta inizialmente) */
.vbp-second-row {
    margin-top: 10px; /* Spazio minimo dalla prima riga */
}

/* Calendario Prenotazione Styles */
.vbp-calendario-section {
    margin: 0;
}

.vbp-calendario-section h3 {
    margin-bottom: 10px; /* Ridotto */
    margin-top: 0;
}

/* Calendario Mensile */
.vbp-calendario-mensile {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vbp-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.vbp-cal-nav {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #374151;
    transition: all 0.2s;
    font-weight: bold;
}

.vbp-cal-nav:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.vbp-cal-nav:active {
    transform: scale(0.95);
}

.vbp-cal-month-year {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.vbp-cal-month {
    text-transform: capitalize;
}

.vbp-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.vbp-cal-weekday {
    padding: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
}

.vbp-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
}

.vbp-cal-day {
    aspect-ratio: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: all 0.2s;
}

.vbp-cal-day-empty {
    background: #f9fafb;
    cursor: default;
}

.vbp-cal-day-number {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.vbp-cal-day-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: #059669;
    font-weight: bold;
}

/* Giorni disponibili (verde) */
.vbp-cal-day-available {
    cursor: pointer;
    background: #f0fdf4;
    border: 2px solid transparent;
}

.vbp-cal-day-available:hover {
    background: #dcfce7;
    border-color: #86efac;
    transform: scale(1.05);
}

.vbp-cal-day-available .vbp-cal-day-number {
    color: #065f46;
    font-weight: 600;
}

.vbp-cal-day-available.vbp-cal-day-selected {
    background: #10b981;
    border-color: #059669;
}

.vbp-cal-day-available.vbp-cal-day-selected .vbp-cal-day-number {
    color: #fff;
}

.vbp-cal-day-available.vbp-cal-day-selected .vbp-cal-day-badge {
    color: #fff;
}

/* Giorni non disponibili */
.vbp-cal-day-unavailable {
    background: #fff;
    opacity: 0.5;
}

.vbp-cal-day-unavailable .vbp-cal-day-number {
    color: #9ca3af;
}

/* Giorni disabilitati (passati o futuri oltre max) */
.vbp-cal-day-disabled {
    background: #f9fafb;
    cursor: not-allowed;
}

.vbp-cal-day-disabled .vbp-cal-day-number {
    color: #d1d5db;
    text-decoration: line-through;
}

/* Giorno di oggi */
.vbp-cal-day-today {
    border: 2px solid #3b82f6 !important;
}

.vbp-cal-day-today .vbp-cal-day-number {
    font-weight: 700;
}

/* Lista date (fallback per retrocompatibilità) */
.vbp-date-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.vbp-date-btn {
    padding: 12px 15px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    text-align: center;
}

.vbp-date-btn:hover {
    border-color: #111827;
    background: #f9f9f9;
}

.vbp-date-btn.active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}


/* Selezione Orari */
.vbp-orari-container {
    margin-bottom: 10px; /* Ridotto */
    padding: 10px 15px; /* Ridotto */
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.vbp-orari-container label {
    display: block;
    margin-bottom: 5px; /* Ridotto */
}

.vbp-orari-container label {
    display: block;
    margin-bottom: 8px;
}

.vbp-select-orario {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Orario unico (informativo, non modificabile) */
.vbp-orario-unico {
    padding: 10px 15px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    color: #0066cc;
    margin-top: 5px;
}

.vbp-no-dates {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
}

/* Form Section */
.vbp-form-section {
    padding: 15px; /* Ridotto */
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.vbp-form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.vbp-form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.vbp-form-row {
    margin: 1rem 0 2rem 0;
    line-height: 0.5rem;
}

.vbp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.vbp-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.vbp-form-row input[type="text"],
.vbp-form-row input[type="email"],
.vbp-form-row input[type="tel"],
.vbp-form-row input[type="number"],
.vbp-form-row textarea,
.vbp-form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.vbp-form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.vbp-form-row input:disabled,
.vbp-form-row textarea:disabled,
.vbp-form-row select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.vbp-form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.vbp-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    margin-right: 10px;
    transition: all 0.3s;
}

.vbp-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.vbp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.vbp-btn-save {
    background: #111827;
    color: #fff;
}

.vbp-btn-finalize {
    background: #059669;
    color: #fff;
}

.vbp-messages {
    margin-top: 15px;
}

.vbp-msg {
    padding: 12px 15px;
    border-radius: 5px;
    margin: 10px 0;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vbp-msg-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.vbp-msg-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Modale Riepilogo */
.vbp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vbp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.vbp-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.vbp-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #111827;
}

.vbp-riepilogo-dati {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 5px;
    border: 1px solid #e5e7eb;
}

.vbp-riepilogo-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    line-height: 1.6;
}

.vbp-riepilogo-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.vbp-riepilogo-item strong {
    display: inline-block;
    min-width: 140px;
    color: #374151;
}

.vbp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.vbp-btn-modifica {
    background: #6b7280;
    color: #fff;
}

.vbp-btn-modifica:hover {
    background: #4b5563;
}

.vbp-btn-abbandona {
    background: #ef4444;
    color: #fff;
}

.vbp-btn-abbandona:hover {
    background: #dc2626;
}

.vbp-btn-prenota {
    background: #059669;
    color: #fff;
}

.vbp-btn-prenota:hover {
    background: #047857;
}

.vbp-btn-prenota:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 700px) {
    .vbp-first-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .vbp-calendario-wrapper {
        width: 100%;
        min-width: 300px;
    }
    
    .vbp-calendario-mensile {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .vbp-form-grid {
        grid-template-columns: 1fr;
    }
    
    .vbp-date-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .vbp-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .vbp-cal-day-number {
        font-size: 12px;
    }
    
    .vbp-cal-weekday {
        font-size: 11px;
        padding: 8px 4px;
    }
    
    .vbp-cal-header {
        padding: 5px 15px;
    }
    
    .vbp-cal-month-year {
        font-size: 15px;
    }
    
    .vbp-cal-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

