/* --- Estilos Globais --- */
html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f7f7;
    color: #2f4f4f;
    display: flex;
    flex-direction: column;
}

body.is-dragging-something {
    user-select: none;
}

#app-container {
    flex-grow: 1;
}

/* --- Cores Primárias --- */
.bg-primary-teal {
    background-color: rgb(20, 97, 79);
}

.text-primary-teal {
    color: rgb(20, 97, 79);
}

/* --- Botões --- */
.btn-primary-teal {
    background-color: rgb(20, 97, 79);
    color: white;
    transition: background-color 0.3s;
}

.btn-primary-teal:hover {
    background-color: rgb(15, 77, 63);
}

/* --- Links --- */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* --- Visibilidade --- */
.hidden {
    display: none;
}

/* --- Navegação --- */
.nav-link {
    color: #f1f5f9;
    transition: color 0.3s;
    position: relative;
    padding-bottom: 5px;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #cbd5e1;
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after,
.nav-link-active::after {
    width: 100%;
}

/* --- Carrossel Principal e Destaque --- */
#oportunidade-image-container,
#carousel-container {
    aspect-ratio: 16 / 9;
    /* MODIFICAÇÃO: Proporção widescreen padrão para mobile */
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

/* MODIFICAÇÃO: Removida a margem inferior */
#oportunidade-image-container {
    margin-bottom: 0;
}


#oportunidade-image-container img,
.carousel-slide img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.carousel-slide {
    will-change: transform;
}

.carousel-slide>div {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 18px;
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* --- Estilos de Cards --- */
.card-shadow {
    border-radius: 12px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(20, 97, 79, 0.1);
}

.card-hover {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(20, 97, 79, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(20, 97, 79, 0.15), 0 3px 6px rgba(20, 97, 79, 0.1);
}

.home-card-image {
    height: 224px;
    object-fit: cover;
}

/* --- Estilos de Inputs e Formulários --- */
input,
textarea,
select {
    transition: all 0.2s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(20, 97, 79, 0.2);
    border-color: rgb(20, 97, 79);
    outline: none;
}

/* --- Dropdown de Busca --- */
.search-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 50;
    width: 300px;
    padding: 8px;
    margin-top: 4px;
}

.search-dropdown-options {
    max-height: 200px;
    overflow-y: auto;
}

.search-dropdown-options label {
    color: #2f4f4f;
}

/* --- Galeria de Miniaturas (Thumbnails) --- */
#detail-thumbnail-gallery {
    will-change: transform;
}

.thumbnail {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    opacity: 0.6;
    flex-shrink: 0;
}

.thumbnail:hover {
    opacity: 1;
}

.thumbnail.active {
    opacity: 1;
    border-color: rgb(20, 97, 79);
}

#page-imovel #detail-caracteristicas {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* --- Carrossel da Home Page --- */
#home-lancamentos,
#home-vendas,
#home-casas,
#home-terrenos,
#home-aluguel {
    will-change: transform;
}

.home-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #2f4f4f;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    padding: 10px;
    font-size: 16px;
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.home-carousel-btn:hover {
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.home-carousel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Paginação --- */
.pagination-btn {
    cursor: pointer;
}

.pagination-btn.active {
    background-color: rgb(20, 97, 79);
    color: white;
    border-color: rgb(20, 97, 79);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Botões de Visualização (Grade/Lista) --- */
.view-btn.active {
    background-color: rgb(20, 97, 79);
    color: white;
    border-color: rgb(20, 97, 79);
}

/* --- Estilos para Carrossel Arrastável --- */
.grab-cursor {
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.grab-cursor.dragging {
    cursor: grabbing;
}

/* NOVOS ESTILOS PARA FORMULÁRIO 'ANUNCIAR' */
.form-legend {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600; /* font-semibold */
    color: #374151; /* text-gray-700 */
    border-bottom: 2px solid rgb(20, 97, 79); /* border-primary-teal */
    padding-bottom: 0.5rem; /* pb-2 */
    margin-bottom: 1.5rem; /* mb-6 */
    width: 100%;
}

.form-input-styled {
    display: block;
    width: 100%;
    padding: 0.75rem; /* p-3 */
    font-size: 1rem;
    color: #1f2937; /* text-gray-800 */
    background-color: #f9fafb; /* bg-gray-50 */
    border: 2px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.5rem; /* rounded-lg */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input-styled:focus {
    border-color: rgb(20, 97, 79); /* focus:border-primary-teal */
    box-shadow: 0 0 0 3px rgba(20, 97, 79, 0.2);
    outline: none;
}

/* --- Media Queries para Responsividade --- */

/* Telas de tablet e maiores (>= 768px) */
@media (min-width: 768px) {

    #oportunidade-image-container,
    #carousel-container {
        height: 500px;
        aspect-ratio: auto;
        /* MODIFICAÇÃO: Reseta aspect-ratio para usar a altura fixa */
    }

    #page-imovel #detail-caracteristicas {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* Telas de celular (< 767px) */
@media (max-width: 767px) {
    .home-carousel-btn.prev {
        left: 5px;
    }

    .home-carousel-btn.next {
        right: 5px;
    }
}

.home-carousel-btn.prev {
    left: -20px;
}

.home-carousel-btn.next {
    right: -20px;
}
