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

html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    font-family: Arial, sans-serif;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: #35424a;
    color: #ffffff;
    padding: 10px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2e8b57;
    padding: 0 40px;
    height: 60px;
    gap: 20px;
}

.logo {
    color: #fff;
    font-size: 1.5em;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px; /* Tarpas tarp meniu punktų */
}

.nav-links a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-links a:hover,
.nav-links a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 6px; /* Atnaujinta pozicija dėl didesnio padding */
    left: 50%;
    transform: translateX(-50%);
    /* Pakeistas plotis, kad linija atitiktų mygtuko plotį (visas plotis minus horizontalus padding) */
    width: calc(100% - 36px);
    height: 2px;
    background-color: #ffffff;
    border-radius: 1px;
}



main {
    flex: 1;
    /* 'min-height: 0' yra svarbus flexbox pataisymas, kuris neleidžia elementui išsiplėsti daugiau nei jam skirta vieta, */
    /* ypač kai viduje yra turinio, turinčio savo minimalų aukštį. */
    min-height: 0; 
    /* Nustatome 'position: relative', kad 'main' taptų pozicionavimo kontekstu viduje esančiam video elementui. */
    /* Tai leidžia video elementui su 'position: absolute' užpildyti visą 'main' erdvę. */
    position: relative;
}

#main-video {
    /* Naudojame absoliutų pozicionavimą, kad video būtų atskirtas nuo dokumento srauto ir užpildytų visą tėvinį 'main' elementą. */
    /* Tai yra patikimas būdas užtikrinti, kad video prisitaikys prie jam skirtos erdvės, kurią apskaičiuoja flexbox. */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

footer {
    background: #2e8b57; /* pastovi žalia spalva */
    color: #ffffff;
    text-align: center;
    /* Pridėtas papildomas tarpas apačioje (padding-bottom), kad Android navigacijos juosta neuždengtų poraštės. */
    /* 30px viršuje, 50px apačioje. */
    padding: 30px 0 50px;
    display: flex;
    justify-content: center; /* Išcentruoja turinį horizontaliai */
    width: 100%;
}

.footer-segment {
    flex: 1;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.7s;
    border-right: 2px solid #fff;
}

.footer-segment:last-child {
    border-right: none;
}

#footer-text {
    margin: 0;
    padding: 0;
    color: #fff;
}

.lang-switcher {
    position: relative;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.lang-btn .current-lang-flag {
    height: 20px;
    width: auto;
    border-radius: 3px;
    border: 1px solid #ddd;
    transition: opacity 0.2s;
}

.lang-btn span {
    color: #fff;
    margin-left: 5px;
    font-size: 0.8em;
}

.lang-btn:hover .current-lang-flag {
    opacity: 0.8;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    min-width: auto;
    padding: 5px;
    flex-direction: column;
}

.lang-dropdown.show {
    display: flex;
}

.lang-option {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: block;
    width: 100%;
    transition: background-color 0.2s;
}

.lang-option:hover {
    background-color: #f0f0f0;
}

.lang-option img {
    height: 20px;
    width: auto;
    display: block;
    border-radius: 3px;
}

.divider-wave {
    width: 100%;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg width="120" height="40" viewBox="0 0 120 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 20 Q 30 0 60 20 T 120 20 V40 H0 V20 Z" fill="%232e8b57"/></svg>');
    background-repeat: repeat-x;
    background-size: 120px 40px;
}

.subpage-bg {
    background: url('../images/background.jpg') center center/cover no-repeat fixed;
    width: 100%;
    box-sizing: border-box;
    flex: 1 0 auto;
    min-height: 0;
    padding: 40px 0 40px 0;
}


/* Nauja klasė turinio blokui antriniuose puslapiuose */
.subpage-content {
    background: rgba(255, 255, 255, 0.92);
    outline: none;
    max-width: 700px;
    color: #222;
    padding: 24px;
    border-radius: 12px;
    font-size: 1.15em;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    margin: 0 auto;
}
.subpage-content h2 {
    color: #2e8b57;

}

/* Stiliai kontaktų formai */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0; /* Pataisyta, kad forma būtų centruota horizontaliai */
}

.contact-form label {
    font-weight: bold;
    color: #35424a;
    font-size: 0.9em;
}

.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    font-family: Arial, sans-serif;
    transition: border-color 0.2s;
}

.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #2e8b57; /* Žalia spalva iš temos */
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form button[type="submit"] {
    background: #e8491d; /* Oranžinė spalva iš temos */
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background 0.2s;
    width: fit-content;
    margin: 0 auto; /* Adjust width to fit content */
}

.contact-form button[type="submit"]:hover {
    background: #d7380c;
}

.contact-details {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.contact-details p {
    font-size: 1.1em;
    color: #333;
}

.subpage-content p {
    margin-top: 10px; /* Give direct contacts some space */
    font-size: 1em;
    overflow: hidden;
}

/* Paslaugų skilčių stiliai */
.service-section {
    margin-top: 20px;
}

.service-section h3 {
    color: #35424a; /* Tamsiai mėlyna iš temos */
    border-bottom: 2px solid #e8491d; /* Oranžinė iš temos */
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.service-section ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.service-section li {
    padding: 5px 0 5px 25px;
    position: relative;
}

.service-section li::before {
    content: '✓';
    color: #2e8b57; /* Žalia iš temos */
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Stiliai video subtitrams geresniam matomumui */
#main-video::cue {
    background-color: rgba(0, 0, 0, 0.6); /* Pusiau permatomas juodas fonas */
    color: #ffffff; /* Balta teksto spalva */
    font-size: 1.2rem; /* Šiek tiek didesnis šriftas */
    text-shadow: 1px 1px 2px black; /* Šešėlis geresniam matomumui */
}

/* Galerijos stiliai (Masonry Layout) */
.gallery-grid {
    /* Paprastas "masonry" išdėstymas naudojant CSS stulpelius */
    column-count: 3; /* Stulpelių skaičius dideliems ekranams */
    column-gap: 1rem;
}

.gallery-item {
    /* Neleidžia perlaužti elemento per stulpelius */
    break-inside: avoid;
    margin-bottom: 1rem;
    cursor: pointer; /* Parodo, kad elementas yra paspaudžiamas */
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto; /* Išlaiko nuotraukos proporcijas */
    display: block;
    border-radius: 8px; /* Švelniai užapvalinti kampai */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.03); /* Švelnus padidinimo efektas užvedus pelę */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Išdėstymo pritaikymas skirtingų dydžių ekranams (responsive) */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        justify-content: flex-start;
        height: auto;
        padding: 10px 8px;
        gap: 10px;
    }
    .nav-links {
        gap: 8px; /* Sumažintas tarpas mobilioje versijoje */
        padding: 0;
        margin: 0;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        /* Paslėpti slinkties juostą, bet palikti galimybę slinkti */
        scrollbar-width: none; /* Firefox */
    }
    .nav-links::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    .subpage-content {
        padding: 20px;
        font-size: 1em;
    }
    .contact-form button[type="submit"] {
        width: 100%;
    }
    footer {
        padding: 20px 0;
    }
    .footer-segment {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    }
    .footer-segment:last-child {
        border-bottom: none;
    }
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        column-count: 1;
    }
}

/* Lightbox (iššokančio lango) stiliai */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none; /* Pagal nutylėjimą paslėptas */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#lightbox-overlay.show {
    display: flex; /* Rodo, kai pridedama 'show' klasė */
    opacity: 1;
}

#lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-content img,
#lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    outline: none; /* Pašalina focus rėmelį ant video */
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #bbb;
}