/* ==========================================================================
   Custom Styles for AutoData App
   ========================================================================== */

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Custom modern scrollbar for the main area */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0e14;
}

::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #374151;
}

/* Golden Badge animations and styles */
.badge-gold {
    position: relative;
    display: inline-block;
}

.badge-gold::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 20%,
            rgba(255, 215, 0, 0.4) 40%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 215, 0, 0.4) 60%,
            transparent 80%);
    transform: rotate(45deg);
    animation: sweep 3s infinite linear;
    pointer-events: none;
    z-index: 10;
}

@keyframes sweep {
    0% {
        transform: translateY(-100%) rotate(45deg);
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    50% {
        transform: translateY(100%) rotate(45deg);
        opacity: 0;
    }

    100% {
        transform: translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

/* ==========================================================================
   List View Overrides (Vista de Lista Adaptativa PERFECTA)
   ========================================================================== */
.list-view {
    grid-template-columns: 1fr !important;
    /* Fuerza una sola columna */
}

/* Solo aplicamos la fila horizontal en pantallas grandes (Laptops/Monitores) 
   En celulares se mantendrá como tarjeta normal para no romper la pantalla */
@media (min-width: 1024px) {
    .list-view article {
        flex-direction: row !important;
        align-items: center;
        padding: 1rem 1.5rem !important;
        gap: 1.5rem;
    }

    /* Contenedor principal de la tarjeta */
    .list-view article>div:first-child {
        flex-direction: row !important;
        align-items: center;
        flex: 1;
        gap: 1.5rem;
    }

    /* 1. Etiqueta de Ganga/Sobreprecio (Deja de flotar y se alinea) */
    .list-view article .absolute.top-4.right-4 {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        flex-shrink: 0;
        margin: 0 !important;
        box-shadow: none !important;
    }

    /* 2. Marca y Modelo */
    .list-view article .mb-4.pr-24 {
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 220px;
        /* Ancho fijo para que alineen como tabla */
    }

    /* 3. Contenedor de Precio y Detalles (KM, Ciudad) */
    .list-view article .grid.grid-cols-2 {
        display: flex !important;
        margin: 0 !important;
        flex: 1;
        justify-content: space-between;
        align-items: center;
        gap: 2rem;
    }

    /* Quitamos el borde izquierdo de los detalles en vista de lista */
    .list-view article .grid.grid-cols-2>div:last-child {
        border-left: none !important;
        padding-left: 0 !important;
        flex-direction: row !important;
        /* Detalles uno al lado del otro */
        gap: 1.5rem !important;
    }

    /* 4. Barra de Score */
    .list-view article .mb-6 {
        margin: 0 !important;
        flex: 0 0 160px;
        /* Ancho fijo para el score */
    }

    /* 5. Botón de Ver Oferta */
    .list-view article>.mt-auto {
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 130px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .list-view article>.mt-auto a {
        margin: 0 !important;
        padding: 0.6rem 1rem !important;
        font-size: 0.75rem;
    }

    .list-view article>.mt-auto p {
        display: none;
        /* Oculta el texto "Fuente: Supabase" para ahorrar espacio */
    }
}

/* ==========================================================================
   Paywall & Premium Styles (Muro de Pago y Efectos)
   ========================================================================== */
.paywall-wrapper {
    position: relative;
    overflow: hidden;
}

.paywall-blur {
    filter: blur(12px) grayscale(0.5);
    pointer-events: none;
    user-select: none;
    transition: filter 0.5s ease;
}

.paywall-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 14, 20, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Resplandor neón en el Dashboard cuando el usuario es PRO */
.premium-active #premium-dashboard-section {
    border: 1px solid rgba(57, 255, 20, 0.2);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.05);
}

/* Efecto hover en las tarjetas de la grilla para usuarios PRO */
.premium-active #vehiculos-grid>article:hover {
    border-color: #39FF14;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.1);
}

/* ==========================================================================
   Navbar Cockpit & Dropdown (Menú de Usuario)
   ========================================================================== */
#profileDropdown {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#profileDropdown.show {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.premium-active #profileDropdown {
    border-color: rgba(57, 255, 20, 0.3);
}

.backdrop-blur-xl {
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

/* Ajustes específicos de botones superiores */
#searchBtn,
#downloadPdfBtn {
    height: 42px;
}

#downloadPdfBtn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#downloadPdfBtn:hover {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}
/* ========================================== */
/* AUTH & PREMIUM LOCK STYLES */
/* ========================================== */

#authModal {
    backdrop-filter: blur(10px);
}

.premium-locked {
    position: relative !important;
    pointer-events: none !important;
    user-select: none;
    transition: all 0.5s ease;
}

.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 14, 20, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    gap: 1.5rem;
    pointer-events: auto;
    cursor: default;
    border: 1px solid rgba(57, 255, 20, 0.2);
}

.lock-badge {
    background: var(--brand-neon, #39FF14);
    color: #000;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.lock-title {
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lock-desc {
    color: #cbd5e1;
    font-size: 0.95rem;
    max-width: 320px;
    text-align: center;
    line-height: 1.6;
    font-weight: 500;
}

.lock-btn {
    background: var(--brand-neon, #39FF14);
    color: #000;
    font-weight: 900;
    text-transform: uppercase;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.lock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
}

input:focus {
    outline: none !important;
    border-color: #39FF14 !important;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

/* BOTÓN VOLVER ARRIBA - POSICIÓN IZQUIERDA */
#backToTopBtn {
    position: fixed !important;
    bottom: 30px !important;
    left: 20px !important; /* Movido a la izquierda */
    width: 55px;
    height: 55px;
    background-color: #39FF14 !important;
    color: #000000 !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    
    /* z-index crítico para estar sobre la barra lateral */
    z-index: 99999 !important; 
    opacity: 1 !important;
    visibility: visible !important;
    
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.5);
    transition: transform 0.3s ease;
}

#backToTopBtn:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

#backToTopBtn i {
    width: 28px;
    height: 28px;
    stroke-width: 3px;
}




/* ==========================================
   PAYWALL VISUAL (RESTRICCIÓN COMPRADOR)
   ========================================== */
.paywall-blur {
    filter: blur(10px) !important;
    pointer-events: none !important;
    user-select: none !important;
    opacity: 0.6 !important;
    transition: all 0.5s ease;
}

.paywall-wrapper {
    position: relative !important;
    width: 100%;
}

.paywall-upgrade-overlay {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1000 !important;
    background: rgba(11, 14, 21, 0.95) !important;
    border: 1px solid #39FF14 !important;
    padding: 2rem 2.5rem !important;
    border-radius: 1.25rem !important;
    text-align: center !important;
    box-shadow: 0 0 50px rgba(57, 255, 20, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    min-width: 320px;
    animation: fadeInPaywall 0.5s ease-out;
}

@keyframes fadeInPaywall {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.paywall-upgrade-overlay i {
    display: block;
    margin-bottom: 1rem;
    color: #39FF14;
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.5));
}

.paywall-upgrade-overlay p {
    color: white !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}
