:root {
    --primary-color: #2c3e50;
    --secondary-color: #ecf0f1;
    --third-color: #F0E68C;
    --link-color: #3498db;
    --hover-color: #e74c3c;
    --visited-color: #9b59b6;
    --border-color: #9A8363;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #E8F4FF;
    color: #06283D;
    background-image: linear-gradient(135deg, #FFFFFF, #fff6a5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in animation globally */
body,
header,
nav,
section,
footer {
    animation: fadeIn 1.2s ease-out;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    margin: 10px;
    border-radius: 20px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

header img {
    width: 100px;
    height: auto;
}

header .header-titoli {
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

header span.yellow {
    color: #FFBF0D;
}

/* Specific style for the RoadAlert link */
header a {
    text-decoration: none;
    color: inherit;
}

nav {
    background-color: var(--primary-color);
    border-radius: 20px;
    margin: 10px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

nav ul li a {
    display: block;
    padding: 14px 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

nav ul li a:hover {
    background-color: var(--primary-color);
}

/* Add hover effect for nav li and a elements */
nav ul li:hover,
nav ul li a:hover {
    background-color: var(--hover-color);
    color: var(--secondary-color);
}

section {
    padding: 15px 20px;
    max-width: 900px;
    margin: 30px auto;
    /* Ensure space around the section */
    background: var(--secondary-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--primary-color);
}

main {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    max-width: 900px;
    background: var(--secondary-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--primary-color);
    margin: 40px auto;
    /* Ensure space around the main element */
}

.section h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

section a:hover,
footer a:hover {
    color: var(--hover-color);
}

a {
    text-decoration: none;
}

.service-list {
    font-size: 17px;
    line-height: 1.8;
    text-align: left;
}

.service-list h3 {
    text-align: center;
    margin-bottom: 20px;
}

.service-item {
    margin-bottom: 15px;
}

.service-item strong {
    display: block;
    margin-bottom: 5px;
}

img.big-image {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 20px;
    border-radius: 12px;
}

footer {
    margin-top: 40px;
    padding: 20px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    text-align: center;
}

/* Sidebar styles */
.sidebar {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 250px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
    padding: 20px;
    z-index: 1000;
    overflow-y: auto;
    margin: 10px;
    margin-bottom: 10px;
    border-radius: 20px;
}

.sidebar a {
    display: block;
    color: var(--secondary-color);
    text-decoration: none;
    margin: 30px 0;
    font-size: large;
    font-weight: bold;
}

.sidebar a:hover {
    color: var(--hover-color);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 18px;
}

.sidebar-toggle:hover {
    background-color: var(--hover-color);
}

@media (max-width: 768px) {

    .sidebar {
        display: none;
    }

    nav {
        display: none;
    }

    section,
    main {
        margin: 10px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    nav ul li a {
        padding: 10px;
    }

    main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    main form {
        width: 100%;
        max-width: 100%;
    }

    main img {
        width: 100%;
        margin-top: 20px;
    }

    .sidebar-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 8px;
        font-size: 16px;
    }
}

.stileNomeCampo {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.stileCampo {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.bottoneForm {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Scroll-to-top button styles */
.scrollToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: transparent;
    border: none;
    border-radius: 150%;
    cursor: pointer;
    display: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.scrollToTop.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.scrollToTop.hide {
    opacity: 0;
    transform: translateY(20px);
}

/* Smooth scrolling for navigation links */
html {
    scroll-behavior: smooth;
}