/* ====================================
   Booking Spaces Public Styles
   ================================== */

/* ⭐ LAYOUT PRINCIPAL */
.booking-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.booking-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 11px 7px rgba(0, 0, 0, 0.1);
}

.booking-step {
    margin-bottom: 30px;
}

.booking-step h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* ⭐ FORM GROUPS E LABELS */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    word-wrap: break-word;
    max-width: 100%;
}

.form-group .description {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* ⭐ CAMPOS OBRIGATÓRIOS */
.form-group.required label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* ⭐ INPUTS GERAIS */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ⭐ ESTILOS ESPECÍFICOS PARA CAMPOS NIF */
.nif-field {
    width: 100% !important;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: #fff;
}

.nif-field:focus {
    outline: none !important;
    border-color: #0073aa !important;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2) !important;
}

/* Estados de validação NIF */
.nif-field.nif-valid {
    border-color: #28a745 !important;
    background-color: #f8fff9 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2) !important;
}

.nif-field.nif-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}

/* Mensagens de erro e aviso para NIF */
.nif-error {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: fadeIn 0.3s ease;
}

.nif-warning {
    color: #856404;
    font-size: 0.9em;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ⭐ CHECKBOXES E RADIO BUTTONS */
input[type="checkbox"],
input[type="radio"] {
    width: auto !important;
    height: auto !important;
    margin-right: 8px;
    vertical-align: middle;
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.form-group label:has(input[type="checkbox"]),
.form-group label:has(input[type="radio"]) {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

.form-group label input[type="checkbox"],
.form-group label input[type="radio"] {
    margin: 0 !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
}

/* Checkbox específica da recorrência */
.form-group label:has(#enable_recurrence) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.form-group #enable_recurrence {
    margin: 0;
    margin-top: 2px;
    transform: scale(1.2);
    flex-shrink: 0;
}

/* ⭐ NÚMERO DE PESSOAS */
#num-people-group {
    position: relative;
}

#num_people {
    width: 100px;
    display: inline-block;
    margin-right: 10px;
}

#num_people.error {
    border-color: #dc3232;
    background-color: #fff5f5;
}

#area-capacity {
    font-weight: 600;
    color: #0073aa;
}

.capacity-warning {
    background: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.capacity-warning::before {
    content: "⚠️";
    font-size: 1.1em;
}

/* ⭐ TIME SLOTS */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
    user-select: none;
}

.time-slot {
    padding: 12px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
}

.time-slot:hover:not(.disabled) {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.time-slot.selected {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

.time-slot.selected:hover {
    background: #005a87;
    border-color: #005a87;
}

.time-slot.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot .slot-time {
    font-weight: 600;
    font-size: 14px;
}

.time-slot .slot-availability {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

.time-slot.selected .slot-availability {
    opacity: 1;
}

/* ⭐ FEEDBACK VISUAL PARA TEMPO MÍNIMO */
.time-slot.selected.minimum-duration-error {
    border-color: #dc3545 !important;
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    position: relative;
    animation: pulseWarning 2s infinite;
}

.time-slot.selected.minimum-duration-error::after {
    content: "⚠️";
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 11px;
    opacity: 0.9;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.time-slot.selected.minimum-duration-success {
    border-color: #28a745 !important;
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    position: relative;
}

.time-slot.selected.minimum-duration-success::after {
    content: "✓";
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 11px;
    opacity: 0.9;
    color: #fff;
    font-weight: bold;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes pulseWarning {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.85; 
        transform: scale(1.01);
    }
}

/* ⭐ SELECTION SUMMARY */
.selection-summary {
    margin-top: 15px;
    padding: 15px;
    background: #e7f5ff;
    border: 1px solid #0073aa;
    border-radius: 6px;
    text-align: left;
    font-weight: 600;
    color: #0073aa;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.selection-summary.alternated {
    background: #f0fff4;
    border-color: #4caf50;
    color: #2e7d32;
}

/* ⭐ MODO DE SELEÇÃO */
.selection-mode-info {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.selection-mode-info.mode-flexible {
    background: #e8f5e8 !important;
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
}

.selection-mode-info.mode-restricted {
    background: #fff3e0 !important;
    border-color: #ff9800 !important;
    color: #e65100 !important;
}

/* ⭐ TEMPO MÍNIMO */
#minimum-duration-info {
    margin: 15px 0;
}

.minimum-duration-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px 15px;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.minimum-duration-notice strong {
    color: #b45309;
}

/* ⭐ MÚLTIPLAS ÁREAS */
.areas-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.area-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
}

.area-checkbox-item:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.area-checkbox-item input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    transform: scale(1.3);
    flex-shrink: 0;
    width: auto;
    height: auto;
}

.area-checkbox-item input[type="checkbox"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.area-checkbox-item input[type="checkbox"]:checked {
    transform: scale(1.4);
}

.area-checkbox-item:has(input:checked) {
    border-color: #0073aa;
    background: #e7f5ff;
    box-shadow: 0 2px 8px rgba(0,115,170,0.2);
}

.area-info {
    flex: 1;
    line-height: 1.5;
    min-height: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.area-info strong {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
}

.area-info small {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.multiple-areas-summary {
    margin-top: 20px;
    padding: 15px;
    background: #e7f5ff;
    border: 1px solid #0073aa;
    border-radius: 6px;
    line-height: 1.6;
}

.multiple-areas-summary p {
    margin: 0 0 8px 0;
}

.multiple-areas-summary p:last-child {
    margin-bottom: 0;
}

.multiple-areas-summary strong {
    color: #0073aa;
}

#selected-areas-list {
    font-weight: 600;
    color: #2e7d32;
}

#min-capacity {
    font-weight: 600;
    color: #d32f2f;
    font-size: 1.1em;
}

/* ⭐ RECORRÊNCIA */
.recurrence-options {
    margin-top: 15px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 4px;
}

/* ⭐ NAVEGAÇÃO DO FORMULÁRIO */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    gap: 15px;
}

.btn-prev, .btn-next, .btn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #6c757d;
    color: white;
}

.btn-prev:hover {
    background: #5a6268;
}

.btn-next {
    background: #0073aa;
    color: white;
}

.btn-next:hover {
    background: #005a87;
}

.btn-submit {
    background: #28a745;
    color: white;
}

.btn-submit:hover {
    background: #218838;
}

/* Estados desabilitados de botões */
.btn-next:disabled,
.btn-next[disabled],
.btn-disabled-no-slots,
.btn-next.btn-disabled-no-slots {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ⭐ MENSAGENS */
.form-messages {
    margin-top: 20px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: "❌";
    font-size: 1.1em;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: "✅";
    font-size: 1.1em;
}

/* ⭐ SEM SLOTS DISPONÍVEIS */
.no-slots-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    line-height: 1.5;
    text-align: center;
    padding: 20px;
    margin-top: 10px;
}

.no-slots-message h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.no-slots-message ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.no-slots-message li {
    margin-bottom: 5px;
}

/* ⭐ LOADING */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ⭐ MODAL DE RECORRÊNCIA */
.recurrence-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.9) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2147483647 !important;
    padding: 20px;
    box-sizing: border-box;
    font-family: inherit;
}

.recurrence-modal * {
    box-sizing: border-box !important;
}

.recurrence-modal .modal-content {
    background: #fff !important;
    width: 100%;
    max-width: 800px;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.recurrence-modal .modal-header {
    padding: 25px 30px 20px;
    border-bottom: 2px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.recurrence-modal .modal-header h3 {
    margin: 0 !important;
    color: white !important;
    font-size: 1.5em !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.recurrence-modal .close-modal-x {
    background: rgba(255,255,255,0.2) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    font-size: 24px !important;
    cursor: pointer !important;
    color: white !important;
    padding: 8px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

.recurrence-modal .close-modal-x:hover {
    background: rgba(255,255,255,0.3) !important;
    border-color: rgba(255,255,255,0.5) !important;
    transform: scale(1.1) !important;
}

.recurrence-modal .modal-body {
    padding: 30px;
    color: #333;
    line-height: 1.6;
}

.recurrence-modal .modal-footer {
    padding: 25px 30px 30px;
    border-top: 2px solid #f1f3f4;
    display: flex;
    gap: 20px;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.recurrence-modal .btn-cancel,
.recurrence-modal .btn-confirm {
    padding: 15px 30px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 160px !important;
    justify-content: center !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.btn-cancel {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    color: #fff !important;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #5a6268, #495057) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4) !important;
}

.btn-confirm {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: #fff !important;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #218838, #1fa187) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4) !important;
}

/* Outros elementos do modal */
.summary-box {
    padding: 25px;
    border-radius: 12px;
    border: 3px solid #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.summary-box.has-conflicts {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    max-height: 250px;
    overflow-y: auto;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fafbfc;
}

.date-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.date-item.available {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
}

.date-item.unavailable {
    background: linear-gradient(135deg, #f8d7da, #f1c0c3);
    border-color: #dc3545;
    color: #721c24;
}

/* ⭐ ACESSIBILIDADE */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

*:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ⭐ RESPONSIVIDADE */
@media (max-width: 768px) {
    .booking-form-container {
        padding: 10px;
    }
    
    .booking-form {
        padding: 20px;
    }
    
    .form-navigation {
        flex-direction: column;
    }
    
    .btn-prev, .btn-next, .btn-submit {
        width: 100%;
        justify-content: center;
    }
    
    .nif-field {
        font-size: 18px; /* Evitar zoom no iOS */
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .areas-checkbox-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .area-checkbox-item {
        padding: 15px;
        gap: 12px;
        min-height: 65px;
    }
    
    .area-checkbox-item input[type="checkbox"] {
        transform: scale(1.2);
        margin-top: 1px;
    }
    
    .area-checkbox-item input[type="checkbox"]:checked {
        transform: scale(1.3);
    }
    
    /* Modal responsive */
    .recurrence-modal {
        padding: 10px !important;
    }
    
    .recurrence-modal .modal-content {
        max-height: 98vh;
        border-radius: 8px;
    }
    
    .recurrence-modal .modal-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-cancel,
    .btn-confirm {
        width: 100% !important;
        min-width: auto !important;
    }
}

@media (max-width: 480px) {
    .area-checkbox-item input[type="checkbox"]:checked {
        transform: scale(1.3);
    }
    
    .form-group input[type="checkbox"] {
        transform: scale(1.15);
    }
    
    .dates-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

/* ⭐ NOVO: Slots em manutenção TEMPORÁRIA (tempo real) - com riscas */
.time-slot.temp-maintenance {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    ) !important;
    color: #999 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    border-color: #ddd !important;
}

/* ========== PREVIEW EM TEMPO REAL ========== */

.recurrence-realtime-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-top: 20px;
    padding: 20px;
    transition: all 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-header h4 {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

.preview-legend {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6c757d;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.available {
    background: #28a745;
}

.dot.unavailable {
    background: #dc3545;
}

.dot.loading {
    background: #ffc107;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.preview-content {
    min-height: 60px;
    position: relative;
}

.preview-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.preview-dates-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.preview-date-box {
    min-width: 100px;
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    border: 2px solid;
    transition: all 0.3s ease;
    cursor: default;
}

.preview-date-box.available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.preview-date-box.unavailable {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.preview-date-box.loading {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    animation: pulse 1.5s infinite;
}

.preview-date-box .date-text {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.preview-date-box .time-text {
    display: block;
    font-size: 11px;
    opacity: 0.8;
}

.preview-date-box .status-text {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-summary {
    background: #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    border-left: 4px solid #6c757d;
}

.preview-summary.success {
    background: #d4edda;
    border-left-color: #28a745;
}

.preview-summary.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.preview-summary.error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.summary-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.summary-text .count {
    font-weight: 600;
}

.summary-text .available-count {
    color: #28a745;
}

.summary-text .unavailable-count {
    color: #dc3545;
}

/* Adaptação para ecrãs pequenos */
@media (max-width: 768px) {
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .preview-legend {
        justify-content: flex-start;
    }
    
    .preview-dates-grid {
        gap: 6px;
    }
    
    .preview-date-box {
        min-width: 90px;
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Melhoramentos de acessibilidade */
.preview-date-box:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Estado vazio */
.preview-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
}

.preview-error {
    text-align: center;
    color: #dc3545;
    padding: 20px;
    background: #f8d7da;
    border-radius: 6px;
}

/* Estilos para o timer de reserva temporária */
.reservation-timer {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    display: none;
}

.reservation-timer.timer-urgent {
    background: #ffebee;
    border-color: #f44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.timer-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.timer-text {
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 5px;
}

.timer-countdown {
    font-size: 24px;
    font-weight: bold;
    color: #1976d2;
    font-family: 'Courier New', monospace;
}

.timer-urgent .timer-text,
.timer-urgent .timer-countdown {
    color: #d32f2f;
}

/* ⭐ TIMER FIXO NO BOTTOM-LEFT */
.reservation-timer.fixed-timer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 0;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 60px;
    max-width: 280px;
}

.reservation-timer.fixed-timer.timer-urgent {
    background: #ffebee;
    border-color: #f44336;
    animation: pulse 1s infinite;
}

/* ⭐ ESTADOS: EXPANDIDO E MINIMIZADO */
.reservation-timer.fixed-timer.expanded {
    width: 280px !important;
    opacity: 1 !important;
}

.reservation-timer.fixed-timer.minimized {
    width: 80px !important;
}

/* ⭐ CONTEÚDO DO TIMER */
.timer-content {
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.timer-text {
    font-weight: 600;
    color: #1976d2;
    font-size: 13px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.timer-countdown {
    font-size: 18px;
    font-weight: bold;
    color: #1976d2;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

/* ⭐ ESTADO MINIMIZADO */
.reservation-timer.fixed-timer.minimized .timer-text {
    opacity: 0;
    height: 0;
    margin: 0;
}

.reservation-timer.fixed-timer.minimized .timer-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.reservation-timer.fixed-timer.minimized .timer-countdown {
    font-size: 16px;
}

/* ⭐ CORES URGENTES */
.reservation-timer.fixed-timer.timer-urgent .timer-text,
.reservation-timer.fixed-timer.timer-urgent .timer-countdown {
    color: #d32f2f;
}

/* ⭐ ANIMAÇÃO PULSE */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ⭐ HOVER EFFECT */
.reservation-timer.fixed-timer:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

/* ⭐ RESPONSIVO */
@media (max-width: 768px) {
    .reservation-timer.fixed-timer {
        bottom: 15px;
        left: 15px;
    }
    
    .reservation-timer.fixed-timer.expanded {
        width: 220px;
    }
    
    .reservation-timer.fixed-timer.minimized {
        width: 70px;
    }
}

.timer-details {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* ⭐ EVITAR CONFLITOS DE TRANSIÇÃO */
.reservation-timer.fixed-timer.expanded .timer-details {
    opacity: 1 !important;
    height: auto !important;
    margin-top: 4px !important;
}

.reservation-timer.fixed-timer.minimized .timer-details {
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.reservation-timer.fixed-timer.timer-urgent .timer-details {
    color: #d32f2f;
}

/* ⭐ PREVIEW COM MÚLTIPLOS SLOTS POR DATA */
.preview-date-group {
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.date-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    font-weight: 600;
    color: #495057;
}

.slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
}

.preview-slot-box {
    min-width: 120px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.preview-slot-box.available {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.preview-slot-box.unavailable {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.preview-slot-box .time-text {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.preview-slot-box .status-text {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.preview-slot-box .conflict-text {
    display: block;
    font-size: 9px;
    opacity: 0.8;
    font-style: italic;
}

/* Responsivo */
@media (max-width: 768px) {
    .slots-container {
        justify-content: center;
    }
    
    .preview-slot-box {
        min-width: 100px;
        font-size: 11px;
    }
}

.preview-summary .preview-sub { margin-top: 4px; font-size: 13px; color: #374151; }
.preview-slot-box .next-step { display:block; margin-top:4px; font-size:12px; }
.preview-slot-box .note-skip { color:#b45309; }    /* âmbar */
.preview-slot-box .note-review { color:#b91c1c; }  /* vermelho suave */

/* ===== Tooltip de slots ===== */
#bs-slot-tooltip {
  position: absolute;
  z-index: 9999;
  max-width: 280px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  color: #fff;
  background: rgba(26, 28, 31, 0.95);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  pointer-events: none; /* não interfere com o mouse */
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
  white-space: normal;
}

#bs-slot-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.time-slot.disabled { cursor: help; }
/* ===== /Tooltip de slots ===== */

/* Banner de erro persistente (topo) */
.global-alert {
  display: none;
  margin: 10px 0 16px;
  padding: 12px 16px;
  border-left: 4px solid #d32f2f;
  background: #fdecea;
  color: #611a15;
  border-radius: 4px;
  font-weight: 500;
}
.global-alert.show { display: block; }

/* Total (frontend) */
.total-price-summary{
  display:none;           /* é mostrado/ocultado via JS */
  margin:16px 0;
  padding:10px 12px;
  border:1px dashed #198754;
      background: #c7ffcd;
  border-radius:6px;
      box-shadow: -1px 1px 8px #d5d5d5;
}
.total-price-summary .amount{
  float:right;
  font-weight:700;
}

/* Pílula de preço no preview */
.preview-slot-box .price-chip{
  
}

