html {
    scroll-behavior: auto;
    /* Handled by custom smooth scroll in JS for a slower and relaxed speed */
}

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

body {
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-size: 200% 200%;
    font-size: 16px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

header {
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: white;
    padding: 1rem 0;
    text-align: center;
}

a:link {
    text-decoration: inherit;
    color: inherit;
}

a:visited {
    text-decoration: inherit;
    color: inherit;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    margin: 6%;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Language Selector - Mobile optimized touch targets */
.language-selector {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: -1rem;
    padding: 0.5rem;
}

.lang-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.lang-btn:hover,
.lang-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
}

.flag {
    width: 20px;
    border-radius: 2px;
}


/* --- Landing Page Styles --- */

.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 28, 67, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    margin-top: 100px;
    padding-top: env(safe-area-inset-top, 0);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    width: 200px;
    padding-bottom: 100px;
    animation: blurIn 1.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes blurIn {
    0% {
        filter: blur(20px);
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        filter: blur(0);
        opacity: 1;
        transform: scale(1);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Outfit', sans-serif;
}

.hero-content p {
    margin: 3em auto 0;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
    color: white;
    max-width: 1200px;
    font-size: 19px;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: #0ea5e9;
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    border: none;
    min-height: 48px;
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-3px);
    background: #0284c7;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

.tappe-section {
    padding: 60px 20px;
    margin: 3em auto 0;
    text-align: center;
    padding-left: 1em;
    padding-right: 1em;
    color: white;
    max-width: 800px;
    min-height: 100vh;


}

.section-title {
    text-align: center;
    color: white;
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
    font-family: 'Outfit', sans-serif;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 0 auto;
    padding: 0 10px;
}

.card {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 30px 20px;
    text-decoration: none;
    color: white;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    row-gap: 15px;
    text-align: left;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.473);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover,
.card:active {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.473);
}

.card-icon {
    grid-column: 1;
    grid-row: 1;
    width: 50px;
    height: 50px;
    background: #063564;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(255, 255, 255, 0.2);
}

.card h3 {
    grid-column: 2;
    grid-row: 1;
    font-size: 1.35rem;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.card p {
    grid-column: 1 / span 2;
    grid-row: 2;
    font-size: 19px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.5;
}

.card-link {
    grid-column: 1 / span 2;
    grid-row: 3;
    font-weight: 600;
    color: #8adaff;
    font-size: 1.05rem;
}

/* --- Footer --- */
footer {
    background: #121212;
    color: white;
    text-align: center;
    padding: 5rem 1.5rem;
    padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0));
}

footer img {
    max-width: 280px;
    width: 100%;
    height: auto;
}

.sito {
    letter-spacing: 2px;
}

.settantablu {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.google-review {
    display: block;
    margin: 2.5rem auto;
}

.google-review img {
    max-width: 120px;
}

.leaflet {
    margin-top: 2rem;
    opacity: 0.6;
    font-size: 0.85rem;
}

/* Social Media Buttons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 1.5rem;
}

.social-link2 {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0.5rem;
    margin-bottom: 2.5rem;
}

.social-btn {
    color: white;
    font-size: 2.2rem;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.social-btn2 {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.social-btn:hover,
.social-btn:active {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 19px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 24px 16px;
    }
}

@media (max-width: 380px) {
    .hero-content h1 {
        font-size: 1.7rem;
    }

    .language-selector {
        gap: 4px;
    }

    .lang-btn {
        min-width: 40px;
        min-height: 40px;
        font-size: 16px;
    }
}

/* === Map Container === */
#map-container {
    position: relative;
    height: 70vh;
    max-height: 800px;
    margin: 1.5rem auto;
    max-width: 1200px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0);
    padding: 10px;
}

.map-controls button {
    background: #063564;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    min-height: 44px;
    padding: 0 15px;
}

.map-controls button:hover,
.map-controls button:active {
    background: #5a6fd8;
}

.gpx-layer-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gpx-layer-controls h4 {
    margin: 0 0 8px 0;
    color: #063564;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.layer-toggle {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding: 3px 0;
}

.layer-toggle input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.layer-toggle label {
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
    flex: 1;
}

.layer-toggle:hover {
    background: rgba(6, 53, 100, 0.1);
    border-radius: 4px;
    padding: 3px 5px;
}

/* Custom Marker */
.custom-marker {
    background: transparent;
    border: none;
}

/* === Custom map container background === */
.leaflet-container {
    background: #095f74;
}

/* Prevent subpixel tile gaps in Leaflet on mobile browsers */
.leaflet-tile {
    outline: 1px solid transparent;
}