/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #2c97de;
    --secondary-color: #1b6ca8;
    --text-color: #333;
    --bg-color: #f7f7f7;
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-color);
    margin: 0;
    transition: filter 0.3s ease; /* For potential future use */
    background: linear-gradient(to bottom, #ffffff, #f7f7f7);
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
}

/* Overlay for Blurring Background */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* For Safari compatibility */
    background: rgba(0, 0, 0, 0.2); /* Optional: adds a slight dark overlay */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998; /* Just below the navbar */
}

    /* When overlay is active */
    .overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Header and Navigation */
header {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 999; /* Above the overlay */
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

    .navbar .logo img {
        height: 50px;
        width: auto;
    }

.nav-links {
    display: flex;
    align-items: center;
}

    .nav-links ul {
        display: flex;
        gap: 20px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

        .nav-links ul li a {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 600;
            transition: color 0.3s ease;
            font-family: 'Open Sans', sans-serif; /* Body font */
        }

            .nav-links ul li a:hover {
                color: var(--primary-color);
            }

/* Menu Icon Styles */
.menu-icon {
    display: none; /* Hidden by default, shown on small screens */
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 20px;
    cursor: pointer;
    position: relative; /* To allow z-index to take effect */
    z-index: 1001; /* Higher than overlay and navbar */
}

    .menu-icon .bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--text-color);
        transition: all 0.3s ease;
    }

    /* Transform the menu icon into a cross when active */
    .menu-icon.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-icon.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-icon.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

/* Hero Section */
.hero-section {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    position: relative;
    margin-top: 70px; /* Adjusted for fixed header */
    background: url("mechanic_shop.jpg") center/cover no-repeat;
    color: #fff;
}

/* Dark overlay for better text visibility */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6); /* Slightly darker for better contrast */
    z-index: 0;
}

.hero-content {
    position: relative;
    color: inherit;
    z-index: 1;
}

    .hero-content h1 {
        font-family: 'Poppins', sans-serif; /* Modern sans-serif font */
        font-size: clamp(2rem, 5vw, 4rem);
        line-height: 1.2;
        margin-bottom: 1rem;
        font-weight: 700;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
        color: #fff; /* Solid color improves readability */
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    }

    .hero-content p {
        font-family: 'Open Sans', sans-serif; /* Body font */
        font-size: clamp(1rem, 2.5vw, 1.5rem);
        margin-bottom: 2rem;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    }

.btn-hero {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 5px;
    transition: background 0.3s, transform 0.3s ease, opacity 0.6s ease 0.2s;
    font-family: 'Poppins', sans-serif; /* Consistent with headings */
    opacity: 0;
    transform: translateY(20px);
}

    .btn-hero:hover {
        background: var(--secondary-color);
    }

.hero-section.loaded h1,
.hero-section.loaded p,
.hero-section.loaded .btn-hero {
    opacity: 1;
    transform: translateY(0);
}

/* Services Section */
.services-section {
    padding: 80px 20px;
}

.container {
    max-width: 1200px;
    margin: auto;
}

.services-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif; /* Modern sans-serif font */
}


.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}


.service-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .service-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 6px 25px rgba(0,0,0,0.15);
    }

    .service-card img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        display: block;
    }

    .service-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
        background: rgba(0,0,0,0.4);
        color: #fff;
        transition: background 0.3s ease;
    }

        .service-overlay h3 {
            font-family: 'Poppins', sans-serif;
            margin-bottom: 10px;
            font-size: 1.4rem;
            font-weight: 600;
        }

        .service-overlay p {
            font-family: 'Open Sans', sans-serif;
            font-size: 0.95rem;
            line-height: 1.6;
            margin: 0;
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

    .service-card:hover .service-overlay {
        background: rgba(0,0,0,0.7);
    }

    .service-card:hover .service-overlay p {
        opacity: 1;
        transform: translateY(0);
    }

/* About Section */
.about-section {
    padding: 80px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.about-content, .about-text {
    flex: 1 1 400px;
}

    .about-content img {
        width: 100%;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .about-text h2 {
        font-family: 'Poppins', sans-serif; /* Modern sans-serif font */
        font-size: 2.5rem;
        margin-bottom: 20px;
        font-weight: 700;
    }

    .about-text p {
        font-family: 'Open Sans', sans-serif; /* Body font */
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 20px;
    }

/* Testimonials Section */
.testimonials-section {
    padding: 80px 20px;
    background: var(--bg-color);
    text-align: center;
}

    .testimonials-section h2 {
        margin-bottom: 40px;
        font-size: 2.5rem;
        font-weight: 700;
    }

    .testimonials-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .testimonial {
        background: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        font-style: italic;
    }

    .testimonial span {
        display: block;
        margin-top: 15px;
        font-weight: 600;
        color: var(--primary-color);
    }

/* Contact Information List */
.contact-info {
    list-style: none;
    padding: 0;
}

    .contact-info li {
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 15px;
        font-family: 'Open Sans', sans-serif; /* Body font */
        font-size: 1rem;
    }

    .contact-info i {
        color: var(--primary-color);
        font-size: 1.2rem;
    }

/* Contact Section */
.contact-section {
    padding: 80px 20px;
    background: #f7f7f7;
    text-align: center;
}

    .contact-section h2 {
        margin-bottom: 20px;
        font-size: 2.5rem;
        font-family: 'Poppins', sans-serif; /* Modern sans-serif font */
        font-weight: 700;
    }

    .contact-section p {
        margin-bottom: 40px;
        font-size: 1.1rem;
        font-family: 'Open Sans', sans-serif; /* Body font */
    }

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: auto;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Open Sans', sans-serif; /* Body font */
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

    .contact-form input:focus, .contact-form textarea:focus {
        border-color: var(--primary-color);
        outline: none;
    }

.btn-submit {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-weight: 600;
    border-radius: 5px;
    transition: background 0.3s;
    font-family: 'Poppins', sans-serif; /* Consistent with headings */
}

    .btn-submit:hover {
        background: var(--secondary-color);
    }

/* Footer */
.footer-section {
    background: #333;
    color: #fff;
    padding: 20px 20px;
    text-align: center;
}

    .footer-section p {
        margin: 0;
        font-size: 1rem;
        font-family: 'Open Sans', sans-serif; /* Body font */
    }

/* Back To Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

    .back-to-top.visible {
        opacity: 1;
        visibility: visible;
    }

/* Responsive Styles */
@media (max-width: 768px) {
    .nav-links {
        position: fixed; /* Changed to fixed for better overlay */
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.3); /* Semi-transparent background */
        backdrop-filter: blur(10px); /* Blur effect */
        -webkit-backdrop-filter: blur(10px); /* For Safari compatibility */
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999; /* Above the overlay */
    }

        .nav-links ul {
            flex-direction: column;
            padding: 0;
        }

        .nav-links.open {
            opacity: 1;
            visibility: visible;
        }

    .menu-icon {
        display: flex; /* Changed from block to flex */
    }

    .about-section {
        flex-direction: column;
    }

    /* Preventing horizontal overflow within nav-links */
    .nav-links ul li a {
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        font-size: 1.5rem;
        font-family: 'Poppins', sans-serif; /* Modern sans-serif font */
    }

    /* Adjust hero content for smaller screens */
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .services-section {
        padding: 60px 20px;
    }

    .about-section {
        padding: 60px 20px;
    }

    .contact-section {
        padding: 60px 20px;
    }
}

/* Service Description Pages */
.service-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.service-description {
    padding: 120px 20px;
    max-width: 800px;
    margin: auto;
    text-align: center;
}

/* Image within service detail pages */
.service-description img {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.service-description h1 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    font-family: "Poppins", sans-serif;
}

.service-description .typed-text {
    font-size: 1.2rem;
    font-family: "Open Sans", sans-serif;
    border-right: 2px solid var(--primary-color);
    white-space: pre-wrap;
    animation: blink-caret 0.8s step-end infinite;
}

.service-description .typed-text.completed {
    border-right: none;
    animation: none;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

