/* ===========================
   Keyframe Animations
   =========================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ===========================
   Animation Classes
   =========================== */

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.slide-up {
    animation: slideUp 0.8s ease-out;
}

.slide-down {
    animation: slideDown 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.scale-in {
    animation: scaleIn 0.6s ease-out;
}

/* ===========================
   Hero Section Animations
   =========================== */

.hero-title {
    animation: slideInLeft 1s ease-out;
}

.hero-subtitle {
    animation: slideUp 1s ease-out 0.2s both;
}

.hero-cta {
    animation: slideUp 1s ease-out 0.4s both;
}

/* Tire Showcase Animations */
.tire-1 {
    animation: float 3s ease-in-out infinite;
}

.tire-2 {
    animation: float 3s ease-in-out 0.5s infinite;
}

.tire-3 {
    animation: float 3s ease-in-out 1s infinite;
}

/* ===========================
   Alert Banner Animation
   =========================== */

.alert-banner {
    animation: slideDown 0.6s ease-out;
}

/* ===========================
   Section Animations with Intersection Observer
   =========================== */

.section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Service Cards Stagger Animation */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.2s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.4s; }
.service-card:nth-child(5) { transition-delay: 0.5s; }
.service-card:nth-child(6) { transition-delay: 0.6s; }

/* Service Icon Hover Animation */
.service-card:hover .service-icon {
    animation: bounce 0.8s ease;
}

/* ===========================
   Product Cards Animation
   =========================== */

.product-card {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.product-card.visible {
    opacity: 1;
    transform: scale(1);
}

.product-card:nth-child(1) { transition-delay: 0.1s; }
.product-card:nth-child(2) { transition-delay: 0.2s; }
.product-card:nth-child(3) { transition-delay: 0.3s; }
.product-card:nth-child(4) { transition-delay: 0.4s; }

/* ===========================
   Gallery Animation
   =========================== */

.gallery-item {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.gallery-item.visible {
    opacity: 1;
    transform: scale(1);
}

.gallery-item:nth-child(1) { transition-delay: 0.05s; }
.gallery-item:nth-child(2) { transition-delay: 0.1s; }
.gallery-item:nth-child(3) { transition-delay: 0.15s; }
.gallery-item:nth-child(4) { transition-delay: 0.2s; }
.gallery-item:nth-child(5) { transition-delay: 0.25s; }
.gallery-item:nth-child(6) { transition-delay: 0.3s; }

/* ===========================
   Form Animation
   =========================== */

.form-group {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.form-group.visible {
    opacity: 1;
    transform: translateX(0);
}

.form-group:nth-child(1) { transition-delay: 0.05s; }
.form-group:nth-child(2) { transition-delay: 0.1s; }
.form-group:nth-child(3) { transition-delay: 0.15s; }
.form-group:nth-child(4) { transition-delay: 0.2s; }
.form-group:nth-child(5) { transition-delay: 0.25s; }
.form-group:nth-child(6) { transition-delay: 0.3s; }
.form-group:nth-child(7) { transition-delay: 0.35s; }

/* ===========================
   Button Animations
   =========================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ===========================
   Logo Animation
   =========================== */

.logo-circle {
    transition: transform 0.3s ease;
}

.logo:hover .logo-circle {
    transform: rotate(360deg);
}

/* ===========================
   Navigation Link Animation
   =========================== */

/* Removed - no animations on navigation links */

/* ===========================
   Loading Animation
   =========================== */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* ===========================
   Scroll Animations
   =========================== */

@keyframes scrollDown {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

.scroll-indicator {
    animation: scrollDown 2s ease-in-out infinite;
}

/* ===========================
   Text Reveal Animation
   =========================== */

@keyframes textReveal {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.text-reveal {
    overflow: hidden;
    white-space: nowrap;
    animation: textReveal 1s steps(40) forwards;
}

/* ===========================
   Feature Item Animation
   =========================== */

.feature-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.feature-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.feature-item:nth-child(1) { transition-delay: 0.1s; }
.feature-item:nth-child(2) { transition-delay: 0.2s; }
.feature-item:nth-child(3) { transition-delay: 0.3s; }
.feature-item:nth-child(4) { transition-delay: 0.4s; }

/* ===========================
   Contact Item Animation
   =========================== */

.contact-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.contact-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.contact-item:nth-child(1) { transition-delay: 0.1s; }
.contact-item:nth-child(2) { transition-delay: 0.2s; }
.contact-item:nth-child(3) { transition-delay: 0.3s; }
.contact-item:nth-child(4) { transition-delay: 0.4s; }

/* ===========================
   Image Hover Effects
   =========================== */

.image-wrapper {
    position: relative;
    overflow: hidden;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.8s ease;
    z-index: 1;
}

.image-wrapper:hover::before {
    left: 100%;
}

/* ===========================
   Tab Animation
   =========================== */

.tab-content {
    animation: fadeIn 0.5s ease-out;
}

/* ===========================
   Smooth Scroll Behavior
   =========================== */

html {
    scroll-behavior: smooth;
}

/* ===========================
   Reduce Motion for Accessibility
   =========================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
