/* Adjustments for mobile nav if needed */
@media (max-width: 768px) {
    .main-nav li .lang-switch-button {
         margin: 10px auto; /* Center button in mobile nav list item */
         display: inline-block; /* Allow centering */
         width: auto; /* Don't force full width */
    }
     /* Ensure the button is within the li flow */
    .main-nav li:has(.lang-switch-button) {
        display: flex;
        justify-content: center;
    }
}

/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007bff; /* Example Blue */
    --primary-darker-color: #0056b3; /* Darker blue for hover */
    --secondary-color: #6c757d; /* Example Gray */
    --secondary-darker-color: #5a6268; /* Darker gray for hover */
    --background-color: #ffffff;
    --text-color-light-bg: #333; /* Text on light backgrounds */
    --text-color-dark-bg: #e9ecef; /* Text on dark backgrounds (like canvas) */
    --heading-color-light-bg: #1a2b48; /* Headings on light backgrounds */
    --heading-color-dark-bg: #ffffff; /* Headings on dark backgrounds */
    --link-color: var(--primary-color);
    --link-hover-color: var(--primary-darker-color);
    --heading-font: 'Arial', sans-serif; /* Choose appropriate fonts */
    --body-font: 'Georgia', serif;
    --section-padding: 60px 0;
    --container-width: 90%;
    --max-container-width: 1140px;
    --header-height: 70px;
    --transition-speed: 0.3s ease;
    --modal-z-index: 1100; /* Ensure modal is above header */
    --service-image-height: 150px; /* Define a height for service images */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for nav links */
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--body-font);
    color: var(--text-color-light-bg); /* Default text color for light backgrounds */
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}
/* Prevent scroll when modal is open */
body.modal-open {
    overflow: hidden;
}


#neuron-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #1a2b48;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: block;
}


main, header, footer {
     position: relative;
     z-index: 1;
}

section {
    padding: var(--section-padding);
    background-color: var(--background-color);
}

section:nth-of-type(even) {
    background-color: #f8f9fa;
}

.site-footer {
     background-color: #343a40;
     color: #f8f9fa; /* Added color here for footer text */
     padding: 30px 0;
     text-align: center;
     z-index: 1;
}

body.nav-active {
     overflow-y: hidden;
}

/* General Heading Styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--heading-color-light-bg);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; text-align: center; margin-bottom: 2.5rem; position: relative; }
h3 { font-size: 1.5rem; }

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}


p {
    margin-bottom: 1rem;
    color: var(--text-color-light-bg);
}
/* Ensure paragraphs in footer are light */
.site-footer p {
    color: #f8f9fa;
}


a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover, a:focus {
    color: var(--link-hover-color);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: var(--container-width);
    max-width: var(--max-container-width);
    margin: 0 auto;
    padding: 0 15px;
}


.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    border: none;
    cursor: pointer;
    font-family: var(--heading-font);
}

.cta-button:hover, .cta-button:focus {
    background-color: var(--link-hover-color);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

/* --- Header --- */
.site-header {
    background-color: var(--background-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Below modal */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-color-light-bg);
    text-decoration: none;
}
.logo a:hover { text-decoration: none; }

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center; /* Align items vertically */
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    text-decoration: none;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}
/* Exclude button from link styles */
.main-nav a:not(.lang-switch-button) {
     color: var(--text-color-light-bg);
}


.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.main-nav a:hover::after,
.main-nav a:focus::after {
    width: 100%;
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color-light-bg);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* --- Hero Section --- */
.hero-section {
    background-color: transparent;
    color: var(--text-color-dark-bg);
    padding: 150px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

 .hero-bg-shape {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 150px;
    background-color: var(--background-color);
    clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 50%);
    z-index: 1;
}


.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--heading-color-dark-bg);
}

.hero-section .subtitle {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    color: var(--text-color-dark-bg);
    opacity: 0.9;
    font-weight: 300;
}

.hero-section .cta-button {
    font-size: 1.1rem;
    padding: 15px 35px;
}

/* --- About Section --- */
.about-section {
    padding-top: var(--header-height);
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.about-text {
    flex: 1;
    min-width: 300px;
}
.about-text p { color: var(--text-color-light-bg); }

.about-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.about-image img {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- Services Section --- */
.services-section {
    padding-top: var(--header-height);
}

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

.service-item {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex; /* Use flexbox for alignment */
    flex-direction: column; /* Stack image, title, text */
    align-items: center; /* Center items horizontally */
}
.service-item p {
    color: var(--text-color-light-bg);
    flex-grow: 1; /* Allow text to take available space */
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Removed .service-icon-placeholder styles */

/* Styles for the new service images */
.service-item img {
    width: 100%; /* Make image responsive */
    height: var(--service-image-height); /* Fixed height */
    object-fit: cover; /* Cover the area, might crop */
    border-radius: 4px; /* Optional: slightly rounded corners */
    margin-bottom: 20px; /* Space below image */
}

.service-item h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* --- Portfolio Section --- */
.portfolio-section {
    padding-top: var(--header-height);
}

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

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer; /* Indicate clickable */
}

.portfolio-item img {
    transition: transform var(--transition-speed);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    padding: 20px;
    transform: translateY(100%);
    transition: transform var(--transition-speed);
    pointer-events: none; /* Allow clicks to pass through to item */
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-item:hover .portfolio-info {
    transform: translateY(0);
}

.portfolio-info h3 {
    margin-bottom: 5px;
    color: #fff;
}
.portfolio-info p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #eee;
}

/* --- Contact Section --- */
.contact-section {
    padding-top: var(--header-height);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.contact-form {
    flex: 1.5;
    min-width: 300px;
}

.contact-details {
    flex: 1;
    min-width: 300px;
}
.contact-details p { color: var(--text-color-light-bg); }
.contact-details strong { color: var(--heading-color-light-bg); }

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--heading-color-light-bg);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    background-color: #fff;
    color: var(--text-color-light-bg);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

/* Added styles for the actual map container */
#map {
    margin-top: 20px;
    border: 1px solid #ccc;
    height: 300px; /* Adjust height as needed */
    width: 100%;
    border-radius: 5px;
    background-color: #e9ecef; /* Background while map loads */
}


/* --- Footer --- */
/* Styles moved up for better organization */


/* --- Responsiveness --- */
@media (max-width: 768px) {
    html { font-size: 15px; }
    h1 { font-size: 2.5rem; }
    .hero-section h1 { font-size: 2.8rem; }
    h2 { font-size: 1.9rem; }
    .container { width: 95%; }

    /* Mobile Navigation */
    .menu-toggle { display: block; }
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
        transition: right 0.4s ease-in-out;
        padding-top: calc(var(--header-height) + 20px);
        z-index: 999;
    }
     .main-nav a:not(.lang-switch-button) { color: var(--text-color-light-bg); }
     .main-nav a:not(.lang-switch-button):hover { color: var(--primary-color); }

    .main-nav.active { right: 0; }
    .main-nav ul { flex-direction: column; align-items: center; }
    .main-nav li { margin: 15px 0; width: 100%; text-align: center; }
    .main-nav a { display: block; padding: 10px 0; font-size: 1.2rem; }
    .main-nav a::after { left: 50%; transform: translateX(-50%); }

     /* Hamburger Animation */
    .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

    .hero-section { padding: 120px 0 80px; min-height: 60vh; }
    .about-content { flex-direction: column; }
    .contact-content { flex-direction: column; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    h1 { font-size: 2.1rem; }
    .hero-section h1 { font-size: 2.4rem; }
    h2 { font-size: 1.7rem; }
    .hero-section .subtitle { font-size: 1.1rem; }
    :root { --service-image-height: 120px; } /* Slightly smaller images on mobile */
}


/* --- Language Switch Button --- */
.lang-switch-button {
    /* Use primary color for better visibility */
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--heading-font);
    transition: background-color var(--transition-speed);
    margin-left: 15px; /* Space in the nav */
    vertical-align: middle; /* Align with nav links */
    text-decoration: none; /* Remove underline if applied via general 'a' styles */
}

.lang-switch-button:hover,
.lang-switch-button:focus {
    background-color: var(--primary-darker-color); /* Darker shade on hover */
    outline: none;
    color: #fff;
    text-decoration: none;
}

/* Ensure contrast in mobile nav too */
@media (max-width: 768px) {
    .main-nav li .lang-switch-button {
        /* Style is already good due to above rules */
        margin-top: 10px; /* Add some top margin in vertical layout */
    }
}

/* --- Modal Styles --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: var(--modal-z-index);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if content is long */
    background-color: rgba(0, 0, 0, 0.6); /* Dim background */
    opacity: 0; /* Start fully transparent */
    transition: opacity 0.3s ease-in-out; /* Fade effect */
    align-items: center; /* Vertically center content */
    justify-content: center; /* Horizontally center content */
}

.modal.active {
    display: flex; /* Use flex for centering */
    opacity: 1; /* Fade in */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Center horizontally */
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 600px; /* Max width */
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(0.9); /* Start slightly smaller */
    transition: transform 0.3s ease-in-out; /* Scale effect */
}

.modal.active .modal-content {
    transform: scale(1); /* Scale to full size */
}


.modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h3 { /* Modal Title */
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal-content h4 { /* Modal Results Heading */
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--heading-color-light-bg);
    font-size: 1.1rem;
}


.modal-content p { /* Modal Description Text */
    margin-bottom: 10px;
    line-height: 1.7;
    color: var(--text-color-light-bg);
}
.modal-content ul { /* Modal Results List */
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 15px;
    padding-left: 5px;
}
.modal-content li { /* Modal Results List Item */
    margin-bottom: 5px;
    color: var(--text-color-light-bg);
}