/* ============================================== */
/* --- ARQUIVO STYLE.CSS - VERSÃO FINAL --- */
/* ============================================== */

/* --- GLOBAIS E VARIÁVEIS DE COR --- */
:root {
    --cor-primaria: #5e35b1; /* Roxo moderno */
    --cor-secundaria: #ffab40; /* Laranja/Âmbar para destaque */
    --cor-fundo: #f4f5f7;
    --cor-texto: #333;
    --cor-texto-claro: #666;
    --cor-branco: #ffffff;
    --sombra-card: 0 4px 15px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    line-height: 1.6;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

h1, h2, h3, h4 {
    color: #1c1e21;
}

a {
    color: var(--cor-primaria);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--cor-secundaria);
    text-decoration: underline;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 30px 0;
}

/* --- CABEÇALHO --- */
.site-header {
    background-color: var(--cor-branco);
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: var(--sombra-card);
}
.site-header .container {
    padding: 0 20px;
}
.logo-container { text-align: center; }
.site-header img { max-height: 45px; width: auto; }

/* --- SEÇÃO HERO E BUSCA --- */
.hero-section {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #7e57c2 100%);
    color: var(--cor-branco);
    padding: 50px 20px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 30px;
}
.hero-section h1 {
    color: var(--cor-branco);
    font-size: 2.5em;
    margin-bottom: 10px;
}
.hero-section p {
    font-size: 1.2em;
    opacity: 0.9;
}
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
}
.search-form input {
    flex: 1 1 300px;
    border: 1px solid transparent;
}
.search-form button {
    flex: 1 1 150px;
    background-color: var(--cor-secundaria);
    font-weight: bold;
}
.search-form button:hover {
    background-color: #ffc107;
}

/* --- BOTÕES E FORMULÁRIOS --- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], textarea, select {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 2px rgba(94, 53, 177, 0.2);
    outline: none;
}
button, .button {
    background-color: var(--cor-primaria);
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1em;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
}
button:hover, .button:hover {
    background-color: #4527a0;
    transform: translateY(-1px);
}
.button-link {
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 8px;
    background-color: #f0f2f5;
    color: var(--cor-texto);
    font-weight: 500;
}
.login-prompt, .user-welcome {
    background-color: var(--cor-branco);
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}


/* --- FILTROS RÁPIDOS (CIDADES E CATEGORIAS) --- */
.filtros-container {
    background: var(--cor-branco);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.cidades-lista, .categorias-lista {
    padding: 10px 0;
    text-align: left;
}
.cidades-lista a, .categorias-lista a {
    display: inline-block;
    padding: 6px 12px;
    margin: 5px;
    background-color: #e9ebee;
    border-radius: 15px;
    font-size: 0.9em;
    color: #333;
    transition: background-color 0.2s, color 0.2s;
}
.cidades-lista a:hover, .categorias-lista a:hover {
    background-color: var(--cor-primaria);
    color: var(--cor-branco);
}

/* --- CARD DE ANÚNCIOS (PÁGINA INICIAL) --- */
.anuncios-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}
.anuncio-card {
    background: var(--cor-branco);
    border-radius: 12px;
    box-shadow: var(--sombra-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--cor-texto);
}
.anuncio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}
.anuncio-card-imagem {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.anuncio-card-corpo {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.anuncio-card-categoria {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--cor-primaria);
    text-transform: uppercase;
    margin-bottom: 5px;
}
.anuncio-card-titulo {
    font-size: 1.2em;
    font-weight: 600;
    margin: 5px 0;
    flex-grow: 1; 
}
.anuncio-card-preco {
    font-size: 1.4em;
    font-weight: bold;
    color: #27ae60; 
    margin: 10px 0;
}
.anuncio-card-local {
    font-size: 0.9em;
    color: var(--cor-texto-claro);
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: auto; 
}


/* --- GALERIA DE ANÚNCIO (ver_anuncio.php) --- */
.anuncio-galeria-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden; 
    box-shadow: var(--sombra-card);
    aspect-ratio: 4 / 3;
    background-color: #f0f2f0;
}
.anuncio-galeria-slide {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}
.anuncio-galeria-slide img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
}
.galeria-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 18px;
    z-index: 10;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.anuncio-galeria-container:hover .galeria-btn {
    opacity: 1;
}
.galeria-btn.prev { left: 15px; }
.galeria-btn.next { right: 15px; }


/* --- ESTILOS PARA CONTADOR E BARRA DE PROGRESSO --- */
#image-counter {
    margin-top: 10px;
    font-weight: bold;
    color: var(--cor-texto-claro);
}
.progress-wrapper {
    width: 100%;
    background-color: #f3f3f3;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 4px;
    margin-top: 15px;
    display: none;
}
.progress-bar {
    width: 0%;
    height: 20px;
    background-color: var(--cor-primaria);
    border-radius: 4px;
    text-align: center;
    color: white;
    line-height: 20px;
    font-weight: bold;
    transition: width 0.4s ease;
}
.progress-text {
    display: block;
    text-align: center;
    font-weight: bold;
    color: var(--cor-texto);
    margin-top: 5px;
}


/* --- BANNER DE COOKIES --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 15px;
}
.cookie-banner-text { flex-grow: 1; min-width: 300px; }
.cookie-banner-text a { color: #3498db; text-decoration: underline; }
.cookie-banner-buttons button { padding: 10px 20px; margin-left: 10px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; width: auto; }
.cookie-banner-buttons button.accept { background-color: #27ae60; color: white; }
.cookie-banner-buttons button.deny { background-color: #f1f1f1; color: #333; }


/* --- OUTROS ESTILOS (PAINEL, ADMIN, CHAT, ETC.) --- */
.actions-container { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-container .button { flex-grow: 1; }
.meus-anuncios-lista .meu-anuncio-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #eee; }
.meu-anuncio-item span { flex-grow: 1; }
.anuncio-acoes a { margin-left: 10px; padding: 5px 10px; border-radius: 4px; color: white; font-size: 0.9em; }
.btn-editar { background-color: #2196F3; }
.btn-excluir { background-color: #f44336; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border: 1px solid #ddd; padding: 8px; text-align: left; }
.admin-table th { background-color: #f2f2f2; }
.admin-msg { border: 1px solid #eee; padding: 10px; margin-bottom: 10px; border-radius: 4px; }
.chat-box { border: 1px solid #ccc; padding: 10px; height: 400px; overflow-y: scroll; margin-bottom: 10px; background: #f9f9f9; }
.minha-mensagem { text-align: right; margin: 5px; padding: 8px 12px; background-color: #dcf8c6; border-radius: 10px; max-width: 70%; margin-left: auto; word-wrap: break-word;}
.outra-mensagem { text-align: left; margin: 5px; padding: 8px 12px; background-color: #fff; border: 1px solid #eee; border-radius: 10px; max-width: 70%; margin-right: auto; word-wrap: break-word;}
.chat-form { display: flex; }
.chat-form input { flex-grow: 1; margin-right: 10px; }
.anuncio-compartilhado { border-top: 1px dashed #ccc; margin-top: 8px; padding-top: 8px; font-size: 0.9em; }
.notification-badge { position: absolute; top: -5px; right: -10px; background-color: #f44336; color: white; border-radius: 50%; padding: 2px 6px; font-size: 0.7em; font-weight: bold; border: 1px solid white; }
.anuncio-card-adsense .anuncio-card-corpo { min-height: 250px; }
.share-container { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e0e0e0; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: 8px; color: white !important; font-weight: bold; text-decoration: none; transition: opacity 0.2s, background-color 0.2s; cursor: pointer; border: none; font-size: 1em; }
.share-btn:hover { opacity: 0.85; text-decoration: none; color: white !important; }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.whatsapp { background-color: #25D366; }
.share-btn.linkedin { background-color: #0A66C2; }
.share-btn.instagram { background-color: #E4405F; }
.share-btn.telegram { background-color: #0088cc; }
.share-btn.copiar { background-color: #6c757d; }