/* --- Estilos Generales del Modal --- */
/* Prioridad para SweetAlert */
.swal2-container { z-index: 1000000 !important; }

#contenedor-horarios {
    min-height: 250px; /* Ajusta este valor según la altura promedio de tu grid de horarios */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
    transition: all 0.3s ease;
}

#contenedor-horarios .time-item label {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ddd !important;
    text-decoration: none !important;
}

#contenedor-horarios.schedule-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
    margin-top: 10px !important;
    max-height: none !important; /* Eliminamos scroll interno */
    overflow: visible !important;
}

#contenedor-horarios .bg-success-custom {
    background-color: #222 !important;
    color: #444 !important; /* Gris oscuro */
    border: 1px solid #333 !important;
    text-decoration: line-through !important;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.1) !important;

    /* El blur separa el modal del contenido sin taparlo */
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;

    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: #1a1a1a; /* Fondo casi negro */
    color: #ffffff;
    width: 90%;
    max-width: 550px;
    padding: 20px 25px;
    border-radius: 20px;
    position: relative;
    max-height: 90vh;
    overflow-y: hidden;
    border: 1px solid rgba(212, 175, 55, 0.4); /* Dorado con transparencia*/
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7); /* Sombra para profundidad */
    display: flex;
    flex-direction: column;
}

/* Botón cerrar (X) */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #d4af37;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover { color: #fff; }

/* --- Tipografía --- */
.modal-header { text-align: center; margin-bottom: 30px; }
.gold-text { color: var(--negro); letter-spacing: 2px; text-transform: uppercase; margin: 0; }
.gold-text-titulo { color: #d4af37; letter-spacing: 2px; text-transform: uppercase; margin: 0; }
#modalSubtitle { font-size: 0.8rem; color: #888; margin-top: 5px; }

/* --- Inputs y Formularios --- */
.form-group { margin-bottom: 20px; }
.form-row { display: flex; gap: 15px; }
.col { flex: 1; }

label {
    display: block;
    margin-bottom: 8px;
    color: #d4af37;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: 0.3s;
}

/* Contenedor para posicionar la flecha */
.select-wrapper {
    position: relative;
    width: 100%;
}

/* Quitar la flecha original del navegador */
.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 35px; /* Espacio para que el texto no pise la flecha */
}

/* Crear la nueva flecha dorada con CSS */
.select-wrapper::after {
    content: '\25BC'; /* Triángulo hacia abajo */
    font-size: 12px;
    color: #d4af37; /* Dorado Luxury */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Para que al hacer clic en la flecha, se abra el select */
}

.form-control:focus {
    border-color: #d4af37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
    outline: none;
}

/* --- Grid de Horarios (Lo más importante) --- */
.schedule-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 5px !important; /* Espacio más estrecho entre cuadros */
    margin-top: 10px;
    max-height: none; /* Quitamos el límite para que no scrollee si no es necesario */
    overflow-y: visible; /* Evitamos el scroll interno */
    padding: 5px 0;
}

.time-item input[type="radio"] { display: none; }
.time-item label {
    height: 42px !important; /* Altura reducida */
    padding: 2px !important;
    font-size: 0.7rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    background: #ffffff !important; /* Blanco */
    color: #1a1a1a !important;     /* Negro casi puro */
    border: 1px solid #ddd !important;
    font-weight: 500;
}

.time-item label strong {
    font-size: 0.85rem !important; /* Hora en negrita clara */
}

.time-item input[type="radio"]:checked + label {
    background: #27ae60 !important;
    color: var(--blanco) !important;
    font-weight: bold;
    border-color: #fff;
}

.time-item label small {
    font-size: 0.6rem !important;
    margin-top: 1px;
    opacity: 0.9;
}

.msg-hint {
    width: 100%;
    text-align: center;
    padding: 40px 0;
    color: #888;
    font-style: italic;
}

/* --- Botones --- */
.modal-footer {
    display: flex !important;
    flex-direction: row !important; /* Fuerza la fila */
    justify-content: space-between;
    gap: 12px;
}

.btn-gold, .btn-danger-luxury {
    flex: 1; /* Ambos ocupan el 50% del espacio disponible */
    padding: 14px 5px; /* Padding vertical cómodo y horizontal reducido */
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.85rem; /* Un poco más pequeño para que quepan bien en fila */
    letter-spacing: 0.5px;
    display: inline-block;
    white-space: nowrap; /* Evita que el texto se parta en dos líneas */
}

.btn-gold {
    background: #d4af37 !important; /* Color base sólido */
    color: var(--negro) !important;
    border: none !important;
    transition: 0.3s all ease !important;
}

.btn-gold:hover {
    background: #f1c40f !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Color Rojo Luxury (Cancelar) */
.btn-danger-luxury {
    /* Rojo Carmesí Sólido (estilo Barbería Premium) */
    background-color: #a82424 !important;
    color: var(--blanco) !important;
    /* Un borde un tono más claro para dar relieve sin usar sombras externas */
    border: 1px solid #a82424 !important;

    padding: 15px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-danger-luxury:hover {
    /* Oscurecimiento sutil al pasar el mouse */
    background-color: #721414 !important;
    border-color: #8b1a1a !important;
    /* Resplandor interno muy leve para efecto de pulsación */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

btn-gold, .btn-danger-luxury {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Estilo para el botón Cancelar Cita */
.btn-outline-danger {
    background: transparent;
    color: #ff4d4d; /* Rojo suave para indicar peligro/cancelación */
    border: 1px solid #ff4d4d;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    text-transform: uppercase;
    transition: all 0.3s ease;
    flex: 1; /* Para que compartan el mismo ancho en el footer */
    border-radius: 4px;
}

.btn-outline-danger:hover {
    background: #ff4d4d;
    color: white;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

/* Ajuste al footer del modal para que los botones se vean alineados */
.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

/* Re-aseguramos el estilo del botón dorado para que combinen */
.btn-outline-danger {
    background: #8B0000;
    color: white;
    border: 1px solid #b22222;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    flex: 2; /* El botón de confirmar es más importante/ancho */
    transition: all 0.3s ease;
    border-radius: 10px;
}

.btn-outline-danger:hover {
    background: #b8952e;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

input[type="date"]::-webkit-calendar-picker-indicator {
        filter: invert(72%) sepia(55%) saturate(450%) hue-rotate(3deg) brightness(95%) contrast(89%);
        cursor: pointer;
    }

.time-block-selected {
    background: #443a1a !important; /* Dorado oscuro */
    color: #d4af37 !important;
    border: 1px solid #d4af37 !important;
    font-weight: bold;
}

/* --- Estado Ocupado (Verde Luxury) --- */
/* Forzar el estado ocupado (Verde) */
#contenedor-horarios .time-item input:disabled + label {
    /*background-color: #44B886 !important;*/
    /*color: var(--negro) !important;*/
    /*border: 1px solid #2d6a4f !important;*/
    background-color: #2c3e50 !important; /* Azul Petróleo */
    color: #ffffff !important;            /* Letra blanca */
    border: 1px solid #1a252f !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    text-decoration: line-through !important;
    display: block !important;
}

/* Forzar el estado seleccionado (Dorado) */
/*
#contenedor-horarios .time-item input[type="radio"]:checked + label {
    background-color: #d4af37 !important;
    color: #000 !important;
    font-weight: bold !important;
}
*/

.bloque-seleccionado,
#contenedor-horarios .time-item input[type="radio"]:checked + label {
    background-color: #27AE60 !important; /* Dorado Luxury */
    color: var(--negro) !important;
    border: 1px solid #ffffff !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    transform: scale(1.05);
}

.bloque-seleccionado, .bg-warning-custom {
    background-color: #d4af37 !important; /* O el verde que uses */
    color: black !important;
}

/* Asegurar que el radio button siga oculto */
#contenedor-horarios .time-item input[type="radio"] {
    display: none !important;
}

/* Citas ocupadas por otros */
.bg-success {
    background-color: #28a745 !important;
    color: white;
}

/* Cita del cliente (Amarillo) */
/*
.bg-warning-custom {
    background-color: (--dorado) !important; /* Dorado muy oscuro
    color: #1a1a1a !important;
    border: 1px solid #d4af37 !important;
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}*/

.bg-warning-custom {
    background-color: #27ae60 !important; /* Verde Esmeralda/Barber */
    color: #ffffff !important;            /* Letra blanca */
    border: 1px solid #1e8449 !important;
    font-weight: bold !important;
    text-decoration: none !important; /* Quitamos el tachado si lo tenía */
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}

    /* Ocupado por otros (Verde) */
.bg-success-custom {
    background-color: #12c3e50 !important;
    color: var(--blanco) !important;
    text-decoration: line-through !important;
}

.time-item label:not(.bloque-seleccionado) {
    background: #333 !important;
    color: #fff !important;
    border: 1px solid #444 !important;
    box-shadow: none !important;
    transform: scale(1) !important;
}

    /* Bloque seleccionado (Borde Dorado) */
.bloque-seleccionado {
    /*background-color: #d4af37 !important;*/
    backround-color: #1dd96d !important;
    color: #000 !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    border: 1px solid #fff !important;
}

#contenedor-horarios .time-item label.bloque-seleccionado {
    background-color: #27ae60 !important; /* Verde */
    color: var(--negro) !important;
    border: 1px solid #1e8449 !important;
    font-weight: bold !important;
    text-decoration: none !important; /* Quitamos el tachado si lo tenía */
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}