/* Imagem do anúncio */
.anuncio-imagem {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.anuncio-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.anuncio-card:hover .anuncio-imagem img {
    transform: scale(1.05);
}

.anuncio-imagem::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.1));
}

/* Imagem mini no admin */
.anuncio-imagem-mini {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
}

.anuncio-imagem-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anuncio-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.anuncio-item:last-child {
    border-bottom: none;
}

.anuncio-info {
    flex: 1;
}

/* Modal para imagem ampliada */
.modal-imagem {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-imagem.active {
    display: flex;
}

.modal-conteudo {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-conteudo img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.fechar-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 2001;
}

.fechar-modal:hover {
    color: var(--secondary);
}

/* Indicador de imagem carregando */
.anuncio-imagem.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Preview no admin */
#preview-container {
    border: 2px dashed var(--light-gray);
    padding: 10px;
    border-radius: var(--radius);
    text-align: center;
}

#preview {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Cursor pointer para imagens clicáveis */
.anuncio-imagem {
    cursor: pointer;
}

/* Ajustes responsivos para imagens */
@media (max-width: 768px) {
    .anuncio-imagem {
        height: 180px;
    }
    
    .anuncio-imagem-mini {
        width: 50px;
        height: 50px;
    }
}