/* Keyframe Animations */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0; /* Start hidden */
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.7s ease-out forwards;
    opacity: 0;
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.7s ease-out forwards;
    opacity: 0;
}

/* Pulse Effect */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-effect:hover {
    animation: pulse 1s infinite;
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-90deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

.rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
    opacity: 0;
}

/* Border Grow */
@keyframes borderGrow {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.border-grow-on-hover {
    position: relative;
}

.border-grow-on-hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: bottom left;
    transition: transform 0.3s ease-out;
}

.border-grow-on-hover:hover::after {
    transform: scaleX(1);
}

/* Smooth Scroll Animation (for sections) */
html {
    scroll-behavior: smooth;
}

/* Hero Section Video Overlay Fade */
.hero-overlay {
    transition: background-color 0.5s ease-in-out;
}

/* Navigation Link Hover Underline */
.nav-links a {
    position: relative;
    display: inline-block;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
    left: 0;
    background: var(--secondary-color);
}

/* Button Hover Effects */
.btn {
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Car Card Hover Effects */
.car-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Form Input Focus Effect */
input:focus,
textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transition: all 0.2s ease-in-out;
}

/* Dark Mode Transition */
body {
    transition: background-color 0.5s ease, color 0.5s ease;
}

header, .car-card, .contact-form-container {
    transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

/* Menu Toggle Animation */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Back to Top Button Fade In/Out */
#back-to-top {
    transition: opacity 0.3s ease-in-out;
}