/* General Styles */
:root {
    --tractor-width: 100px;
    --max-content-width: 1200px;
}

/* Global max-width for all content containers */
.container {
    max-width: var(--max-content-width) !important;
}

/* Ensure main content areas also respect max-width */
main {
    max-width: 100%;
}

body {
    padding-top: 76px; /* Height of navbar */
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* Navigation Styles */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-brand .fas.fa-tractor {
    color: #27ae60;
    font-size: 1.8rem;
}

.brand-text {
    color: #fff !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #27ae60 !important;
}

.navbar-nav .nav-link i {
    font-size: 0.9rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: 3rem;
}

/* Blurred background image that spans full width */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(10px);
    transform: scale(1.1); /* Slightly larger to avoid blur edge artifacts */
    z-index: 1;
}

/* Main hero container constrained to max-width */
.hero-section .hero-content {
    position: relative;
    width: 100%;
    max-width: var(--max-content-width);
    height: 100%;
    margin: 0 auto;
    z-index: 2;
    border-radius: 8px;
    overflow: hidden;
}

.hero-section .hero-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-section .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-section .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.308);
    z-index: 3;
}

.hero-section .hero-title {
    color: #fff;
    font-size: 3.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 0;
    padding: 1rem;
}

/* Hero without image - gradient background */
.hero-section.hero-no-image {
    background: linear-gradient(135deg, #27ae60, #2c3e50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section.hero-no-image .hero-overlay {
    position: static;
    background: none;
}

/* Description Section */
.description-section {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.description-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
}

/* Image Carousel Section */
.image-carousel {
    padding: 2rem 0;
    background-color: #f8f9fa;
}

.carousel-container {
    width: 80%;
    max-width: var(--max-content-width);
    margin: 0 auto;
}

/* Ensure any Bootstrap carousels also respect max-width */
.carousel {
    max-width: var(--max-content-width);
    margin: 0 auto;
}

.carousel-inner img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    border-radius: 8px;
}

/* Ensure carousel maintains aspect ratio */
.carousel-item {
    transition: transform 0.6s ease-in-out;
}

/* Style the carousel controls */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 20px;
}

/* Style carousel indicators */
.carousel-indicators [data-bs-target] {
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid #fff;
}

.carousel-indicators .active {
    background-color: #fff;
}

/* Legacy Carousel Section (keeping for backward compatibility) */
.carousel-section {
    padding: 3rem 0;
    background-color: #fff;
}

.carousel-section .carousel-item img {
    height: 500px;
    object-fit: cover;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem;
    border-radius: 5px;
}

.carousel-control-next-icon {
    margin-right: 20px;
}

.carousel-control-prev-icon {
    margin-left: 20px;
}

/* Blog Section */
.blog-section {
    padding: 3rem 0;
    background-color: #f8f9fa;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.blog-section .blog-posts .card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.blog-section .blog-posts .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.blog-section .blog-posts .card-img-top {
    height: 200px;
    object-fit: cover;
}

.blog-section .blog-posts .btn-primary {
    background-color: #27ae60;
    border-color: #27ae60;
}

.blog-section .blog-posts .btn-primary:hover {
    background-color: #229954;
    border-color: #229954;
}

/* View All Posts Button Styling */
.blog-section .btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    background-color: #27ae60;
    border-color: #27ae60;
}

.blog-section .btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
    background-color: #229954;
    border-color: #229954;
}

.blog-section .btn-lg .fas {
    font-size: 1rem;
}

/* Rich Text Editor Responsive Images */
.rich-text-content img,
.rte-content img,
.content img,
.post-body img,
[data-rte] img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ensure images in blog posts don't overflow */
.blog-post-content img,
.blog-content img,
.post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Generic responsive image fix for any content area */
.content-area img,
.main-content img {
    max-width: 100%;
    height: auto;
}

/* Mobile specific image adjustments */
@media (max-width: 768px) {
    .rich-text-content img,
    .rte-content img,
    .content img,
    .post-body img,
    .blog-post-content img,
    .blog-content img,
    .post-content img,
    [data-rte] img {
        margin: 0.5rem auto;
        border-radius: 4px;
    }
}

/* Services Section */
.services-section {
    padding: 4rem 0;
    background-color: #fff;
}

.service-card {
    padding: 2rem 1rem;
    height: 100%;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    font-size: 3rem;
    color: #27ae60;
    margin-bottom: 1rem;
}

.service-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.service-card .btn {
    margin-top: 1rem;
    background-color: #27ae60;
    border-color: #27ae60;
}

.service-card .btn:hover {
    background-color: #219a52;
    border-color: #1e8449;
    transform: translateY(-2px);
}

.service-card .btn i {
    transition: transform 0.2s ease;
}

.service-card .btn:hover i {
    transform: translateX(2px);
}

/* Contact Section */


.contact-info h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.contact-info i {
    color: #27ae60;
    width: 20px;
}

/* Footer section */
.w3w-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Social Media Links */
.fb-icon {
    color: #fff !important;
    display: inline-block;
    transition: color 0.3s ease;
    font-size: 3em !important;
}

.fb-icon:hover {
    color: #1877F2 !important;
}

/* Footer copyright */
footer .border-top {
    border-color: #495057 !important;
}

footer p {
    color: #adb5bd;
}

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

/* Adjust scroll offset for fixed navbar */
section[id] {
    scroll-margin-top: 90px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 56px; /* Smaller navbar height on mobile */
    }
    
    .hero-section {
        height: 300px;
    }

    .hero-section .hero-title {
        font-size: 2rem;
    }

    .description-section {
        padding: 2rem 0;
    }

    .description-section p {
        font-size: 1rem;
    }

    .carousel-section .carousel-item img {
        height: 300px;
    }
    
    .carousel-inner img {
        max-height: 400px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .blog-section .blog-posts .card-img-top {
        height: 150px;
    }
    
    .service-card {
        margin-bottom: 2rem;
    }
    
    .contact-info,
    .contact-form {
        margin-bottom: 2rem;
    }

    .fb-icon {
        font-size: 3em !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        height: 250px;
    }

    .hero-section .hero-title {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    .carousel-section .carousel-item img {
        height: 200px;
    }
    
    .carousel-inner img {
        max-height: 300px;
        border-radius: 4px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    svg {
        width: 50px !important;
        animation: drive 30s ease-in-out infinite !important;
    }

    :root {
        --tractor-width: 50px;
    }
}

/* Tractor Section */
svg {
  width: 100px;
  animation: drive 120s ease-in-out infinite;
}

/* ====== TRACTOR COLORS ====== */

/* 1️⃣ Main tractor body (frame, hood, etc.) */
svg path:nth-of-type(1) {
  fill: #a70000; /* bright John Deere green */
  stroke: #c40000;
  stroke-width: 2;
}

/* 2️⃣ Cabin / exhaust / chimney */
svg path:nth-of-type(2) {
  fill: #7f8c8d; /* metallic gray */
  stroke: #555;
  stroke-width: 2;
}

/* 3️⃣ Tires and wheels */
.tire {
  fill: #222; /* tire rubber */
  stroke: #111;
  stroke-width: 2;
  animation: spin 4s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* Optional: add inner rims with gray tone */
.tire {
  filter: drop-shadow(0 0 2px #888);
}

/* ====== DETAILS & LIGHTS ====== */

/* Exhaust tip smoke area */
svg rect.exhaust {
  fill: #95a5a6;
}

/* ====== ROTATION ANIMATION ====== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Driving back and forth */
@keyframes drive {
  0% {
    transform: translateX(0) scaleX(1);
  }
  45% {
    transform: translateX(calc(100vw - 20px - var(--tractor-width))) scaleX(1); /* go right */
  }
  50% {
    transform: translateX(calc(100vw - 20px - var(--tractor-width))) scaleX(-1); /* flip horizontally */
  }
  95% {
    transform: translateX(0) scaleX(-1); /* go left */
  }
  100% {
    transform: translateX(0) scaleX(1); /* flip back */
  }
}