/**
 * Estilos para el área pública del plugin Newtourvis
 */

/* Contenedor principal */
.newtourvis-hotels-container {
    margin: 5px auto;
    font-family: inherit;
    max-width: 100%;
    width: 100%;
}

/* Header centrado */
.newtourvis-header {
    text-align: center;
    margin-bottom: 30px;
}

.newtourvis-header h2 {
    margin-bottom: 20px;
    font-size: 28px;
    color: #f0f0f0;
}

/* Wrapper del formulario de búsqueda para centrarlo */
.newtourvis-search-wrapper {
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Formulario de búsqueda centrado con márgenes del 25% */
.newtourvis-search-form {
    width: 1200px !important;
    margin: 0 0% !important;
    padding: 25px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.newtourvis-search-form form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.newtourvis-search-form .form-group {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.newtourvis-search-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.newtourvis-search-form input[type="text"]{
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}
.newtourvis-search-form input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.newtourvis-search-form input[type="text"]:focus,
.newtourvis-search-form input[type="date"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.newtourvis-search-form button {
    padding: 12px 25px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 28px;
    min-width: 120px;
}

.newtourvis-search-form button:hover {
    background-color: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Contenedor de sugerencias */
#destino-suggestions {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.destino-suggestion {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.destino-suggestion:hover {
    background-color: #f5f5f5;
}

.destino-suggestion:last-child {
    border-bottom: none;
}

/* Mensaje de no resultados centrado */
.newtourvis-no-results {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: #f0f0f0;
}

/* Contenedor de la lista de hoteles */
.newtourvis-hotels-list {
    width: 100%;
    margin-top: 30px;
}

/* Wrapper de la tabla para scroll horizontal con columnas fijas */
.newtourvis-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: white;
    position: relative;
}

/* Tabla de hoteles - máximo ancho */
.newtourvis-hotels-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 14px;
    background-color: white;
}

.newtourvis-hotels-table th,
.newtourvis-hotels-table td {
    padding: 15px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

/* Estilos para columnas (sin sticky) */
.newtourvis-hotels-table th.fixed-col,
.newtourvis-hotels-table td.fixed-col {
    background-color: white;
}

.newtourvis-hotels-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    color: #333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0073aa;
}

.newtourvis-hotels-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.newtourvis-hotels-table tbody tr:hover {
    background-color: #f1f8ff;
    transition: background-color 0.2s ease;
}

.newtourvis-hotels-table td {
    border-right: 1px solid #e0e0e0;
    white-space: nowrap;
}

.newtourvis-hotels-table td:last-child {
    border-right: none;
}

/* Botón Solicitar Oferta */
.btn-solicitar-oferta {
    background-color: #007cba !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important; 
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s ease !important; 
}

.btn-solicitar-oferta:hover {
    background-color: #005a87;
}

/* Modal de solicitud de oferta */
.newtourvis-modal {
    display: none !important;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.newtourvis-modal.show {
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.newtourvis-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 20px;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.newtourvis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.newtourvis-modal-header h3 {
    margin: 0;
    color: #007cba;
    font-size: 24px;
}

.newtourvis-modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.newtourvis-modal-close:hover,
.newtourvis-modal-close:focus {
    color: #000;
}

.newtourvis-modal-body {
    margin-bottom: 20px;
}

.newtourvis-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.newtourvis-form-group {
    display: flex;
    flex-direction: column;
}

.newtourvis-form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.newtourvis-form-group input,
.newtourvis-form-group textarea {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f9f9f9;
}

.newtourvis-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.newtourvis-modal-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-enviar-solicitud {
    background-color: #007cba !important;
    color: white !important;;
    border: none !important;;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-enviar-solicitud:hover {
    background-color: #218838;
}

.btn-enviar-solicitud:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Loading spinner */
.newtourvis-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .newtourvis-search-form {
        width: 70%;
        margin: 0 15%;
        padding: 20px;
    }
    
    .newtourvis-search-form form {
        gap: 15px;
    }
}

@media screen and (max-width: 768px) {
    .newtourvis-hotels-container {
        margin: 10px auto;
    }
    
    .newtourvis-header h2 {
        font-size: 24px;
    }
    
    .newtourvis-search-wrapper {
        margin-bottom: 30px;
    }
    
    .newtourvis-search-form {
        width: 90%;
        margin: 0 5%;
        padding: 15px;
    }
    
    .newtourvis-search-form form {
        flex-direction: column;
        gap: 15px;
    }
    
    .newtourvis-search-form .form-group {
        width: 100%;
        min-width: auto;
    }
    
    .newtourvis-search-form button {
        margin-top: 10px;
        width: 100%;
    }
    
    .newtourvis-table-wrapper {
        margin: 0 5px;
        border-radius: 6px;
    }
    
    .newtourvis-hotels-table {
        min-width: 800px;
    }
    
    .newtourvis-hotels-table th,
    .newtourvis-hotels-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .newtourvis-search-form {
        width: 95%;
        margin: 0 2.5%;
        border-radius: 6px;
    }
    
    .newtourvis-table-wrapper {
        margin: 0;
        border-radius: 4px;
    }
    
    .newtourvis-hotels-table th,
    .newtourvis-hotels-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
}
