/*
 * This is the complete and revised CSS code.
 * It provides a new, responsive navigation and mobile menu while maintaining existing styles for other sections.
 * Duplicate styles have been removed, and the code is organized for better readability.
 */

/* --- Base & Utility Styles --- */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f4f6f8;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Navigation --- */
header {
    background-color: #fff;
    padding: 20px 0;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    color: #007bff;
}

/* Desktop Navigation Links */
.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 0;
    display: block;
}

.nav-links a:hover {
    color: #007bff;
}

/* Desktop Dropdown Menu */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    padding: 10px 0;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #e2e6ea;
    color: #007bff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown > a::after {
    content: ' \25BE';
    font-size: 0.8em;
    vertical-align: middle;
    margin-left: 5px;
}

/* Mobile Navigation and Menu (Hidden by Default) */
.mobile-menu-button,
.mobile-menu {
    display: none;
}

/* --- Main Content Sections --- */

/* Hero Section */
.hero,
.services-hero {
    background-color: #1a202c;
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.services-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #cbd5e0;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.hero-buttons button {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
}

.hero-buttons button:hover {
    background-color: #1a202c;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.hero-buttons button img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.hero-buttons button:hover img {
    filter: invert(1);
}

/* Services Section */
.services {
    padding: 60px 0;
    text-align: center;
}

.services-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.service-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.service-card p {
    line-height: 1.6;
    color: #666;
}

.service-card .card-image {
    width: 100%;
    height: 50%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Service Label Tool Section */
.service-label-tool {
    padding: 60px 0;
    text-align: center;
    background-color: #f4f6f8;
}

.service-label-tool-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 50px;
    color: #333;
}

.service-tool-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 60px;
}

.service-tool-item:nth-child(even) {
    flex-direction: row-reverse;
}

.service-tool-item .image-wrapper {
    flex: 1;
    max-width: 400px;
    text-align: center;
}

.service-tool-item .image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.service-tool-item .content-wrapper {
    flex: 1;
    max-width: 600px;
    text-align: left;
}

.service-tool-item h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.service-tool-item p {
    line-height: 1.7;
    color: #666;
    margin-bottom: 25px;
}

.service-tool-item button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.service-tool-item button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Blog Section */
.blog {
    padding: 60px 0;
    text-align: center;
    background-color: #f9f9f9;
}

.blog-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.blog-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.blog-card img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-card-content {
    padding: 20px;
    text-align: left;
}

.blog-card-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.blog-card-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Footer --- */
footer {
    background-color: #1a202c;
    color: #cbd5e0;
    padding: 40px 0;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-column {
    flex: 1;
    min-width: 200px;
    padding: 10px;
}

.footer-column h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 20px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    text-decoration: none;
    color: #cbd5e0;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: #fff;
}

.footer-contact-info {
    margin-top: 15px;
    color: #cbd5e0;
}

.footer-bottom-bar {
    text-align: center;
    padding-top: 20px;
    color: #cbd5e0;
}

/* --- Loading Spinner --- */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Responsive Design --- */

@media (max-width: 1024px) {
    /* Hide the desktop nav and show the mobile toggle button */
    .nav-links {
        display: none;
    }

    .mobile-menu-button {
        display: block;
        background: none;
        border: none;
        color: #333;
        font-size: 1.5rem;
        cursor: pointer;
    }

    /* Center the footer content for better readability on tablets */
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-column {
        min-width: unset;
        width: 100%;
    }

    .footer-column ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 900px) {
    /* Stack the service tool items vertically on tablets */
    .service-tool-item {
        flex-direction: column !important;
        text-align: center;
    }

    .service-tool-item .content-wrapper {
        text-align: center;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    /* Adjust font sizes and padding for better mobile viewing */
    .services-hero h1 {
        font-size: 2.2rem;
    }

    .hero {
        padding: 40px 20px;
    }
    
    .hero-title {
        font-size: 1.7rem;
    }

    .hero-buttons button {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 5px;
    }

    .services,
    .blog {
        padding: 40px 20px;
    }

    .services-title,
    .blog-title {
        font-size: 1.7rem;
    }

    .services-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-content {
        padding: 15px;
    }

    .blog-card-title {
        font-size: 1.1rem;
    }
    
    /* --- Mobile Menu Styles --- */
    
    /* The mobile menu's default state (hidden) */
    .mobile-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 70%;
        height: 100%;
        background-color: #ffffff;
        z-index: 999;
        padding: 20px;
        box-sizing: border-box;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    /* Class to make the mobile menu visible */
    .mobile-menu.active {
        transform: translateX(0);
    }

    /* Style the header inside the mobile menu */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 20px;
        border-bottom: 1px solid #ccc;
    }

    .mobile-menu-header .close-button {
        font-size: 30px;
        background: none;
        border: none;
        cursor: pointer;
        color: black;
    }

    /* Mobile menu links styling */
    .mobile-menu a, .mobile-menu .dropdown {
        text-align: left;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
    
    .mobile-menu a {
        color: black;
        font-size: 18px;
        font-weight: bold;
        text-decoration: none;
    }
    
    /* Hide the dropdown content by default in mobile */
    .mobile-menu .dropdown-content {
        display: none;
        position: static;
        box-shadow: none;
        padding: 10px 0 0 20px;
        background-color: transparent;
    }

    /* Show the dropdown content when active */
    .mobile-menu .dropdown.active .dropdown-content {
        display: block;
    }

    /* Style the dropdown parent link for mobile */
    .mobile-menu .dropdown > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Add a transition to the dropdown arrow */
    .mobile-menu .dropdown > a::after {
        content: '▼';
        font-size: 14px;
        transform: rotate(0deg);
        transition: transform 0.3s ease;
    }

    /* Rotate the arrow when the dropdown is active */
    .mobile-menu .dropdown.active > a::after {
        transform: rotate(180deg);
    }
}