/**
 * Estilos para la funcionalidad de fecha flexible
 * 
 * @package Habitaciones Functionality
 * @since 1.1.0
 */

/* ============================================
   Checkbox de Fecha Flexible (Frontend)
   ============================================ */

.flexible-checkout-option {
    display: flex;
    margin: 15px 0 !important;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.flexible-checkout-option:hover {
    background: #e9ecef;
    border-color: #d0d0d0;
}

.flexible-checkout-option.flexible-active {
    background: #fff3cd;
    border-color: #ffc107;
}

.flexible-checkout-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.flexible-checkout-checkbox {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.flexible-checkout-text {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.flexible-checkout-tooltip {
    margin-left: 5px;
    color: #666;
    cursor: help;
    font-size: 16px;
}

.flexible-checkout-tooltip:hover {
    color: #333;
}

/* Mensaje de confirmación */
.flexible-confirm-msg {
    margin-top: 10px;
    padding: 8px 10px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 3px;
    font-size: 12px;
    color: #856404;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Campo de Salida Deshabilitado
   ============================================ */

.search-date-range-arrive, .search-date-range-depart{
    width: 100%;
    margin-left: 0;
    margin-bottom:10px;
}

.search-date-range-depart.disabled-field {
    position: relative;
}

.search-date-range-depart.disabled-field::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    z-index: 1;
    pointer-events: none;
}

.search-date-range-depart.disabled-field input {
    background-color: #f0f0f0 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    color: #f0f0f0 !important;
}

.search-date-range-depart.disabled-field input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.flexible-info-text {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
    z-index: 2;
    position: relative;
}

/* ============================================
   Badge de Fecha Flexible (Admin)
   ============================================ */

.flexible-badge {
    display: inline-block;
    background: #ff9800;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Detalles Reserva (Admin)
   ============================================ */

.detail-list{
    columns:1 !important;
    -webkit-columns: 1 !important;
}

/* ============================================
   Formulario de Edición (Admin)
   ============================================ */

.flexible-checkout-edit {
    margin-top: 10px;
}

.flexible-checkout-form {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}

.flexible-checkout-form .form-group {
    margin-bottom: 15px;
}

.flexible-checkout-form .form-group:last-of-type {
    margin-bottom: 0;
}

.flexible-checkout-form label {
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.flexible-checkout-form input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.flexible-checkout-form input[type="date"] {
    display: block;
    width: 100%;
    max-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.flexible-checkout-form input[type="date"]:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.flexible-checkout-form small {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
}

/* Mensajes */
.flexible-message {
    margin-top: 10px;
}

.flexible-message .alert {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 0;
}

.flexible-message .alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.flexible-message .alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ============================================
   Lista de Reservas (Admin)
   ============================================ */

/* Columna de tipo */
.column-flexible_checkout {
    width: 100px;
    text-align: center;
}

/* Fila de reserva flexible */
.flexible-reservation-row {
    background-color: #fff8e1 !important;
}

.flexible-reservation-row:hover {
    background-color: #fff3cd !important;
}

/* ============================================
   Mensajes Temporales
   ============================================ */

.temp-flexible-msg {
    position: absolute;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 5px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   Botones
   ============================================ */

#edit-checkout-date-btn {
    transition: all 0.3s ease;
}

#edit-checkout-date-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#save-checkout-date-btn {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

#save-checkout-date-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

#save-checkout-date-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

#cancel-checkout-edit-btn {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

#cancel-checkout-edit-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .flexible-checkout-option {
        padding: 10px;
    }
    
    .flexible-checkout-text {
        font-size: 13px;
    }
    
    .flexible-checkout-form {
        padding: 12px;
    }
    
    .flexible-checkout-form input[type="date"] {
        max-width: 100%;
    }
    
    .flexible-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .flexible-checkout-label {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .flexible-checkout-checkbox {
        margin-bottom: 5px;
    }
    
    .flexible-checkout-tooltip {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* ============================================
   Compatibilidad con el tema Homey
   ============================================ */

.sidebar-booking-module .flexible-checkout-option {
    margin-top: 15px;
}

.homey_notification .flexible-checkout-option {
    margin-bottom: 0;
}

/* Ajustar estilos para formularios del tema */
.block-body-sidebar .flexible-checkout-form input[type="date"] {
    height: 45px;
    font-size: 14px;
}

.block-body-sidebar .flexible-checkout-form .btn {
    padding: 8px 20px;
    font-size: 14px;
}

/* ============================================
   Animaciones y Transiciones
   ============================================ */

.flexible-checkout-form {
    animation: slideDown 0.3s ease;
}

.flexible-message .alert {
    animation: slideDown 0.3s ease;
}

/* ============================================
   Estados de Hover
   ============================================ */

.flexible-checkout-option:hover .flexible-checkout-tooltip {
    color: #333;
}

.flexible-badge:hover {
    background: #f57c00;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* ============================================
   Iconos
   ============================================ */

.flexible-checkout-form i.fa-spinner {
    margin-right: 5px;
}

.flexible-message i.homey-icon {
    margin-right: 5px;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .flexible-checkout-edit,
    .flexible-checkout-form {
        display: none !important;
    }
    
    .flexible-badge {
        border: 1px solid #333;
        color: #333;
        background: white;
    }
}
