/**
 * SmartPreno - Frontend Styles
 * Design moderno e responsive per il form di prenotazione
 */

/* === WRAPPER PRINCIPALE === */
.smartpreno-booking-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

/* === FORM === */
.smartpreno-booking-form {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.smartpreno-form-intro {
    margin-bottom: 30px;
    text-align: center;
}

.smartpreno-form-intro h3 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #2c3e50;
}

.smartpreno-form-intro p {
    margin: 0;
    color: #7f8c8d;
    font-size: 16px;
}

/* === LAYOUT FORM === */
.smartpreno-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.smartpreno-form-col-6 {
    flex: 1;
    min-width: 0;
}

.smartpreno-form-group {
    margin-bottom: 20px;
}

.smartpreno-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.smartpreno-form-group label .required {
    color: #e74c3c;
}

.smartpreno-form-group input[type="text"],
.smartpreno-form-group input[type="email"],
.smartpreno-form-group input[type="tel"],
.smartpreno-form-group select,
.smartpreno-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.smartpreno-form-group input[type="text"]:focus,
.smartpreno-form-group input[type="email"]:focus,
.smartpreno-form-group input[type="tel"]:focus,
.smartpreno-form-group select:focus,
.smartpreno-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.smartpreno-form-group input[type="text"]:disabled,
.smartpreno-form-group select:disabled {
    background-color: #ecf0f1;
    cursor: not-allowed;
}

.smartpreno-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.smartpreno-help-text {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #95a5a6;
}

/* === CHECKBOX === */
.smartpreno-checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal !important;
    cursor: pointer;
    user-select: none;
}

.smartpreno-checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px;
    cursor: pointer;
}

/* === DIVIDER === */
.smartpreno-divider {
    border: none;
    border-top: 1px solid #ecf0f1;
    margin: 30px 0;
}

/* === BUTTONS === */
.smartpreno-form-actions {
    margin-top: 30px;
    text-align: center;
}

.smartpreno-btn {
    display: inline-block;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.smartpreno-btn-primary {
    background-color: #3498db;
    color: #ffffff;
}

.smartpreno-btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* === FOOTER FORM === */
.smartpreno-form-footer {
    margin-top: 20px;
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
}

.smartpreno-form-footer p {
    margin: 5px 0;
}

.smartpreno-form-footer a {
    color: #3498db;
    text-decoration: none;
}

.smartpreno-form-footer a:hover {
    text-decoration: underline;
}

/* === MESSAGGI === */
.smartpreno-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
}

.smartpreno-message strong {
    display: block;
    margin-bottom: 8px;
}

.smartpreno-message ul {
    margin: 0;
    padding-left: 20px;
}

.smartpreno-error {
    background-color: #ffeef0;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.smartpreno-success {
    background-color: #eafaf1;
    border-left: 4px solid #27ae60;
    color: #1e8449;
}

.smartpreno-info {
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    color: #21618c;
}

/* === LOADING === */
.smartpreno-loading {
    padding: 10px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

/* === CONFERMA PRENOTAZIONE === */
.smartpreno-confirmation-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.smartpreno-confirmation-icon {
    text-align: center;
    margin-bottom: 20px;
}

.smartpreno-confirmation-icon svg {
    width: 64px;
    height: 64px;
}

.smartpreno-success .smartpreno-confirmation-icon svg {
    color: #27ae60;
}

.smartpreno-info .smartpreno-confirmation-icon svg {
    color: #3498db;
}

.smartpreno-confirmation-wrapper h2 {
    text-align: center;
    margin: 0 0 15px;
    font-size: 32px;
    color: #2c3e50;
}

.smartpreno-confirmation-message {
    text-align: center;
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}

.smartpreno-confirmation-details {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.smartpreno-confirmation-details h3 {
    margin: 0 0 20px;
    font-size: 22px;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.smartpreno-details-table {
    width: 100%;
    margin-bottom: 20px;
}

.smartpreno-details-table tr {
    border-bottom: 1px solid #ecf0f1;
}

.smartpreno-details-table td {
    padding: 12px 0;
}

.smartpreno-details-table .label {
    color: #7f8c8d;
    font-size: 14px;
    width: 40%;
}

.smartpreno-details-table .value {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
}

.smartpreno-confirmation-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.smartpreno-confirmation-info p {
    margin: 0 0 10px;
    color: #2c3e50;
}

.smartpreno-confirmation-info ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.smartpreno-confirmation-info li {
    margin-bottom: 8px;
}

.smartpreno-confirmation-actions {
    text-align: center;
    margin-top: 30px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .smartpreno-booking-form {
        padding: 20px;
    }
    
    .smartpreno-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .smartpreno-form-intro h3 {
        font-size: 24px;
    }
    
    .smartpreno-confirmation-wrapper h2 {
        font-size: 26px;
    }
    
    .smartpreno-details-table .label,
    .smartpreno-details-table .value {
        display: block;
        width: 100%;
    }
    
    .smartpreno-details-table .label {
        padding-bottom: 4px;
    }
    
    .smartpreno-details-table .value {
        padding-top: 4px;
        padding-bottom: 12px;
    }
}

/* === OPZIONI NOTIFICA === */
.smartpreno-notification-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.smartpreno-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #f8f9fa;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.smartpreno-radio-label:hover {
    border-color: #3498db;
    background: #ebf5fb;
}

.smartpreno-radio-label input[type="radio"] {
    display: none;
}

.smartpreno-radio-label input[type="radio"]:checked + .radio-icon + .radio-text {
    font-weight: 600;
}

.smartpreno-radio-label:has(input:checked) {
    border-color: #27ae60;
    background: #e8f8f5;
}

.radio-icon {
    font-size: 20px;
}

.radio-text {
    font-size: 15px;
    color: #2c3e50;
}

/* Fallback per browser che non supportano :has() */
.smartpreno-radio-label.selected {
    border-color: #27ae60;
    background: #e8f8f5;
}

@media (max-width: 480px) {
    .smartpreno-notification-options {
        flex-direction: column;
    }
    
    .smartpreno-radio-label {
        width: 100%;
    }
}

/* === FESTIVITÀ NEL DATEPICKER === */
.ui-datepicker .smartpreno-holiday a {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    color: #856404 !important;
    font-weight: 600;
    border-radius: 4px;
}

.ui-datepicker .smartpreno-holiday a:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%) !important;
}

/* Tooltip festività */
.ui-datepicker td[title] a {
    cursor: help;
}

/* === v2.7.7-dev: giorni chiusi e aperture straordinarie === */
/* Giorno settimanalmente chiuso (es. lunedì) */
.ui-datepicker td.smartpreno-closed-weekly > span,
.ui-datepicker td.smartpreno-closed-weekly > a {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    opacity: 0.75;
    cursor: not-allowed;
    text-decoration: line-through;
}
/* Chiusura straordinaria (ferie, eventi) */
.ui-datepicker td.smartpreno-closed-special > span,
.ui-datepicker td.smartpreno-closed-special > a {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #991b1b !important;
    opacity: 0.85;
    cursor: not-allowed;
    text-decoration: line-through;
    font-weight: 600;
}
/* Apertura straordinaria (giorno chiuso ma aperto quel giorno) */
.ui-datepicker td.smartpreno-special-opening a {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    color: #065f46 !important;
    font-weight: 700;
    border-radius: 4px;
}
.ui-datepicker td.smartpreno-special-opening a:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%) !important;
}
