/* HERE */
/* === GLOBAL RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #000;
  color: white;
  overflow: hidden;
}

/* === BACKGROUND POSTER === */
#bg-poster{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 1;
  transition: opacity .6s ease;
  display: block;
  visibility: visible;
  background-color: #000;
}

/* === BACKGROUND VIDEO (lazy-loaded) === */
#bg-video{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  opacity: 0 !important; /* Force initial opacity */
  transition: opacity .6s ease;
  background-color: #000;
}

/* Second video element for mobile hard cut */
#bg-video-2 {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 0s;
  background-color: #000;
  pointer-events: none;
}

/* When video has real frames */
body.video-ready #bg-video { 
  opacity: 1 !important; /* Override any inline styles */
}
body.video-ready #bg-poster { 
  opacity: 0; 
}

/* === OVERLAY === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

/* === LANGUAGE SWITCHER === */
.language-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(30, 30, 30, 0.85);
  padding: 8px 18px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.lang-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 2px 4px;
  white-space: nowrap;
}

.lang-link:hover { color: rgba(255, 255, 255, 0.9); }
.lang-link.active { color: #1e90ff; font-weight: 600; }

.lang-separator {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

/* === MAIN CONTENT BOX === */
.content-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.5);
  transform-origin: center;
  background: rgba(30, 30, 30, 0.6);
  padding: 40px 25px 25px;
  border-radius: 12px;
  text-align: center;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  z-index: 10;
  backdrop-filter: blur(2px);
}

/* Language width tweaks - wider for ES/DE to fit longer text with same padding as EN */
.content-box-german { max-width: 600px; }
.content-box-spanish { max-width: 600px; }

/* Desktop: prevent wrap for ES / DE subtitle - keep all text on one line */
.content-box-german > p:first-of-type,
.content-box-spanish > p:first-of-type {
  white-space: nowrap;
  text-align: center;
}

h1 {
  font-size: 2em;
  margin-bottom: 15px;
  text-align: center;
}

p {
  font-size: 1.05em;
  line-height: 1.5;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* === TAGLINE (all languages) === */
.content-box > p:first-of-type {
  font-size: 1.2em;
  font-weight: 400;
  margin-bottom: 18px;
  text-align: center;
}

form {
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  width: fit-content;
  max-width: 100%;
}

input[type="email"] {
  padding: 12px;
  width: 320px;
  border: none;
  border-radius: 5px 0 0 5px;
  font-size: 14px;
}

button {
  padding: 12px 20px;
  border: none;
  background: #1e90ff;
  color: white;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

button:hover { background: #0077cc; }

/* === THANK YOU MESSAGE === */
.thank-you-message {
  color: white !important;
  font-size: 1.4em !important;
  font-weight: normal !important;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}

/* More specific selector to override p rule */
form .thank-you-message,
.content-box .thank-you-message {
  font-size: 1.6em !important;
}

.privacy {
  margin-top: 15px;
  font-size: 0.85em;
  opacity: 0.8;
}

.privacy a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.privacy a:hover {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

/* === THANK YOU MESSAGE === */
.thank-you-message {
  color: white;
  font-size: 1em;
  font-weight: 500;
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

/* Ensure it's properly sized within the form */
form .thank-you-message {
  font-size: 1em;
}

/* === PRIVACY MODAL === */
.privacy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.privacy-modal.active {
  opacity: 1;
  visibility: visible;
}

.privacy-modal-content {
  background: rgba(30, 30, 30, 0.95);
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  text-align: center;
}

.privacy-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.privacy-modal-close:hover {
  color: rgba(255, 255, 255, 1);
}

.privacy-modal-content h3 {
  color: white;
  font-size: 1.8em;
  margin-bottom: 18px;
  padding-right: 30px;
  text-align: center;
}

.privacy-modal-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1em;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}

.privacy-modal-content a {
  color: #1e90ff;
  text-decoration: none;
  border-bottom: 1px solid #1e90ff;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.privacy-modal-content a:hover {
  color: #0077cc;
  border-color: #0077cc;
}

/* === SOCIALS === */
.socials {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.socials a img {
  width: 42px;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
}

.socials .logo-bottom {
  width: 260px;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.6));
}

/* === TABLET === */
@media (max-width: 1280px) and (min-width: 768px) {
  .content-box {
    transform: translate(-50%, -50%) scale(1.3);
    max-width: 520px;
  }
}

/* === MOBILE VIDEO SCALING (up to 1024px to match JS detection) === */
@media (max-width: 1024px) {
  /* Zoom video content to crop out black areas that appear from horizontal shifting */
  /* Scale transforms the video content itself, zooming in so black edges are cropped */
  /* Body already has overflow: hidden, so scaled content beyond viewport is hidden */
  #bg-video, #bg-video-2 {
    transform: scale(1.2) !important;
    transform-origin: center center;
  }
}

/* === MOBILE === */
@media (max-width: 767px) {

  /* Bigger language switcher on mobile */
  .language-switcher {
    top: 16px;
    right: 16px;
    font-size: 15px;
    padding: 10px 18px;
    gap: 10px;
    border-radius: 24px;
  }

  .content-box {
    transform: translate(-50%, -50%) scale(1);
    max-width: 90%;
    padding: 32px 28px 24px;
  }

  h1 { font-size: 1.9em; }
  p  { font-size: 0.95em; }

  /* Stronger tagline on mobile */
  .content-box > p:first-of-type {
    font-size: 1.25em;
    max-width: 22ch; /* improve EN wrapping (avoid orphan word) */
  }

  /* ES / DE: allow wrapping on mobile */
  .content-box-german > p:first-of-type,
  .content-box-spanish > p:first-of-type {
    white-space: normal;
    max-width: none;
    line-height: 1.35;
  }

  form {
    flex-direction: column;
    gap: 10px;
  }

  input[type="email"] {
    width: 100%;
    max-width: 450px;
    border-radius: 5px;
  }
  
  button {
    width: 100%;
    max-width: 450px;
    border-radius: 5px;
  }

  .socials {
    flex-direction: column;
    gap: 15px;
  }

  .socials .logo-bottom {
    width: auto;
    height: 60px;
  }

  /* Reduce spacing between COMING SOON and tagline on initial page (mobile only) */
  .content-box h1 {
    margin-bottom: 15px !important; /* Slightly increased spacing between h1 and tagline */
  }

  /* Tagline spacing - reduce top margin when visible */
  .content-box .tagline {
    margin-top: 8px !important;
    margin-bottom: 20px !important;
  }

  /* Normal form spacing when tagline is visible (initial page state) */
  .content-box form {
    margin-top: 15px !important; /* Reduced spacing after h1 when tagline visible */
  }

  /* More space between COMING SOON and thank you message when thank you is shown */
  /* Applied via inline styles in JavaScript - form gets margin-top when thank you is displayed */
  form .thank-you-message {
    margin-bottom: 30px !important;
  }
}
