/* eVoost Datatables - Frontend Styles */

/* Wrapper principal */
.evoost-dt-wrapper {
    margin: 20px 0;
}

/* Tabla principal */
.residences-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 30px !important;
}

.residences-table th,
.residences-table td {
    padding: 15px !important;
    text-align: left !important;
    border-bottom: 1px solid #eee !important;
}

.residences-table th {
    background-color: #f8f9fa !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

.residences-table tr:hover {
    background-color: #f8f9fa !important;
}

.residences-table .price {
    font-weight: 700 !important;
    color: #1E3A8A !important;
}

/* Estados */
.residences-table .status {
    font-weight: 600 !important;
    padding: 5px 10px !important;
    border-radius: 50px !important;
    font-size: 0.8rem !important;
    display: inline-block !important;
    text-align: center !important;
    min-width: 100px !important;
}

.residences-table .status.available {
    background-color: #dcf5e6 !important;
    color: #0c6b39 !important;
}

.residences-table .status.reserved {
    background-color: #fff2cc !important;
    color: #856404 !important;
}

.residences-table .status.reservados {
    background-color: #ffacac !important;
    color: #000000 !important;
}

.residences-table .status.sold {
    background-color: #fde0e0 !important;
    color: #9b2c2c !important;
}

/* Mensaje de propiedades restantes */
.evoost-remaining-message {
    text-align: center !important;
    font-size: 0.85rem !important;
    color: #666666 !important;
    margin-top: -15px !important;
    margin-bottom: 25px !important;
    font-style: italic !important;
}

/* Nota */
.residences-note {
    padding: 20px !important;
    background-color: #f8f9fa !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: #555 !important;
    margin-top: 20px !important;
}

/* Responsive wrapper */
.table-wrapper {
    max-width: 900px !important;
    margin: 0 auto !important;
}

/* Responsive - Tablets */
@media (max-width: 992px) {
    .residences-table th,
    .residences-table td {
        padding: 12px 10px !important;
        font-size: 0.9rem !important;
    }
    
    .residences-table .status {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
        min-width: 80px !important;
    }
    
    .evoost-remaining-message {
        font-size: 0.8rem !important;
    }
}

/* Responsive - Móviles */
@media (max-width: 768px) {
    .residences-table th,
    .residences-table td {
        padding: 10px 8px !important;
        font-size: 0.85rem !important;
    }
    
    .residences-table .status {
        padding: 3px 6px !important;
        font-size: 0.7rem !important;
        min-width: 70px !important;
    }
    
    .residences-table td.price {
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
    
    .evoost-remaining-message {
        font-size: 0.75rem !important;
        margin-top: -10px !important;
        margin-bottom: 20px !important;
    }
}

/* Responsive - Móviles pequeños */
@media (max-width: 480px) {
    .table-scroll-hint {
        display: block !important;
        text-align: center !important;
        font-size: 0.8rem !important;
        color: #666 !important;
        margin-bottom: 10px !important;
        font-style: italic !important;
    }
    
    .residences-table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .residences-table th,
    .residences-table td {
        padding: 8px 6px !important;
        font-size: 0.8rem !important;
    }
    
    .residences-table th:nth-child(1),
    .residences-table td:nth-child(1) {
        width: 40px !important;
    }
    
    .residences-table th:nth-child(3),
    .residences-table td:nth-child(3) {
        width: 60px !important;
    }
    
    .residences-table .status {
        padding: 2px 4px !important;
        font-size: 0.65rem !important;
        min-width: 60px !important;
    }
    
    .evoost-remaining-message {
        font-size: 0.7rem !important;
    }
}

/* Ocultar mensaje de ayuda en pantallas grandes */
@media (min-width: 481px) {
    .table-scroll-hint {
        display: none !important;
    }
}

/* Utilidades */
.evoost-dt-wrapper.center {
    text-align: center;
}

.evoost-dt-wrapper.full-width .table-wrapper {
    max-width: 100% !important;
}

/* Tema oscuro */
.evoost-dt-wrapper.dark-theme .residences-table {
    background-color: #2d2d2d;
    color: #ffffff;
}

.evoost-dt-wrapper.dark-theme .residences-table th {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

.evoost-dt-wrapper.dark-theme .residences-table tr:hover {
    background-color: #3d3d3d !important;
}

.evoost-dt-wrapper.dark-theme .residences-note {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

.evoost-dt-wrapper.dark-theme .evoost-remaining-message {
    color: #999999 !important;
}

/* Modal de planos */
.evoost-floor-plan-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
}

.evoost-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
}

.evoost-modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 90% !important;
    max-height: 90% !important;
    background-color: transparent !important;
}

.evoost-modal-close {
    position: absolute !important;
    top: -40px !important;
    right: -40px !important;
    color: #fff !important;
    font-size: 35px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    background-color: transparent !important;
    border: none !important;
    padding: 5px 10px !important;
    line-height: 1 !important;
    z-index: 10 !important;
}

.evoost-modal-close:hover {
    color: #FED56F !important;
}

.evoost-modal-body {
    text-align: center !important;
}

.evoost-modal-body img {
    max-width: 100% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8) !important;
}

/* Enlaces de planos */
.evoost-floor-plan-link {
    color: #1E3A8A !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: color 0.3s ease !important;
}

.evoost-floor-plan-link:hover {
    color: #152a66 !important;
    text-decoration: underline !important;
}

/* Responsive para modal */
@media (max-width: 768px) {
    .evoost-modal-close {
        top: 10px !important;
        right: 10px !important;
        background-color: rgba(0, 0, 0, 0.7) !important;
        border-radius: 50% !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 25px !important;
        z-index: 100 !important;
    }
    
    .evoost-modal-content {
        max-width: 100% !important;
        max-height: 95% !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .evoost-modal-body {
        width: 100% !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .evoost-modal-body img {
        max-height: 75vh !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        box-shadow: none !important;
        touch-action: none !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
}

/* ========== SOPORTE PARA PDFs EN MODAL ========== */

/* Estilos específicos cuando el modal muestra un PDF */
.evoost-modal-pdf .evoost-modal-content {
    width: 90% !important;
    height: 90% !important;
    max-width: 1200px !important;
    max-height: 90vh !important;
}

.evoost-modal-pdf .evoost-modal-body {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Iframe para PDFs */
#evoost-floor-plan-pdf {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background-color: #ffffff !important;
    flex: 1 !important;
}

/* Loader para PDFs */
.evoost-pdf-loading {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #ffffff !important;
    font-size: 20px !important;
    z-index: 1 !important;
}

/* Ajuste del botón de cerrar para PDFs */
.evoost-modal-pdf .evoost-modal-close {
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 10px !important;
    right: 10px !important;
}

/* Responsive para PDFs */
@media (max-width: 768px) {
    .evoost-modal-pdf .evoost-modal-content {
        width: 95% !important;
        height: 85% !important;
    }
    
    #evoost-floor-plan-pdf {
        height: calc(100% - 20px) !important;
    }
}

/* Mensaje de error para PDFs no soportados */
.evoost-pdf-error {
    text-align: center !important;
    padding: 40px !important;
    color: #ffffff !important;
}

.evoost-pdf-error a {
    color: #FED56F !important;
    text-decoration: underline !important;
}