/* General Body and HTML */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif; /* Using Inter font */
    background-color: #f8f9fa; /* Light background for the whole page */
    color: #343a40; /* Default text color */
}

/* Navbar adjustments */
.navbar {
    transition: background-color 0.3s ease-in-out;
    backdrop-filter: blur(5px); /* Efecto blur */
    background-color: rgba(33, 37, 41, 0.7) !important; /* Fondo oscuro semi-transparente */
}

.navbar.scrolled {
    background-color: rgba(33, 37, 41, 0.9) !important; /* Más opaco al hacer scroll */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.navbar-brand .fw-bold {
    font-weight: 700 !important;
}


/* Hero Section with Background Image */
.hero-background {
    position: relative;
    width: 100%;
    height: 50vh; 
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    background-image: url('/static/img/banners/hero_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay for text readability */
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    max-width: 900px;
    text-align: center;
}

.hero-content h1 {
    font-size: 1.5rem; /* Tamaño de letra H1 mantenido */
    margin-bottom: 1rem;
}

.hero-content p.lead {
    font-size: 1.1rem; /* Tamaño de letra subtítulo mantenido */
    margin-bottom: 2rem;
}


/* Custom Buttons for Hero Section */
.custom-btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    padding: 12px 30px;
    font-size: 1.25rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.custom-btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.custom-btn-outline {
    border-color: #ffffff;
    color: #ffffff;
    padding: 12px 30px;
    font-size: 1.25rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.custom-btn-outline:hover {
    background-color: rgba(255,255,255,0.2);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.container h2.text-primary {
    font-size: 1.5rem; /* CAMBIO: Tamaño de letra más pequeño */
    color: #343a40 !important; /* CAMBIO: Color negro (tu color de texto por defecto) */
}



/* Property Cards on Index Page */
.property-card {
    border: none;
    background-color: #ffffff;
    box-shadow: 5px 8px 15px rgba(0,0,0,0.50);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.property-card:hover {
    transform: scale(1.03);
    box-shadow: 8px 12px 25px rgba(0,0,0,0.5);
}

.property-img {
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.property-location-text {
    font-size: 1.1rem;
}

.card-text.text-muted {
    font-size: 0.9rem;
}

.card-text.text-dark {
    color: #212529 !important;
    font-size: 1.2rem !important;
    font-weight: bold;
}

.custom-detail-btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}


/* Property Detail Page */
.property-detail-img {
    max-height: 500px;
    object-fit: contain;
    width: 100%;
}

/* Form Styling (Add/Edit Property) */
.form-label {
    font-weight: 600;
    color: #495057;
}


/* --- REGLAS AÑADIDAS/MODIFICADAS PARA LA VALIDACIÓN DE FORMULARIOS (ESTAS SÍ SE MANTIENEN) --- */
/* Estas reglas son para el estado de error y el mensaje de error, no para el estilo base del input */
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #dc3545; /* Color rojo para borde inválido */
    padding-right: calc(1.5em + 0.75rem); /* Espacio para el icono de validación */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e"); /* Icono de error */
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block; /* Asegura que el mensaje de error siempre se muestre */
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545; /* Color rojo para el texto del error */
}
/* --- FIN DE REGLAS DE VALIDACIÓN --- */

/* Estilos para formularios de autenticación (Registrarse e Iniciar Sesión) */
.auth-form-container {
    max-width: 500px; /* Ancho máximo para el formulario */
    margin: 50px auto; /* Centra el formulario y le da un margen superior/inferior */
    padding: 2.5rem; /* Relleno interno para que no esté pegado al borde */
    border: 1px solid #dee2e6; /* Borde sutil */
    border-radius: 0.5rem; /* Bordes redondeados */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); /* Sombra ligera */
    background-color: #fff; /* Fondo blanco */
}

/* Ajuste responsivo para pantallas más pequeñas */
@media (max-width: 768px) {
    .auth-form-container {
        max-width: 90%; /* En pantallas pequeñas, ocupa el 90% del ancho */
        margin: 30px auto; /* Reduce el margen superior/inferior en móviles */
        padding: 1.5rem; /* Reduce el relleno */
    }
}

/* Footer */
footer {
    background-color: #212529;
    color: #f8f9fa;
}

.social-icons a {
    font-size: 1.5rem;
    margin: 0 10px;
    color: #f8f9fa;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #007bff;
}

/* Botón Flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.whatsapp-float i {
    margin-top: 0;
}

.whatsapp-float:hover {
    background-color: #1da851;
    transform: scale(1.05);
    color: #FFF;
}

/* Sección "Síguenos en Redes Sociales" */
.social-follow-section {
    background-color: #f8f9fa;
    padding: 60px 0;
    border-bottom: 1px solid #e9ecef;
}

/* Contenedor principal para la imagen y el contenido superpuesto */
.social-image-wrapper {
    position: relative;
    max-width: 800px; /* VUELTO AL ANCHO ORIGINAL para la imagen de redes sociales */
    margin: 0 auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-radius: 15px;
    overflow: hidden;
}

.social-promo-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Contenedor para el título y los iconos superpuestos */
.social-overlay-content {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: transparent;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    max-width: 50%;
    box-sizing: border-box;
}

.social-section-title-overlay {
    font-size: 1.5rem;
    color: #000 !important;
    margin-bottom: 15px;
    text-shadow: none;
    white-space: nowrap;
}

.social-icons-overlay {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Estilos de los iconos dentro del overlay */
.social-icons-overlay .social-icon-large {
    width: 45px;
    height: 45px;
    font-size: 22px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-icons-overlay .social-icon-large:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Colores de fondo para los iconos de redes sociales */
.whatsapp-bg { background-color: #25d366; }
.facebook-bg { background-color: #1877f2; }
.youtube-bg { background-color: #ff0000; }
.tiktok-bg { background-color: #000000; }
.instagram-bg {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}



/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1rem;
    }
    .hero-content p.lead {
        font-size: 1rem;
    }
    .custom-btn-primary, .custom-btn-outline {
        padding: 10px 20px;
        font-size: 1rem;
    }
    .property-img {
        height: 180px;
    }
    .card-title {
        font-size: 1.2rem;
    }
    .card-text.text-success {
        font-size: 1.4rem !important;
    }
    .property-location-text {
        font-size: 0.95rem;
    }



    /* Ajuste para el botón flotante en móviles */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }



    /* Ajustes para la sección de redes sociales en móviles */
    .social-image-wrapper {
        max-width: 100%;
        border-radius: 0;
    }
    .social-overlay-content {
        padding: 10px;
        max-width: 70%;
        border-radius: 0;
    }
    .social-section-title-overlay {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    .social-icons-overlay .social-icon-large {
        width: 35px;
        height: 35px;
        font-size: 18px;
        gap: 8px;
    }
}



/* Estilos para Mensajes Flash Fijos */
.flash-messages-container {
    position: fixed;
    top: 65px; /* Ajusta la distancia desde la parte superior */
    /* Eliminamos left: 0; y width: 100%; del contenedor principal */
    right: 20px; /* CAMBIO: Lo posiciona a 20px del borde derecho */
    z-index: 1050;
    pointer-events: none;
}

.flash-messages-container .alert {
    pointer-events: auto;
    /* CAMBIO: Eliminamos margin-left: auto; y margin-right: auto; */
    max-width: 300px; /* CAMBIO: Reduce el ancho máximo, hazlo menos largo */
    width: auto; /* CAMBIO: Ajusta el ancho automáticamente según el contenido, pero limitado por max-width */
    margin-left: auto; /* Alinea el alerta a la derecha dentro de su contenedor si el contenedor fuera más grande */
    margin-right: 0; /* Asegura la alineación a la derecha */
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

/* Ajuste para pantallas pequeñas */
@media (max-width: 576px) {
    .flash-messages-container {
        right: 5px; /* Un poco menos margen a la derecha en móviles */
        top: 70px; /* Ajuste si el navbar es más pequeño en móviles */
    }
    .flash-messages-container .alert {
        max-width: 90%; /* Se adapta a un 90% del ancho de la pantalla en móviles */
    }
}

/* Estilos para Carrusel de Imágenes en Detalle de Propiedad */
.property-carousel-img {
    max-height: 400px; /* CAMBIO: Altura máxima para las imágenes del carrusel */
    object-fit: contain; /* CAMBIO: Asegura que la imagen completa sea visible, manteniendo su relación de aspecto */
    width: 100%; /* Asegura que ocupe todo el ancho disponible */
}

/* Mejorar visibilidad de botones del carrusel */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5); /* Fondo semitransparente para los iconos */
    padding: 1.2rem; /* Aumenta el área del icono para que sea más fácil de ver/clicar */
    border-radius: 0.5rem; /* Bordes redondeados */
}

.carousel-control-prev,
.carousel-control-next {
    width: auto; /* Ajusta el ancho del botón al tamaño del icono */
    opacity: 0.8; /* Ligeramente transparente cuando no se pasa el ratón */
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1; /* Completamente opaco al pasar el ratón */
}

/* Ajustes responsivos para el carrusel */
@media (max-width: 768px) {
    .property-carousel-img {
        max-height: 300px; /* CAMBIO: Menor altura en móviles */
        object-fit: contain;
    }
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        padding: 1rem; /* Menor padding en móviles */
    }
}


/* Este estilo bajará el bloque de paginación */
.pagination {
    margin-top: 2rem; /* El valor 2rem es equivalente a 32px y es una buena práctica para el espaciado en la web. */
}