/* CSS para organizar las horas en dos columnas */
.hora-botones-container {
    display: none;
    /* Oculto por defecto, JavaScript lo mostrará cuando haya horas */
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    max-width: 250px;
}

/* Ocultar el calendario por defecto */
#appointment-schedule {
    display: none;
    /* Oculto por defecto, JavaScript lo mostrará cuando haya fechas */
}

#appointment-schedule .card .card-header>strong {
    text-transform: uppercase;
    font-size: 16px;
}

#appointment-schedule .card .card-body {
    margin-top: 10px;
}

#appointment-schedule .card .card-body .alert.alert-info {
    display: none;
}

/* Estilos para el contenedor del calendario */
.calendar-wrapper {
    width: 100%;
    max-width: 350px;
}

/* Asegurar que el contenedor de horas se muestre correctamente */
.hora-botones-container {
    display: none;
    /* Oculto por defecto, JavaScript lo mostrará cuando haya horas */
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    max-width: 250px;
}

/* Asegurar que el título de hora se muestre */
.selector-titulo {
    display: none;
    /* Oculto por defecto, JavaScript lo mostrará cuando haya horas */
    color: #1ef1c6 !important;
    font-weight: bold;
    margin-bottom: 10px;
}

.calendar-separator {
    height: 100%;
    width: 3px;
    background-color: #1ef1c6;
}

/* Asegurar que no haya espacios innecesarios */
.hours-side {
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
    justify-content: space-around;
}

.calendar-wrapper {
    margin-bottom: 0;
}

/* Ocultar elementos que no necesitamos */
#parametros-cita,
#service_code_container {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ocultar el campo de fecha que está arriba del calendario */
.flatpickr-input,
input[type="text"][name="appointment_date"],
input[type="text"][id="appointment_date"] {
    display: none !important;
}

/* Forzar que las horas se muestren cuando el contenedor tenga contenido */
.hora-botones-container:not(:empty) {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Forzar que el título se muestre cuando las horas estén disponibles */
.hours-side-panel:has(.hora-botones-container:not(:empty)) .selector-titulo {
    display: block !important;
}

/* Regla específica para cuando JavaScript active el contenedor */
.hora-botones-container[style*="display: grid"] {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Estilos para el select de hora */
#hour-select {
    background-color: #000 !important;
    color: #1ef1c6 !important;
    border: 1px solid #1ef1c6 !important;
    padding: 5px 10px !important;
    border-radius: 3px !important;
    min-width: 120px;
}

#hour-select:focus {
    outline: none !important;
    box-shadow: 0 0 5px rgba(30, 241, 198, 0.5) !important;
}

#hour-select option {
    background-color: #000 !important;
    color: #1ef1c6 !important;
}

/* Ocultar el título de selección de hora por defecto */
.selector-titulo {
    display: none;
    /* Oculto por defecto, JavaScript lo mostrará cuando haya horas */
    margin-bottom: 8px !important;
    font-size: 1.1em !important;
}

/* Estilos para el campo de fecha del calendario (flatpickr) */
.flatpickr-input {
    background-color: #000 !important;
    color: #1ef1c6 !important;
    border: 1px solid #1ef1c6 !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 0.9em !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.flatpickr-input:hover {
    background-color: #1a1a1a !important;
    border-color: #00d4b3 !important;
}

.flatpickr-input:focus {
    outline: none !important;
    box-shadow: 0 0 10px rgba(30, 241, 198, 0.3) !important;
}

/* Estilos para los días del calendario */
.flatpickr-day {
    color: #1ef1c6 !important;
    background-color: #000 !important;
}

.flatpickr-day:hover {
    background-color: #1a1a1a !important;
    color: #1ef1c6 !important;
}

.flatpickr-day.selected {
    background-color: #1ef1c6 !important;
    color: #000 !important;
}

/* Layout para calendario centrado y fecha abajo */
.calendar-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    width: auto;
    max-width: 600px;
    position: relative;
    min-height: 400px;
}

.calendar-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    width: 100%;
}

.calendar-wrapper {
    width: 100%;
    max-width: 350px;
}

.date-display-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 45%;
}

.date-time-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-time-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-time-row.date-row {
    display: none;
}

.date-label, .hour-label {
    color: #FFF !important;
    font-weight: bold;
    min-width: 60px;
    font-size: 16px;
}

.selected-date-text {
    color: #FFF !important;
    margin-left: 10px;
}

#hour-select {
    background-color: #000;
    color: #1ef1c6;
    border: 1px solid #1ef1c6;
    padding: 5px 10px;
    border-radius: 3px;
    margin-left: 10px;
    min-width: 150px;
}

/* Ajustar el estilo de los botones */
.hora-btn, .hora-boton {
    width: 95%;
    text-align: center;
    margin: 2px 0;
    font-size: 0.85em;
    min-height: 30px;
}

/* Estilos para parámetros en columna lateral */
.parametros-cita-lateral {
    position: absolute;
    right: 20px;
    top: 100px;
    width: 220px;
    background-color: #000 !important;
    color: #1ef1c6 !important;
    border: 1px solid #1ef1c6;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(30, 241, 198, 0.3);
    z-index: 100;
}

.parametros-cita {
    display: none !important;
}

/* Estilo para el botón dentro del contenedor */
.confirm-btn-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

.date-display-container .confirm-btn {
    background-image: linear-gradient(to right, #1ef1c6, #00d4ec, #00b0ff, #0082ff, #5634ed);
    font-size: 16px;
    margin-top: 40px;
    color: #FFF !important;
    border: none !important;
    box-shadow: none !important;
}

/* Estilos para el mensaje de respuesta */
#mensaje-respuesta {
    margin: 10px auto !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
    font-size: 0.9em !important;
    text-align: center !important;
    font-weight: 500 !important;
    display: none;
    max-width: 65% !important;
    width: auto !important;
}

#mensaje-respuesta.mensaje-exito {
    background-color: #1ef1c6 !important;
    color: #000 !important;
    border: 2px solid #1ef1c6 !important;
}

#mensaje-respuesta.mensaje-error {
    background-color: #ff4444 !important;
    color: #fff !important;
    border: 2px solid #ff4444 !important;
}

#mensaje-respuesta.mensaje-info {
    background-color: #007bff !important;
    color: #fff !important;
    border: 2px solid #007bff !important;
}

/* Ocultar el mensaje de hora seleccionada */
#hora-seleccionada-msg {
    display: none !important;
}

/* Estilo para botones de hora seleccionados */
.hora-boton.selected, .hora-btn.selected {
    background-color: #FFF !important;
    color: #000 !important;
    font-weight: bold;
}

/* Modal de éxito para cita agendada */
.modal-exito {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #000;
    border: 1px solid #1ef1c6;
    padding: 30px;
    width: 50%;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.success-icon {
    font-size: 60px;
    color: #1ef1c6;
    margin-bottom: 15px;
}

.modal-header h3 {
    color: #FFF;
    font-size: 20px;
    text-transform: uppercase;
}

.modal-body {
    margin-bottom: 25px;
}

.cita-details {
    border: 1px solid #1ef1c6;
    padding: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(30, 241, 198, 0.3);
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-label {
    color: #FFF;
    font-weight: bold;
    font-size: 14px;
    min-width: 120px;
}

.detail-value {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: 15px;
}

.modal-footer {
    text-align: center;
}

.btn-aceptar {
    display: inline-flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: auto;
    height: auto !important;
    position: relative !important;
    border-radius: 40px !important;
    background-color: #000 !important;
    color: #FFF !important;
    text-decoration: none !important;
    font-size: 16px !important;
    z-index: 1 !important;
    padding: 10px 20px;
    cursor: pointer;
}

.btn-aceptar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #1ef1c6, #00d4ec, #00b0ff, #0082ff, #5634ed);
    z-index: -1;
    border-radius: 40px;
    padding: 4px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.modal-footer {
    justify-content: center;
}

@media only screen and (max-width: 1200px) {
    .hours-side {
        flex-direction: column;
    }

    .date-display-container {
        width: 100%;
    }
}

@media only screen and (max-width: 1000px) {
    .hours-side {
        flex: 1 1 50%;
    }

    .modal-content {
        width: 70%;
    }
}

@media only screen and (max-width: 800px) {

    .appointment {
        margin-top: 10px;
    }

    .appointment-form-flex {
        flex-direction: column;
    }

    .appointment .appointment-container .appointment-data form .form-side {
        width: 100%;
    }

    .hours-side {
        width: 100%;
    }

    .calendar-separator {
        height: 3px;
        width: 100%;
    }

    .modal-content {
        width: 80%;
    }
}

@media only screen and (max-width: 500px) {
    .active-service .no-appointments-message .message-header {
        flex-direction: column;
        gap: 15px;
    }

    .active-service .no-appointments-message .message-header svg {
        margin-right: 0;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }
}