/* ===================================
   ANIMATIONS AND TRANSITIONS
   =================================== */

/* Base transition properties for smooth animations */
* {
    transition: all 0.3s ease;
}

/* Remove transitions for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ===================================
   BUTTON ANIMATIONS
   =================================== */

.btn {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

/* Primary button hover effect */
.btn-primary:hover {
    background-color: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

/* Secondary button hover effect */
.btn-secondary:hover {
    background-color: var(--accent-orange);
    color: white;
    border-color: var(--accent-orange);
}

/* Button ripple effect */
.btn::before {
    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:active::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   SERVICE CARD ANIMATIONS
   =================================== */

.service-card {
    transform: translateY(0);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.service-card:hover::before {
    left: 100%;
}

/* Service icon animation */
.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--accent-orange);
}

/* Service title animation */
.service-title {
    transition: color 0.3s ease;
}

.service-card:hover .service-title {
    color: var(--accent-orange);
}

/* ===================================
   GALLERY IMAGE ANIMATIONS
   =================================== */

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    transition: all 0.4s ease;
    transform: scale(1);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery overlay effect */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

/* Gallery zoom icon */
.gallery-item::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    z-index: 2;
    transition: transform 0.3s ease;
}

.gallery-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* ===================================
   NAVIGATION ANIMATIONS
   =================================== */

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-orange);
    transition: width 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent-orange);
}

/* Mobile menu animation */
.mobile-menu-toggle span {
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===================================
   HEADER ANIMATIONS
   =================================== */

.header {
    transition: all 0.3s ease;
}

.header.scrolled {
    background-color: rgba(240, 240, 240, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ===================================
   CONTACT ITEM ANIMATIONS
   =================================== */

.contact-item {
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateX(10px);
}

.contact-icon {
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    color: var(--accent-orange);
    transform: scale(1.1);
}

/* ===================================
   SOCIAL LINKS ANIMATIONS
   =================================== */

.social-links a,
.footer-social a {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.social-links a:hover,
.footer-social a:hover {
    transform: translateY(-3px);
    color: var(--accent-orange);
}

/* ===================================
   HIGHLIGHT ITEMS ANIMATIONS
   =================================== */

.highlight-item {
    transition: all 0.3s ease;
}

.highlight-item:hover {
    transform: translateY(-5px);
}

.highlight-item i {
    transition: all 0.3s ease;
}

.highlight-item:hover i {
    color: var(--accent-orange);
    transform: scale(1.2);
}

/* ===================================
   HERO SECTION ANIMATIONS
   =================================== */

.hero-content {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero background parallax effect */
.hero-image {
    transition: transform 0.1s ease-out;
}

/* ===================================
   SECTION ANIMATIONS
   =================================== */

.section-header {
    animation: fadeInUp 0.8s ease-out;
}

/* Staggered animation for service cards */
.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   LOADING ANIMATIONS
   =================================== */

/* ===================================
   IMAGE OPTIMIZATION STYLES
   =================================== */

/* Fade in animation for images */
img {
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: #f0f0f0;
}

img.loaded {
    opacity: 1;
}

img.error {
    opacity: 1;
    filter: grayscale(100%);
}

/* Image loading states */
img.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s infinite;
    opacity: 1;
}

/* Responsive image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Modern image format support - Commented out since WebP/AVIF files don't exist */
/*
.webp .hero-image {
    background-image: url('../img/hero/dealer_default.webp');
}

.avif .hero-image {
    background-image: url('../img/hero/dealer_default.avif');
}
*/

/* Lazy loading placeholder */
img[loading="lazy"] {
    min-height: 200px;
    background: #f0f0f0 url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNjY2MiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIj48Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+PHBhdGggZD0ibTM5IDE4YzAtOS45NC04LjA2LTE4LTE4LTE4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZnJvbT0iMCAxOCAxOCIgdG89IjM2MCAxOCAxOCIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz48L3BhdGg+PC9nPjwvZz48L3N2Zz4=') center center no-repeat;
    background-size: 40px 40px;
}

/* Gallery image optimization */
.gallery-item img {
    object-fit: cover;
    width: 100%;
    height: 250px;
}

/* Hero image optimization */
.hero-image {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Skeleton loading animation */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton 1.5s infinite;
}

/* ===================================
   SCROLL ANIMATIONS
   =================================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Fade in on scroll animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}