:root {
    /* Cores Originais Arena Services (Restauradas) */
    --primary: #0D4C8C;        /* Azul Original */
    --primary-dark: #093461;
    --accent: #F2C200;         /* Amarelo Original */
    --accent-dark: #cca300;
    --secondary: #334155;
    
    --bg-main: #f6f7f8;
    --bg-card: #FFFFFF;
    --bg-header: #0D4C8C;
    --surface: #FFFFFF;
    
    --text-main: #0F172A;
    --text-muted: #475569;     /* Escurecido para melhor leitura */
    --text-on-dark: #FFFFFF;
    
    --border: #e2e8f0;
    --border-accent: rgba(242, 194, 0, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ESTRUTURA BASE (RESTALRADA) */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.middle-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 80px);
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: calc(100vw - 300px);
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}

.page-content {
    padding: 32px 40px;
}

.max-w {
    max-width: 1200px;
    margin: 0 auto;
}

/* TOP HEADER - AZUL ORIGINAL */
.top-header {
    height: 80px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    width: 100%;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
}

/* BUSCA - REFINADA */
.search-bar-container {
    flex: 1;
    max-width: 550px;
    margin: 0 40px;
}

.search-input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.search-input-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    opacity: 0.8;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 50px;
    background: transparent;
    border: none;
    color: white; /* Texto branco apenas para o header */
    font-size: 0.95rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
}

/* INPUTS PARA FORMULÁRIOS (FUNDOS CLAROS) */
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main); /* Texto escuro garantido */
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 76, 140, 0.1);
}

/* BOTÕES REFINADOS */
.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-primary {
    background: var(--accent);
    color: #332b00;           /* Texto mais escuro para contraste no amarelo */
    font-weight: 700;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md); /* Menos arredondado para um visual mais sério */
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 6px -1px rgba(242, 194, 0, 0.4);
}

.btn-primary:hover {
    background: #e6b800;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(242, 194, 0, 0.5);
}

.btn-text {
    color: white;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    letter-spacing: 0.2px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* USER PROFILE WIDGET */
.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: var(--transition);
}

.user-profile-nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-welcome {
    font-size: 0.88rem;
    font-weight: 500;
}

.user-welcome strong {
    font-weight: 700;
    color: var(--accent);
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #332b00;
    font-size: 1.1rem;
    border: 2px solid rgba(255,255,255,0.8);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-text:hover {
    background: rgba(255,255,255,0.15);
    color: var(--accent);
}

/* SIDEBAR REESTRUTURADA */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    overflow-y: auto;
    height: 100%;
}

.sidebar-category-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    margin: 24px 0 12px 14px;
    letter-spacing: 1px;
}

.sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-link:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.sidebar-link-icon {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-count {
    margin-left: auto;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 24px 14px;
}

/* HERO & SECTIONS */
.hero-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 40px 0;
}

.hero-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-main);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), #1e293b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.ads-section {
    margin-bottom: 48px;
}

/* CARDS E GRIDS */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.ad-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.ad-image {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #F1F5F9;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.ad-card:hover .ad-image img {
    transform: scale(1.05);
}

.ad-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    display: block;
}

.ad-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.ad-action {
    font-weight: 700;
    color: var(--primary);
}

/* BADGES */
.badge-neighbor {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 800;
    z-index: 2;
    text-transform: uppercase;
}

.status-open { background: #10B981; color: white; }
.status-closed { background: #EF4444; color: white; }

.card-closed {
    opacity: 0.75;
    filter: grayscale(30%);
}

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #0D4C8C, #1a6bbf);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* REVESTIMENTO PREMIUM HORIZONTAL */
.premium-carousel {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

.premium-card {
    flex: 1 1 320px;
    display: flex;
    background: white;
    border-radius: var(--radius-md);
    border: 2.5px solid var(--accent);
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

.premium-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.premium-image {
    width: 130px;
    flex-shrink: 0;
}

.premium-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.premium-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

/* GLASS CARDS E KPIs */
.glass-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

/* ANIMAÇÕES */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
}

/* AD DETAIL SPECIFIC */
.ad-banner-container {
    width: 100%;
    height: 350px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.ad-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%);
    display: flex;
    align-items: flex-end;
    padding: 40px;
}

/* AD SECONDARY NAV */
.ad-secondary-nav {
    background: var(--bg-card);
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ad-secondary-nav .nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.ad-nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent);
    color: #332b00;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.btn-back:hover { background: #e6b800; transform: translateY(-1px); }

.ad-secondary-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-whatsapp-nav {
    color: #25D366;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 8px 16px;
    border: 1.5px solid #25D366;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-whatsapp-nav:hover { background: #25D366; color: white; }

/* WHATSAPP FAB (MOBILE ONLY) */
.whatsapp-fab {
    position: fixed !important;
    bottom: 30px !important;
    right: 20px !important;
    width: 65px;
    height: 65px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none !important;
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-fab i {
    font-size: 38px;
    line-height: 65px; /* Alinhamento vertical exato pela altura do botão */
    margin: 0;
    padding: 0;
    display: block;
    text-align: center;
    transform: translateY(-2px); /* Pequeno ajuste para o peso do ícone do WhatsApp */
}

@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-fab:hover { transform: scale(1.1); color: white; animation: none; }

.ad-detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.banner-subtitle {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.banner-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.banner-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    background: white;
}

.banner-title-area h1 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 4px;
}

.banner-subtitle {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.gallery-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 32px;
}

.gallery-slides {
    display: flex;
    transition: transform 0.4s ease;
}

.gallery-slide {
    min-width: 100%;
}

.gallery-slide img {
    width: 100%;
    aspect-ratio: 16/7;
    object-fit: cover;
}

/* CSS DAS SETAS DO CARROSSEL DENTRO DA IMAGEM E PONTOS */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gallery-btn:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.gallery-btn-prev {
    left: 16px;
}

.gallery-btn-next {
    right: 16px;
}

.gallery-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.gallery-dot:hover, .gallery-dot.active {
    background: white;
    transform: scale(1.2);
}

.share-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-share {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-share-whatsapp { 
    background: #25D366; 
    color: white !important; 
    border: none;
    transition: var(--transition);
}
.btn-share-whatsapp:hover {
    background: #1eb959;
    transform: translateY(-2px);
}
.btn-share-copy { background: #e2e8f0; color: var(--text-main); }

/* FOOTER */
.footer {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* RESPONSIVO */
/* UTILITÁRIOS DE VISIBILIDADE */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 900px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* HEADER MOBILE */
    .top-header {
        position: sticky;
        top: 0;
        z-index: 2000;
        height: 70px;
        padding: 0 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-logo-text { font-size: 1.1rem; }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--accent);
        color: #332b00;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: var(--radius-sm);
        font-size: 1.3rem;
        cursor: pointer;
    }

    /* MENU SUSPENSO (DROPDOWN) DO TOPO */
    .mobile-dropdown-menu {
        position: absolute;
        top: 70px; /* Logo abaixo do header */
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
        display: none; /* Controlado via JS */
        z-index: 1999;
        border-bottom: 3px solid var(--primary);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .mobile-dropdown-menu.active {
        display: block;
        max-height: 500px;
        overflow-y: auto;
    }

    .dropdown-inner {
        padding: 24px;
    }

    .dropdown-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 0;
        color: var(--text-main);
        font-weight: 700;
        font-size: 1.05rem;
        border-bottom: 1px solid #f1f5f9;
        text-decoration: none;
    }

    .dropdown-link:last-child { border-bottom: none; }

    .dropdown-link i { color: var(--primary); font-size: 1.1rem; width: 20px; text-align: center; }

    .dropdown-divider {
        border: 0;
        border-top: 1px solid #e2e8f0;
        margin: 16px 0;
    }

    .dropdown-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 8px;
        border-bottom: 1px solid #f1f5f9;
    }

    .dropdown-user-info p { font-size: 0.95rem; color: var(--text-main); }

    /* REMOVER SIDEBAR NO MOBILE */
    .sidebar.desktop-only { display: none !important; }
    .middle-wrapper { flex-direction: column; }
    .main-wrapper { max-width: 100%; border-left: none; }
    .page-content { padding: 20px 16px; }

    /* AD DETAIL RESPONSIVE */
    .ad-secondary-nav {
        padding: 12px 16px;
        position: sticky !important;
        top: 0 !important; /* Esticando no topo da área de conteúdo (já abaixo do header) */
        z-index: 1001 !important;
        background: #FFFFFF !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .btn-back span { display: none; } /* Só ícone no mobile */
    .btn-back { padding: 8px 12px; }
    
    .ad-nav-title { font-size: 1rem; }

    .ad-banner-overlay { padding: 24px; }
    .banner-content-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }

    .banner-avatar {
        width: 90px;
        height: 90px;
    }

    .banner-title-area h1 {
        font-size: 1.6rem;
    }

    .banner-content-wrapper div[style*="margin-left: auto"] {
        margin-left: 0 !important;
        justify-content: center;
        width: 100%;
    }

    .ad-detail-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
    .glass-card { padding: 24px !important; }
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 900px) {
    .ads-grid { grid-template-columns: 1fr 1fr; }
    .premium-carousel { flex-direction: row; }
}
