/* Modal de Agendamento - Estilos */

/* Overlay do Modal */
.appointment-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.appointment-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container do Modal */
.appointment-modal {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

/* Header do Modal */
.appointment-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    position: relative;
    text-align: center;
}

.appointment-modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.appointment-modal-header p {
    margin: 10px 0 0 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

.appointment-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.appointment-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body do Modal */
.appointment-modal-body {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.appointment-modal-body::-webkit-scrollbar {
    width: 8px;
}

.appointment-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.appointment-modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.appointment-modal-body::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Seções do Formulário */
.form-section-modal {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.form-section-modal:last-of-type {
    border-bottom: none;
}

.form-section-title-modal {
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Campos do Formulário */
.form-row-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group-modal {
    display: flex;
    flex-direction: column;
}

.form-label-modal {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-label-modal.required::after {
    content: " *";
    color: #dc3545;
}

.form-control-modal,
.form-select-modal {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control-modal:focus,
.form-select-modal:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control-modal::placeholder {
    color: #999;
}

textarea.form-control-modal {
    resize: vertical;
    min-height: 100px;
}

/* Info Box */
.info-box-modal {
    background: linear-gradient(135deg, #e7f3ff 0%, #f0e7ff 100%);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: start;
    gap: 15px;
}

.info-box-modal i {
    color: #667eea;
    font-size: 1.5rem;
    margin-top: 2px;
}

.info-box-modal-content {
    flex: 1;
}

.info-box-modal strong {
    display: block;
    margin-bottom: 5px;
    color: #667eea;
}

/* Horários Disponíveis */
.time-slots-container-modal {
    display: none;
    animation: fadeIn 0.3s ease;
}

.time-slots-container-modal.active {
    display: block;
}

.time-slots-modal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.time-slot-modal {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.time-slot-modal:hover {
    border-color: #667eea;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.time-slot-modal.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.time-slot-modal.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

.time-slot-modal.disabled:hover {
    transform: none;
    border-color: #e0e0e0;
    background: #f5f5f5;
}

/* Loading */
.loading-slots-modal {
    text-align: center;
    padding: 30px;
    color: #667eea;
}

.loading-slots-modal i {
    font-size: 2rem;
}

/* Botões */
.appointment-modal-footer {
    padding: 25px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-modal {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-modal-primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    flex: 1;
}

.btn-modal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.btn-modal-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-modal-secondary {
    background: #6c757d;
    color: white;
}

.btn-modal-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Mensagens de Alerta */
.alert-modal {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideDown 0.3s ease;
}

.alert-modal i {
    font-size: 1.5rem;
}

.alert-success-modal {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger-modal {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning-modal {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Success Screen */
.success-screen-modal {
    text-align: center;
    padding: 40px 20px;
}

.success-icon-modal {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon-modal i {
    color: white;
    font-size: 2.5rem;
}

.success-screen-modal h3 {
    color: #28a745;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.success-details-modal {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
    text-align: left;
}

.success-details-modal p {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.success-details-modal p:last-child {
    border-bottom: none;
}

.success-details-modal strong {
    color: #667eea;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .appointment-modal {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
    }
    
    .appointment-modal-header {
        padding: 20px;
    }
    
    .appointment-modal-header h2 {
        font-size: 1.4rem;
    }
    
    .appointment-modal-body {
        padding: 25px 20px;
    }
    
    .appointment-modal-footer {
        padding: 20px;
        flex-direction: column;
    }
    
    .btn-modal {
        width: 100%;
        justify-content: center;
    }
    
    .form-row-modal {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .time-slots-modal {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

@media (max-width: 480px) {
    .appointment-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .form-section-title-modal {
        font-size: 1.1rem;
    }
    
    .time-slots-modal {
        grid-template-columns: repeat(3, 1fr);
    }
}
