/* --- RESET BÁSICO Y ESTILOS GENERALES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

/* --- ESTILOS PARA FORMULARIOS (Añadir/Editar Propiedad) --- */
form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="password"],
form input[type="number"],
form input[type="date"],
form select,
form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

form textarea {
    resize: vertical;
    min-height: 120px;
}

form button[type="submit"] {
    width: 100%;
    padding: 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Ajuste para el botón dentro del formulario de consulta */
.form-card form button[type="submit"] {
    transition: background-color 0.3s ease;
}

form button[type="submit"]:hover {
    background-color: #2980b9;
}

/* --- ESTILOS PARA LA TABLA (Listado de Propiedades) --- */
.btn-anadir {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-anadir:hover {
    background-color: #27ae60;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border-bottom: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

thead th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

.clickable-row {
    cursor: pointer;
}

.list-thumb {
    width: 120px;  /* Ancho fijo para la miniatura */
    height: 75px;  /* Alto fijo para la miniatura */
    object-fit: cover; /* Esto es clave: recorta la imagen para que llene el espacio sin deformarse */
    border-radius: 4px;
    vertical-align: middle; /* Alinea la imagen correctamente con el texto de la fila */
}

.acciones a {
    margin-right: 10px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: white;
}

.btn-share { background-color: #3498db; }
.btn-share:hover { background-color: #2980b9; }
.btn-valores { background-color: #2ecc71; }
.btn-valores:hover { background-color: #27ae60; }
.btn-editar { background-color: #f39c12; }
.btn-editar:hover { background-color: #e67e22; }
.btn-eliminar { background-color: #e74c3c; }
.btn-eliminar:hover { background-color: #c0392b; }

/* --- RESPONSIVE DESIGN (La magia para celulares) --- */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    /* Transformamos la tabla en tarjetas para móviles */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
        margin-bottom: 15px;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%; /* Espacio para el título de la columna */
        text-align: right;
    }

    td:before {
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label); /* ¡Aquí está el truco! */
    }

    /* Ajuste para la celda de la imagen en móvil */
    td:has(> .list-thumb) {
        display: flex;
        justify-content: flex-end; /* Alinea la imagen a la derecha */
    }

    .acciones {
        text-align: center;
    }
    .acciones a {
        display: inline-block;
        margin-top: 10px;
    }

    /* Ajuste para el dropdown de notificaciones en móvil */
    .notification-dropdown {
        right: auto; /* Desactivamos el alineamiento a la derecha */
        left: -0px; /* Lo movemos hacia la izquierda */
        width: 300px; /* Le damos un ancho fijo */
    }
}

/* --- ESTILOS MEJORADOS PARA EL PANEL DE CONTROL --- */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.panel-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    border-top: 4px solid #3498db; /* Acento de color */
    padding: 25px;
    text-decoration: none;
    color: #495057;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.panel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.panel-card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #3498db;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.panel-card p {
    flex-grow: 1; /* Empuja el texto hacia abajo si las tarjetas tienen alturas diferentes */
    font-size: 0.95rem;
    line-height: 1.5;
}

.panel-card .icon {
    font-style: normal;
    margin-right: 12px;
    font-size: 2rem; /* Icono más grande */
    line-height: 1;
}

/* --- Estilos para la manija de arrastre (drag handle) --- */
.panel-card .drag-handle {
    display: none; /* Oculto por defecto */
    margin-left: auto; /* Empuja el handle a la derecha del h2 */
    font-size: 1.2em;
    cursor: grab;
    padding: 5px 10px;
    color: #999;
    background-color: #f0f0f0;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    touch-action: none; /* Crucial para móviles: evita el scroll al intentar arrastrar */
}
.panel-card .drag-handle:hover {
    background-color: #e0e0e0;
    color: #555;
}
.panel-grid.sortable-active .panel-card .drag-handle {
    display: inline-block; /* Mostrar cuando el modo de edición está activo */
}

.panel-card.disabled {
    background-color: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    border-top-color: #dee2e6;
}

.panel-card.disabled h2 {
    color: #adb5bd;
}
/* Cuando el modo de edición está activo, el cursor de la tarjeta no debe ser "grab" */
.panel-grid.sortable-active .panel-card {
    cursor: default; /* Permite el scroll normal en el resto de la tarjeta */
    border-top-color: #f39c12; /* Mantiene el acento visual */
}

/* --- ESTILOS PARA SELECTOR DE IDIOMA --- */
.lang-switcher a {
    text-decoration: none;
    color: #3498db;
    font-weight: bold;
    padding: 0 5px;
}
.lang-switcher a.active {
    color: #2c3e50;
    text-decoration: underline;
}

/* --- ESTILOS PARA PÁGINAS DE AUTENTICACIÓN (Login/Registro) --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.auth-container h1 {
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 25px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

/* --- ESTILO PARA BOTÓN DE VOLVER --- */
.btn-volver {
    display: inline-flex; /* Para alinear ícono y texto */
    align-items: center;
    gap: 8px; /* Espacio entre ícono y texto */
    padding: 8px 15px;
    background-color: #f0f3f5; /* Gris claro, consistente con los inputs */
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.btn-volver:hover {
    background-color: #e9ecef;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

/* --- ESTILOS PARA NOTIFICACIONES --- */
.notification-bell {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.notification-bell #bell-icon {
    font-size: 1.5rem;
    color: #555;
    text-decoration: none;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid white;
}

.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background-color: white;
    min-width: 320px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 10px 15px;
    font-weight: bold;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.notification-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f1f1f1;
}
.notification-item:hover { background-color: #f9f9f9; }
.notification-item.unread { background-color: #e9f5ff; }
.notification-item p { margin: 0; font-size: 0.9rem; }
.notification-item small { color: #777; font-size: 0.8rem; }

.notification-footer {
    padding: 10px 15px;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}
.notification-footer a {
    text-decoration: none;
    color: #3498db;
    font-weight: bold;
}

/* --- ESTILOS PÁGINA DE NOTIFICACIONES --- */
.search-form {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}
.search-form input {
    flex-grow: 1;
}
.search-form button {
    padding: 0 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.notifications-list {
    margin-top: 20px;
}

.notification-full-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    margin-bottom: 10px;
    background-color: white;
}
.notification-full-item.unread {
    background-color: #e9f5ff;
    border-left: 4px solid #3498db;
}

.notification-content {
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
}
.notification-content p { margin: 0; }
.notification-content small { color: #777; }

.btn-eliminar-notif {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin-left: 15px;
    transition: background-color 0.2s ease;
}
.btn-eliminar-notif:hover {
    background: #c0392b;
}

/* --- Animación de pulso para notificaciones --- */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.notification-bell .has-unread {
    animation: pulse 1.5s infinite;
}

/* --- ESTILOS PARA MODAL DE CONSENTIMIENTO --- */
.page-content.blurred {
    filter: blur(5px);
    transition: filter 0.3s ease-in-out;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    color: #2c3e50;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* --- ESTILOS PARA PÁGINA DE CHAT CLIENTE --- */
.chat-simulation {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.message-bubble {
    background-color: #e9f5ff;
    padding: 15px;
    border-radius: 15px;
    margin-top: 20px;
    max-width: 80%;
    display: inline-block;
    text-align: left;
}
.message-bubble p {
    margin: 0;
}
.message-bubble small {
    display: block;
    text-align: right;
    color: #888;
    margin-top: 5px;
}

/* --- ESTILOS PARA LA PÁGINA DE CHAT --- */
.chat-container {
    max-width: 800px;
    height: calc(100vh - 40px);
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.chat-header .btn-volver {
    margin-right: 15px;
    font-size: 1.5em;
    text-decoration: none;
    color: #555;
}

.chat-header-info h2 {
    margin: 0;
    font-size: 1.2em;
    color: #2c3e50;
}

.chat-header-info p {
    margin: 0;
    font-size: 0.9em;
    color: #7f8c8d;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f4f7f6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages .message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
}

.chat-messages .message-bubble.sent {
    background-color: #3498db;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-messages .message-bubble.sent small {
    color: #ecf0f1;
}

.chat-messages .message-bubble.received {
    background-color: #e9ecef;
    color: #34495e;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

.chat-input-area form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input-area textarea {
    flex-grow: 1;
    resize: none;
    border-radius: 20px;
    padding: 10px 15px;
    border: 1px solid #ccc;
    min-height: 42px;
    max-height: 100px;
}

.chat-input-area button {
    background-color: #3498db;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-input-area button:disabled {
    background-color: #bdc3c7;
}

/* Enlace para login en formulario de consulta */
.toggle-login-form {
    text-align: center;
    margin-top: 15px;
}

/* --- ESTILOS PARA PLAN DE PAGOS PÚBLICO --- */
.payment-plan-public {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.payment-plan-public h4 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 15px;
}

.payment-plan-public table {
    width: 100%;
    border-collapse: collapse;
}

.payment-plan-public th, .payment-plan-public td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.payment-plan-public th {
    background-color: #f8f9fa;
}

/* --- ESTILOS PARA EL SELECTOR DE PAÍS (INTL-TEL-INPUT) --- */
.iti {
    width: 100%;
    margin-bottom: 20px;

}

/* --- ESTILOS PARA EL MENÚ MÓVIL (HAMBURGUESA) --- */
@media (max-width: 768px) {
    .main-nav a { display: block; }
}

/* --- ESTILOS PARA LOGO DE FUENTE --- */
.current-logo-section {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
    text-align: center;
}
.logo-preview {
    max-width: 150px;
    max-height: 100px;
    height: auto;
    margin-bottom: 10px;
}
            