
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Roboto:wght@400;500&display=swap');

:root {
    --primary-bg: #1a1a1a;
    --accent-color: #00aaff;
    --accent-hover: #0088cc;
    --text-color: #e0e0e0;
    --light-grey: #2b2b2b; /* Per cards e elementi in rilievo */
    --border-color: #3a3a3a;
    --white: #ffffff;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text-color);
    background-color: var(--primary-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main {
    flex-grow: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--white);
}

/* Header */
header {
    background-color: rgba(26, 26, 26, 0.8);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8em;
    font-weight: 900;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 5px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    transition: all 0.3s ease-in-out;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('../img/hero-background.jpg') no-repeat center center/cover;
    color: var(--white);
    text-align: center;
    padding: 120px 20px;
}

.hero h1 {
    font-size: 3.8em;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
}

.hero p {
    font-size: 1.3em;
    max-width: 750px;
    margin: 0 auto 40px auto;
    color: var(--text-color);
}

.cta-button {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.4);
    display: inline-block;
}

.cta-button:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.7);
    transform: translateY(-3px);
}

/* Generic Page Header */
.page-header {
    background: linear-gradient(45deg, #1a1a1a, #2b2b2b);
    text-align: center;
    padding: 80px 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-header-servizi {
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('../img/header-servizi.jpg') no-repeat center center/cover;
}

.page-header-chisiamo {
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('../img/header-chisiamo.jpg') no-repeat center center/cover;
}

.page-header-progetti {
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('../img/header-progetti.jpg') no-repeat center center/cover;
}

.page-header-contatti {
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('../img/header-contatti.jpg') no-repeat center center/cover;
}

.page-header h1 {
    font-size: 3.5em;
    font-weight: 900;
    color: var(--accent-color);
}

/* Content Section */
.content-section {
    padding: 100px 0;
}

.content-section h2 {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 25px;
    text-align: center; /* Re-centered */
}

.content-section .lead {
    text-align: center; /* Re-centered */
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 70px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}


/* Services & Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--light-grey);
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.service-card .icon {
    font-size: 3.5em;
    color: var(--accent-color);
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
}

.service-card h3 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: var(--white);
}

/* About Us */
.about-us-container {
    display: flex;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap; /* Allow items to wrap to next line if space is limited */
}

@media (min-width: 993px) {
    .about-us-container {
        justify-content: center; /* Center items when wrapped on larger screens */
    }
}

.about-us-image,
.about-us-content {
    flex: 1 1 auto; /* Allow items to grow/shrink based on content */
    max-width: 100%; /* Default to full width */
}

@media (min-width: 993px) { /* Apply 50% max-width only on larger screens */
    .about-us-image {
        flex: 1 1 400px;
        max-width: 50%;
    }
    .about-us-content {
        flex: 1 1 500px;
        max-width: 50%;
    }
}

.about-us-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.about-us-content p {
    font-size: 1.1em; /* Increased font size */
    line-height: 1.8; /* Increased line spacing */
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--light-grey);
    border: 1px solid var(--border-color);
}

.project-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.15);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.9); /* Solid dark background with transparency */
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to the top */
    align-items: center; /* Center horizontally for flex items */
    padding: 40px; /* Keep padding for breathing room */
    padding-top: 20px; /* Add specific top padding to push it down slightly */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay h3 {
    margin: 0 0 10px 0;
    color: var(--accent-color);
    font-size: 1.4em;
    text-align: center;
    width: 80%; /* Reduce width of text box */
    box-sizing: border-box;
    margin-left: -60px; /* Re-introducing the problematic left margin */
    margin-left: -60px; /* Re-introducing the problematic left margin */
}
.project-overlay p {
    margin: 0;
    font-size: 0.95em;
    color: var(--text-color);
    line-height: 1.5;
    opacity: 1;
    text-align: center;
    width: 80%; /* Reduce width of text box */
    box-sizing: border-box;
    margin-left: -60px; /* Re-introducing the problematic left margin */
}

.project-card:hover .project-overlay p {
    opacity: 1;
}

/* Contact Form */
.contact-container {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    background-color: var(--light-grey);
    padding: 50px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-info {
    flex-basis: 40%;
}

.contact-info h3 {
    color: var(--accent-color);
    font-size: 1.8em;
    margin-bottom: 30px;
}

.contact-info p {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.contact-info i {
    color: var(--accent-color);
    font-size: 1.5em;
    margin-top: 5px;
}

.contact-form {
    flex-basis: 60%;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
    background-color: #333;
    color: var(--text-color);
    font-size: 1em;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.contact-form button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--accent-color);
    color: var(--white);
    font-size: 1.2em;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-form button:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

/* Footer */
footer {
    background-color: #111;
    color: #aaa;
    padding: 60px 0 20px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    flex: 1;
    min-width: 220px;
}

.footer-section h4 {
    font-size: 1.3em;
    color: var(--accent-color);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
    opacity: 0.5;
}

.footer-section p, .footer-section a {
    color: #aaa;
    text-decoration: none;
    line-height: 1.8;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-section .contact-info-footer p {
    margin-bottom: 10px;
}

.social-links a {
    margin-right: 15px;
    font-size: 1.6em;
    color: #aaa;
}
.social-links a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: #777;
}

/* Responsive */
@media (max-width: 992px) {
    .about-us-container, .contact-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px; /* Further reduced gap for smaller screens */
        align-items: flex-start; /* Align items to the start (left) */
    }

    .contact-info h3,
    .contact-form h3 {
        text-align: center; /* Center headings on mobile */
    }

    .contact-info p {
        flex-direction: column; /* Stack icon and text vertically */
        align-items: center; /* Center them horizontally */
    }

    .contact-info p i {
        margin-bottom: 10px; /* Add space below icon */
    }

    .about-us-image, .about-us-content {
        max-width: 100%;
    }

    .about-us-content {
        text-align: center; /* Ensure text is centered on mobile */
    }

    /* Footer specific styles for mobile */
    .footer-content {
        flex-direction: column; /* Stack sections vertically */
        align-items: center; /* Center sections horizontally */
        text-align: center; /* Center text within sections */
        gap: 30px; /* Adjust gap between stacked sections */
    }

    .footer-section {
        width: 100%; /* Make each section take full width */
        min-width: unset; /* Remove min-width constraint */
    }

    .footer-section h4::after {
        left: 50%; /* Center the underline */
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px; /* Reduce container padding on very small screens */
    }
}

.text-center {
    text-align: center;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: rgba(26, 26, 26, 0.95);
        backdrop-filter: blur(10px);
        position: absolute;
        top: 74px; /* Altezza header */
        left: 0;
        padding: 10px 0;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        color: var(--text-color);
        padding: 15px;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero h1 {
        font-size: 2.8em;
    }
    .page-header h1 {
        font-size: 2.5em;
    }
    .content-section h2 {
        font-size: 2.2em;
    }
}
