/**
 * Anuncios Styles
 * Styles for property listings (anúncios) displayed in lote tooltip
 */

/* ===================================
   Container & Layout
   =================================== */

#anuncios-container {
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

/* Custom scrollbar */
#anuncios-container::-webkit-scrollbar {
    width: 6px;
}

#anuncios-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#anuncios-container::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 3px;
}

/* ===================================
   Anuncio Card Base
   =================================== */

.anuncio-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.anuncio-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.anuncio-card:last-child {
    margin-bottom: 0;
}

/* Match-based styling */
.anuncio-card.perfect-match {
    border-left-color: #10b981;
    background: linear-gradient(to right, #f0fdf4 0%, white 5%);
}

.anuncio-card.excellent-match {
    border-left-color: #3b82f6;
    background: linear-gradient(to right, #eff6ff 0%, white 5%);
}

.anuncio-card.good-match {
    border-left-color: #8b5cf6;
}

.anuncio-card.ok-match {
    border-left-color: #d1d5db;
}

/* ===================================
   Header Section
   =================================== */

.anuncio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.anuncio-title-section {
    flex: 1;
    min-width: 0;
}

.anuncio-title {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    word-wrap: break-word;
}

.source-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.source-badge.serper {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.source-badge.olx {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.source-badge.zap {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.source-badge.viva_real {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ===================================
   Match Badge
   =================================== */

.match-badge {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.match-badge.perfect-match {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    animation: pulse-glow 2s ease-in-out infinite;
}

.match-badge.excellent-match {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.match-badge.good-match {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.match-badge.ok-match {
    background: #e5e7eb;
    color: #6b7280;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    }
}

/* ===================================
   Specs Grid
   =================================== */

.anuncio-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.spec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #4b5563;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 6px;
}

.spec i {
    color: #3b82f6;
}

.spec-price {
    background: #fef3c7;
}

.spec-price i {
    color: #f59e0b;
}

.spec-price strong {
    color: #92400e;
}

/* ===================================
   Description & Address
   =================================== */

.anuncio-desc {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 10px 0;
}

.anuncio-address {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.anuncio-address i {
    color: #f43f5e;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ===================================
   Footer
   =================================== */

.anuncio-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    gap: 10px;
}

.scraped-date {
    color: #9ca3af;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-view-listing {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-view-listing:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-view-listing:active {
    transform: translateY(0);
}

/* ===================================
   Empty & Error States
   =================================== */

.anuncios-empty-state,
.anuncios-error-state,
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.anuncios-empty-state i,
.anuncios-error-state i,
.loading-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #d1d5db;
}

.anuncios-empty-state i {
    color: #9ca3af;
}

.anuncios-error-state i {
    color: #ef4444;
}

.loading-state i {
    color: #3b82f6;
}

.anuncios-empty-state h4,
.anuncios-error-state h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #374151;
}

.anuncios-empty-state p,
.anuncios-error-state p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
}

.hint {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

/* ===================================
   Badge (Tab Counter)
   =================================== */

.badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* ===================================
   Toast Notifications
   =================================== */

.hot-lead-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-left: 4px solid #10b981;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 400px;
    z-index: 10000;
}

.hot-lead-toast.animate-in {
    animation: slideInRight 0.3s ease-out;
}

.hot-lead-toast.animate-out {
    animation: slideOutRight 0.3s ease-in;
}

.toast-icon {
    font-size: 1.5rem;
    color: #10b981;
}

.toast-content {
    flex: 1;
}

.toast-title {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #1f2937;
}

.toast-message {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.toast-time {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .anuncio-header {
        flex-direction: column;
    }

    .anuncio-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-view-listing {
        width: 100%;
        justify-content: center;
    }

    .hot-lead-toast {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* FLOATING PANEL STYLES */
.anuncios-panel-floating {
    position: fixed;
    top: 90px;
    right: 400px;
    width: 450px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 99999;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.anuncios-panel-header {
    padding: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #fbbf24;
}

.anuncios-panel-body {
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    flex: 1;
}

.anuncios-panel-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.anuncios-panel-close:hover {
    opacity: 1;
}

/* Responsive adjust */
@media (max-width: 768px) {
    .anuncios-panel-floating {
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        width: 90%;
        max-height: 80vh;
        animation: fadeIn 0.3s ease;
    }
}

