/* ========================================
   iOS SAFE AREA SUPPORT
   ======================================== */
/* FORCE JAVASCRIPT CONTROL - GANZ OBEN EINFÜGEN */
#video[style*="transform"] {
  transform: inherit !important;
  -webkit-transform: inherit !important;
}

body {
  font-family: arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  position: relative;
  
  /* iOS Safe Area */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

html {
  -webkit-text-size-adjust: none;
  -ms-text-size-adjust: none;
  text-size-adjust: none;
}

/* ========================================
   OVERLAY & BANNER
   ======================================== */

#no-stream-overlay {
  position: absolute;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 150%;
  background-color: rgba(0, 0, 0, 1);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  z-index: 30;
}

#no-stream-overlay img {
  margin-bottom: 20px;
}

#banner {
  position: absolute;
  top: env(safe-area-inset-top, 0);
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 20px;
  font-weight: bold;
  z-index: 10;
}

/* ========================================
   VIDEO CONTAINER
   ======================================== */

#video-container {
  position: relative;
  width: 100%;
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Nur auf iPhones Safari: Klicks auf Video deaktivieren */
@supports (-webkit-touch-callout: none) {
  #video {
    pointer-events: none;
  }
}

/* ========================================
   SOUND BUTTON
   ======================================== */

#sound-button-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  padding: 30px;
  cursor: pointer;
  z-index: 20;
  color: white;
  font-size: 18px;
  font-weight: bold;
  
  /* iOS Touch Feedback */
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#sound-button-container:active {
  transform: translate(-50%, -50%) scale(0.95);
  transition: transform 0.1s;
}

/* ========================================
   RESPONSIVE MEDIA QUERIES - NUR LAYOUT, KEIN ZOOM
   ======================================== */

/* Overflow hidden für Handys */
@media (max-width: 680px) {
  #video-container {
    overflow: hidden;
  }
}

/* Landscape Mode auf Handys - NUR Layout-Anpassungen */
@media (max-width: 896px) and (orientation: landscape) {
  #banner {
    font-size: 14px;
    padding: 5px 0;
  }
  
  #comments-container {
    height: 80px;
    bottom: 45px;
  }
  
  footer {
    padding: 5px 0;
  }
}

/* ========================================
   FOOTER & COMMENTS
   ======================================== */

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: absolute;
  bottom: 0;
  background-color: #fff;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
  z-index: 20;
}

#comment {
  width: 85%;
  padding: 10px;
  border-radius: 0px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#submit-comment {
  width: 13%;
  padding: 10px;
  border-radius: 0px;
  background-color: #4CAF50;
  color: white;
  border: none;
  font-size: 14px;
}

#comments-container {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 150px;
  max-width: 400px;
  width: 100%;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 10px;
  margin: 0 auto;
  color: white;
  transition: background-color 0.3s ease;
}

#comments-container.dark-bg {
  background-color: rgba(0, 0, 0, 0.7);
}

#comments-list {
  font-size: 16px;
  height: 100%;
  overflow-y: auto;
}

/* ========================================
   POPUPS & MODALS
   ======================================== */

#name-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 9999;
}

#name-popup input {
  padding: 10px;
  width: 200px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#name-popup button {
  padding: 10px;
  border-radius: 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  font-size: 14px;
}

#share-menu {
  display: none;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 10000;
  font-size: 16px;
}

/* ========================================
   OPTIMIERTE HERZ-ANIMATION (GPU)
   ======================================== */

.heart {
  position: fixed;
  top: 0;
  font-size: 30px;
  color: red;
  pointer-events: none;
  z-index: 9999;
  
  /* GPU-Beschleunigung aktivieren */
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  
  /* CSS-Animation statt JS */
  animation: heartFall 2.5s linear forwards;
  -webkit-animation: heartFall 2.5s linear forwards;
}

@keyframes heartFall {
  0% {
    transform: translateY(0) translateZ(0);
    -webkit-transform: translateY(0) translateZ(0);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(var(--fall-distance, 70vh)) translateZ(0);
    -webkit-transform: translateY(var(--fall-distance, 70vh)) translateZ(0);
    opacity: 0;
  }
}

@-webkit-keyframes heartFall {
  0% {
    -webkit-transform: translateY(0) translateZ(0);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    -webkit-transform: translateY(var(--fall-distance, 70vh)) translateZ(0);
    opacity: 0;
  }
}

/* Für ältere Browser (Fallback) */
@supports not (animation: heartFall 2.5s) {
  .heart {
    animation: heartFallOld 2.5s linear;
  }
}

@keyframes heartFallOld {
  0% {
    top: 0;
    opacity: 1;
  }
  100% {
    top: 70vh;
    opacity: 0;
  }
}

/* ========================================
   COOKIE BANNER
   ======================================== */

.cookie-banner {
  position: fixed;
  top: 80px;
  left: 0;
  width: 95%;
  background-color: rgba(0, 0, 0, 0.99);
  color: #fff;
  text-align: center;
  padding: 10px;
  z-index: 1000;
  display: none;
  justify-content: center;
}

.cookie-content {
  display: inline-block;
  max-width: 600px;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 15px;
  border-radius: 5px;
  text-align: center;
}

.cookie-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  
  /* Touch Feedback */
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  touch-action: manipulation;
}

.cookie-button:hover {
  background-color: #45a049;
}

.cookie-button:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}

/* Hintergrund abdunkeln */
body.overlay {
  background-color: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* ========================================
   COUNTDOWN
   ======================================== */

#countdown {
  background: #FFD700;
  max-width: 300px;
  color: #000000;
  padding: 5px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  margin: 0 auto;
  font-weight: bold;
}

/* ========================================
   HONEYPOT (SPAM PROTECTION)
   ======================================== */

.honeypot-field {
  position: absolute;
  left: -9999px;
}

/* ========================================
   NOTFALL-FIX: FORCE ZOOM 3X AUF HANDYS
   ======================================== */

@media (max-width: 680px) and (orientation: portrait) {
  #video {
    transform: scale(3) translateZ(0) !important;
    -webkit-transform: scale(3) translateZ(0) !important;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  #video {
    transform: scale(3.5) translateZ(0) !important;
    -webkit-transform: scale(3.5) translateZ(0) !important;
  }
}