/* Estilos base y resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #8CD9FF, #5EAEFD);
    min-height: 100vh;
    color: #2c3e50;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Estilos del título principal */
.page-title {
    color: #fff;
    text-align: center;
    font-size: 2.5rem;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Dashboard principal */
.hotel-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    backdrop-filter: blur(10px);
}

/* Sección de lista de estancias */
.stays-list {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: 700px;
    display: flex;
    flex-direction: column;
}

.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

#stay-search {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#stay-search:focus {
    outline: none;
    border-color: #5EAEFD;
    box-shadow: 0 0 0 3px rgba(94, 174, 253, 0.2);
    background: #fff;
}

#add-stay-btn {
    background: #5EAEFD;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

#add-stay-btn:hover {
    background: #4a9fe8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(94, 174, 253, 0.3);
}

/* Lista de estancias */
#stays-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
}

.stay-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    position: relative;
}

.stay-item:hover {
    background: #fff;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-color: #5EAEFD;
}

/* Modal de Nueva Estancia */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 800px;
    margin: 30px auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h2 {
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
    font-size: 1.5rem;
}

.close {
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: #eee;
    color: #333;
}

.modal-body {
    padding: 30px;
}

/* Formulario mejorado */
.grid-form {
    display: grid;
    gap: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5EAEFD;
    box-shadow: 0 0 0 3px rgba(94, 174, 253, 0.2);
    background: #fff;
}

/* Select2 personalizado */
.select2-container--default .select2-selection--single {
    height: 48px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
    background: #f8f9fa;
}

.select2-container--default .select2-selection--single:focus {
    border-color: #5EAEFD;
    box-shadow: 0 0 0 3px rgba(94, 174, 253, 0.2);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
}

.select2-dropdown {
    border: 2px solid #5EAEFD;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Secciones del formulario */
.dates-section,
.services-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 15px 0;
}

.totals-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
    padding: 20px;
    background: #f1f7fe;
    border-radius: 12px;
}

/* Grupos de entrada con símbolos */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    background: #e9ecef;
    border: 2px solid #e0e0e0;
    border-right: none;
    padding: 12px 15px;
    border-radius: 12px 0 0 12px;
    color: #495057;
    font-weight: 500;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group input {
    border-radius: 0 12px 12px 0;
    border-left: none;
}

/* Botones de acción */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: #5EAEFD;
    color: white;
}

.btn-primary:hover {
    background: #4a9fe8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(94, 174, 253, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

/* Campos de solo lectura */
input[readonly] {
    background: #f1f7fe;
    cursor: not-allowed;
    border-color: #e0e0e0;
    color: #495057;
}

/* Notificaciones mejoradas */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: #4CAF50;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #5EAEFD;
}

/* Loading indicator mejorado */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1200;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #5EAEFD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive mejorado */
@media (max-width: 992px) {
    .hotel-dashboard {
        grid-template-columns: 1fr;
    }
    
    .stays-list,
    .stay-details {
        height: auto;
        min-height: 500px;
    }

    .modal-content {
        width: 95%;
        margin: 15px auto;
    }

    .dates-section,
    .services-section,
    .totals-section {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #5EAEFD;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a9fe8;
}

/* Detalles de la estancia */
.stay-details {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: 700px;
    overflow-y: auto;
}

.stay-details h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Estilos para el área de observaciones */
textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Poppins', sans-serif;
}

/* Botones de acción en los detalles */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: #2c3e50;
    background: #f1f3f5;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-button i {
    font-size: 1rem;
}

/* Estilos específicos para cada botón */
.btn-edit {
    background: #e9ecef;
    color: #495057;
}

.btn-edit:hover {
    background: #dee2e6;
}

.btn-payment {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-payment:hover {
    background: #bbdefb;
}

.btn-invoice {
    background: #f8f9fa;
    color: #343a40;
}

.btn-invoice:hover {
    background: #e9ecef;
}

/* Mejoras para el selector de mascota */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 48px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #2c3e50;
    line-height: 48px;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    width: 30px;
    right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #5EAEFD transparent transparent transparent;
    border-width: 6px 6px 0 6px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #5EAEFD transparent;
    border-width: 0 6px 6px 6px;
}

.select2-dropdown {
    border: 2px solid #5EAEFD;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    overflow: hidden;
}

.select2-search--dropdown {
    padding: 10px;
}

.select2-search--dropdown .select2-search__field {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #5EAEFD;
}

.select2-results__option {
    padding: 10px 15px;
    font-size: 0.95rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #5EAEFD;
}

/* Estilo para los botones de acción en Detalles de la Estancia */
.stay-details .btn {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stay-details .btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stay-details .btn i {
    font-size: 1rem;
}