/* ========================================
   Site de Anúncios Premium - Design Elegante
   ======================================== */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Premium */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --accent: #f59e0b;
    --accent-light: #fbbf24;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    /* Cores de Fundo */
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;

    /* Texto */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Outros */
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.3);

    /* WhatsApp */
    --whatsapp: #25d366;
    --whatsapp-dark: #128c7e;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Fundo animado */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo::before {
    content: '';
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.375rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.toggle-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

/* ========================================
   FILTROS
   ======================================== */
.filtros-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.filtros-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.filtro-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtro-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.filtro-select:hover {
    border-color: var(--primary-light);
}

.filtro-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.filtro-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

.btn-limpar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-limpar:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.resultados-info {
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.resultados-info span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive filtros */
@media (max-width: 768px) {
    .filtros-bar {
        padding: 1rem;
        gap: 0.75rem;
    }

    .filtros-grupo {
        min-width: calc(50% - 0.5rem);
        flex: none;
    }

    .btn-limpar {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .filtros-grupo {
        min-width: 100%;
    }
}

/* ========================================
   GRID VIEW
   ======================================== */
.anuncios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   LIST VIEW
   ======================================== */
.anuncios-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.anuncios-list .card {
    display: flex;
    flex-direction: row;
    max-width: 100%;
}

.anuncios-list .card-image-wrapper {
    width: 280px;
    height: 280px;
    flex-shrink: 0;
}

.anuncios-list .card-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.anuncios-list .card-observacao {
    -webkit-line-clamp: 3;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: rgba(124, 58, 237, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1.5rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-image {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-gold);
    color: #1a1a2e;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.card-content {
    padding: 1.75rem;
}

.card-codigo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-elevated);
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.card-titulo {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.card-preco {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.card-conservacao {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.card-conservacao::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
}

.card-observacao {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    margin: 1rem;
    border-radius: 28px;
    max-width: 1100px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow), 0 0 100px rgba(124, 58, 237, 0.2);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-size: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 0;
}

.modal-gallery {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.main-image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-main);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    padding: 1rem;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn { left: 1rem; }
.next-btn { right: 1rem; }

.thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
}

.thumbnail {
    width: 100%;
    height: 70px;
    object-fit: contain;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: var(--bg-main);
    padding: 0.5rem;
}

.thumbnail:hover {
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

.modal-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-codigo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-elevated);
    color: var(--primary-light);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    align-self: flex-start;
    border: 1px solid var(--border);
}

.modal-titulo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.modal-preco {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.info-section {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.info-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-section p {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.taxa {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.whatsapp-btn {
    background: linear-gradient(135deg, var(--whatsapp), var(--whatsapp-dark));
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
    margin-top: auto;
}

.whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:active {
    transform: translateY(-1px);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Card entrance animation */
.card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.3s; }
.card:nth-child(6) { animation-delay: 0.35s; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-gallery {
        padding: 1.5rem;
    }

    .main-image {
        height: 300px;
    }

    .modal-info {
        padding: 1.5rem;
    }

    .modal-titulo {
        font-size: 1.5rem;
    }

    .modal-preco {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.25rem;
    }

    .logo::before {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .anuncios-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .anuncios-list .card {
        flex-direction: column;
    }

    .anuncios-list .card-image-wrapper {
        width: 100%;
        height: 250px;
    }

    .card {
        border-radius: 20px;
    }

    .card-image-wrapper {
        height: 240px;
    }

    .card-content {
        padding: 1.25rem;
    }

    .card-titulo {
        font-size: 1.2rem;
    }

    .card-preco {
        font-size: 1.75rem;
    }

    .modal-content {
        margin: 0.5rem;
        border-radius: 20px;
        max-height: 95vh;
    }

    .modal-close {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
        right: 0.75rem;
        top: 0.75rem;
    }

    .nav-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .whatsapp-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .header {
        padding: 1rem 0;
    }

    .view-toggle {
        padding: 0.25rem;
    }

    .toggle-btn {
        padding: 0.5rem 0.625rem;
    }

    .thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }

    .thumbnail {
        height: 60px;
    }

    .info-section {
        padding: 1rem;
    }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 5px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) var(--bg-main);
}

/* ========================================
   SELECTION
   ======================================== */
::selection {
    background: var(--primary);
    color: white;
}
