/* Custom styles for Davids Used Cars */

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

/* Navigation text color transitions */
.nav-text {
    transition: color 0.3s ease;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #fbbf24;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile nav links */
.mobile-nav-link {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid #e7e5e4;
}

.mobile-nav-link:hover {
    border-left-color: #7c3aed;
    color: #7c3aed;
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .group:hover .group-hover\:scale-105 {
        transform: none;
    }
}

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

::-webkit-scrollbar-track {
    background: #fafaf9;
}

::-webkit-scrollbar-thumb {
    background: #7c3aed;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6d28d9;
}

/* Selection color */
::selection {
    background: #e9d5ff;
    color: #4c1d95;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Floating cards animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(var(--rotate, 0deg));
    }
    50% {
        transform: translateY(-10px) rotate(var(--rotate, 0deg));
    }
}

/* Apply floating to stat cards */
.absolute.top-0.right-0 {
    animation: float 4s ease-in-out infinite;
    --rotate: 2deg;
}

.absolute.top-24.right-32 {
    animation: float 4.5s ease-in-out infinite 0.5s;
    --rotate: -1deg;
}

.absolute.top-52.right-0 {
    animation: float 5s ease-in-out infinite 1s;
    --rotate: 1deg;
}

.absolute.bottom-8.right-20 {
    animation: float 4.2s ease-in-out infinite 0.3s;
}

.absolute.top-1\/2.left-0 {
    animation: float 4.8s ease-in-out infinite 0.7s;
}

/* Staggered reveal delays */
.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.6s; }

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-scrolled .nav-text {
    color: #1c1917 !important;
}

.nav-scrolled .nav-link {
    color: #57534e !important;
}

.nav-scrolled .mobile-nav-link {
    color: #57534e !important;
}

/* Mobile menu animation */
#mobile-menu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Form input focus animations */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Hover lift effect for cards */
.group:hover {
    transform: translateY(-4px);
}

/* Print styles */
@media print {
    nav, #back-to-top, button {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-plum-950 {
        background: #1a1a2e !important;
        color: #fff !important;
    }
}
