/* ===================================================
   MODERN UI UPGRADE - Mobil Bekas Jambi
   =================================================== */

/* --- Smooth Scroll --- */
html { scroll-behavior: smooth; }

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc2626, #991b1b);
    border-radius: 6px;
    border: 2px solid #f5f5f5;
}
::-webkit-scrollbar-thumb:hover { background: #991b1b; }

/* --- Shimmer Loading --- */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Card Hover 3D --- */
.car-card {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
}
.car-card:hover {
    transform: translateY(-12px) scale(1.02) !important;
    box-shadow: 
        0 30px 60px -15px rgba(220, 38, 38, 0.4),
        0 0 0 1px rgba(220, 38, 38, 0.1),
        0 0 40px rgba(220, 38, 38, 0.15) !important;
    border-color: #dc2626 !important;
}
.car-card:hover .car-image img {
    transform: scale(1.15) rotate(1deg) !important;
    filter: brightness(1.05) saturate(1.1);
}
.car-image img {
    transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Card glow border animation */
.car-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(45deg, #dc2626, #ef4444, #991b1b, #dc2626);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    animation: borderFlow 3s linear infinite;
    pointer-events: none;
}
.car-card:hover::before { opacity: 1; }
@keyframes borderFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Category Card Hover --- */
.category-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: relative;
    overflow: hidden;
}
.category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(220,38,38,0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.category-card:hover::after { opacity: 1; }
.category-card:hover {
    transform: translateY(-10px) scale(1.05) !important;
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.3) !important;
}

/* --- Button Ripple --- */
.btn, .car-btn, .see-all {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn:hover::after {
    width: 300px; height: 300px;
}

/* --- Navbar Glassmorphism --- */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.15) !important;
}

/* --- Hero Parallax Pattern --- */
.hero {
    background-attachment: fixed;
    position: relative;
}
.hero::before {
    animation: float 20s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, -20px) scale(1.1); }
}

/* Hero floating particles */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.hero-particle {
    position: absolute;
    width: 4px; height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle 15s infinite linear;
}
@keyframes particle {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

/* --- Hero Text Animation --- */
.hero h1 {
    animation: fadeInUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hero p {
    animation: fadeInUp 1s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.hero-badge {
    animation: fadeInDown 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Stat Counter --- */
.stat-item h3 {
    transition: all 0.3s;
    font-variant-numeric: tabular-nums;
}
.stat-item:hover h3 {
    transform: scale(1.1);
    color: #dc2626 !important;
    text-shadow: 0 0 20px rgba(220,38,38,0.8) !important;
}

/* --- Feature Card Icon Animation --- */
.feature-card:hover .feature-icon {
    transform: rotate(-10deg) scale(1.15);
    background: linear-gradient(135deg, #0a0a0a, #1c1917);
    border-color: #dc2626;
}
.feature-icon {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- AOS Custom Override --- */
[data-aos] {
    pointer-events: auto !important;
}

/* --- Search Box Hover --- */
.search-box {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.search-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4) !important;
}

/* --- Floating WhatsApp Button --- */
.wa-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 60px;
    height: 60px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
    border: 3px solid #0a0a0a;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: waPulse 2s infinite;
}
.wa-float:hover {
    transform: scale(1.15) rotate(-8deg);
    background: #128c7e;
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.7);
}
@keyframes waPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5), 0 0 0 0 rgba(37, 211, 102, 0.7); }
    50% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5), 0 0 0 20px rgba(37, 211, 102, 0); }
}

/* --- Swiper Override --- */
.swiper {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}
.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.swiper-button-next, .swiper-button-prev {
    color: white !important;
    background: rgba(10, 10, 10, 0.6);
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background: #dc2626;
    transform: scale(1.1);
}
.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 1.2rem !important;
    font-weight: 900;
}
.swiper-pagination-bullet {
    background: white !important;
    opacity: 0.6;
    width: 10px !important;
    height: 10px !important;
    border: 2px solid #0a0a0a;
}
.swiper-pagination-bullet-active {
    background: #dc2626 !important;
    opacity: 1;
    width: 30px !important;
    border-radius: 5px !important;
}

/* --- Fancybox Override --- */
.fancybox__container {
    --fancybox-bg: rgba(10, 10, 10, 0.95);
}

/* --- Loading Skeleton for Images --- */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e5e5e5 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* --- Zoom Effect on Image Load --- */
.img-fade-in {
    animation: imgFade 0.6s ease;
}
@keyframes imgFade {
    from { opacity: 0; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Badge Pulse --- */
.badge-hot {
    animation: badgePulse 1.5s infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* --- Price Glow --- */
.car-price {
    position: relative;
    display: inline-block;
}
.car-card:hover .car-price {
    animation: priceGlow 1.5s infinite;
}
@keyframes priceGlow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 12px rgba(220, 38, 38, 0.6); }
}

/* --- Section Divider Wave --- */
.wave-divider {
    position: relative;
    height: 80px;
    overflow: hidden;
    margin-top: -1px;
}
.wave-divider svg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
}

/* --- Testimonial/Quote Card --- */
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(220, 38, 38, 0.2);
    border-color: #dc2626;
}

/* --- Footer Social Hover --- */
.social-link {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.social-link:hover {
    transform: translateY(-6px) rotate(8deg) scale(1.15);
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.5);
}

/* --- See All Arrow Bounce --- */
.see-all:hover i {
    animation: arrowBounce 0.6s infinite;
}
@keyframes arrowBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

/* --- Mobile optimization --- */
@media (max-width: 768px) {
    .hero { background-attachment: scroll; }
    .car-card:hover { transform: translateY(-6px) scale(1.01) !important; }
    .swiper-button-next, .swiper-button-prev { display: none !important; }
}
