document.addEventListener('DOMContentLoaded', function (){const __lang=((document.documentElement&&document.documentElement.lang)||'en').toLowerCase().slice(0,2);const __I18N={en:{contact_thanks:'Thank you for your message! We will get back to you soon.',subscribe_thanks:'Thank you for subscribing!'},de:{contact_thanks:'Vielen Dank für Ihre Nachricht! Wir melden uns in Kürze bei Ihnen.',subscribe_thanks:'Danke fürs Abonnieren!'},es:{contact_thanks:'¡Gracias por tu mensaje! Te responderemos pronto.',subscribe_thanks:'¡Gracias por suscribirte!'},fr:{contact_thanks:'Merci pour votre message ! Nous vous répondrons rapidement.',subscribe_thanks:'Merci pour votre inscription !'},it:{contact_thanks:'Grazie per il tuo messaggio! Ti risponderemo presto.',subscribe_thanks:'Grazie per esserti iscritto!'},pt:{contact_thanks:'Obrigado pela sua mensagem! Entraremos em contato em breve.',subscribe_thanks:'Obrigado por assinar!'},nl:{contact_thanks:'Bedankt voor je bericht! We nemen snel contact met je op.',subscribe_thanks:'Bedankt voor je inschrijving!'},pl:{contact_thanks:'Dziękujemy za wiadomość! Odezwiemy się wkrótce.',subscribe_thanks:'Dziękujemy za zapis!'}};const __t=(key)=>((__I18N[__lang]&&__I18N[__lang][key])||(__I18N.en&&__I18N.en[key])||key);const menuBtn=document.querySelector('[data-js="mobile-menu-btn"]');const nav=document.querySelector('[data-js="nav"]');if (menuBtn&&nav){menuBtn.addEventListener('click', function (){nav.classList.toggle('active');menuBtn.classList.toggle('active');});nav.querySelectorAll('a').forEach(link=>{link.addEventListener('click',()=>{nav.classList.remove('active');menuBtn.classList.remove('active');});});} try {const path=(window.location.pathname||'').toLowerCase();let key='index';if (path.endsWith('/about.html'))key='about';else if (path.endsWith('/services.html'))key='services';else if (path.endsWith('/portfolio.html'))key='portfolio';else if (path.endsWith('/faq.html'))key='faq';else if (path.includes('/blog-')||path.endsWith('/blog.html'))key='blog';else if (path.endsWith('/contact.html'))key='contact';else if (path.endsWith('/index.html')||path==='/'||path==='')key='index';document.querySelectorAll('[data-nav]').forEach(a=>{a.classList.toggle('active',(a.getAttribute('data-nav')||'')===key);});} catch (e){} const cookieBanner=document.getElementById('cookieBanner');const acceptBtn=document.getElementById('acceptCookies');const declineBtn=document.getElementById('declineCookies');if (cookieBanner&&!localStorage.getItem('cookieConsent')){cookieBanner.style.display='flex';} if (acceptBtn){acceptBtn.addEventListener('click', function (){localStorage.setItem('cookieConsent','accepted');cookieBanner.style.display='none';});} if (declineBtn){declineBtn.addEventListener('click', function (){localStorage.setItem('cookieConsent','declined');cookieBanner.style.display='none';});} const contactForm=document.getElementById('contactForm');if (contactForm){contactForm.addEventListener('submit', function (e){e.preventDefault();alert(__t('contact_thanks'));contactForm.reset();});} const newsletterForm=document.querySelector('[data-js="newsletter-form"]');if (newsletterForm){newsletterForm.addEventListener('submit', function (e){e.preventDefault();alert(__t('subscribe_thanks'));newsletterForm.reset();});} const observerOptions={threshold:0.1,rootMargin:'0px 0px -50px 0px'};const observer= new IntersectionObserver((entries)=>{entries.forEach(entry=>{if (entry.isIntersecting){entry.target.style.opacity='1';entry.target.style.transform='translateY(0)';}});},observerOptions);document.querySelectorAll('[data-reveal]').forEach(el=>{el.style.opacity='0';el.style.transform='translateY(20px)';el.style.transition='opacity 0.6s ease, transform 0.6s ease';observer.observe(el);});const aosObserver= new IntersectionObserver((entries)=>{entries.forEach(entry=>{if (entry.isIntersecting){entry.target.classList.add('aos-animate');}});},{threshold:0.1});document.querySelectorAll('[data-aos]').forEach(el=>aosObserver.observe(el));document.querySelectorAll('[data-js="faq-question"]').forEach(button=>{button.addEventListener('click',()=>{const item=button.closest('[data-js="faq-item"]');if (!item) return;const isActive=item.classList.contains('active');document.querySelectorAll('[data-js="faq-item"]').forEach(i=>i.classList.remove('active'));if (!isActive)item.classList.add('active');});});}); !function(){"use strict";let e=document.getElementById("feedbackForm"),t=!1;async function i(i){i.preventDefault();let s=e.querySelector('button[type="submit"]'),n=s.textContent;try{s.disabled=!0,s.textContent="Loading...",t||await new Promise((e,i)=>{if(window.emailjs){e();return}let r=document.createElement("script");r.src="https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js",r.onload=()=>{t=!0,emailjs.init("J4sr_VNUBr1-msXR1"),e()},r.onerror=()=>i(Error("Failed to load EmailJS")),document.head.appendChild(r)}),s.textContent="Sending...";let o=e.querySelector("#name").value.trim(),a=e.querySelector("#email").value.trim(),l=e.querySelector("#phone").value.trim(),c=e.querySelector("#subject").value.trim(),m=e.querySelector("#message").value.trim(),u=[];if(o||u.push("The 'name' field is required."),a||u.push("The 'email' field is required."),c||u.push("The 'subject' field is required."),m||u.push("The 'message' field is required."),a&&!a.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)&&u.push("Incorrect email address"),o.length>100&&u.push("Name is too long (max. 100 characters)"),c.length>200&&u.push("Subject is too long (max. 200 characters)"),m.length>5e3&&u.push("Message is too long (max. 5000 characters)"),u.length>0){r("Validation error:\n"+u.join("\n"),"error");return}await emailjs.send("service_s4612tv","template_vye5fu3",{from_name:o,from_email:a,phone:l,subject:c,message:m}),r("Your message has been successfully sent! We will contact you shortly.","success"),e.reset()}catch(d){console.error("Error:",d),r("An error occurred. Please try again.","error")}finally{s.disabled=!1,s.textContent=n}}function r(e,t="success"){let i=document.querySelector(".form-notification");i&&i.remove();let r=document.createElement("div");r.className=`form-notification form-notification--${t}`,r.innerHTML=`