/* mobile.css - Korrigierte Version */

/* Allgemeine Definitionen (Variablen) */
:root {
  --primary-color: orange;
  --secondary-color: white;
  --background-dark: #2e2e2e;
  --dark-gray: #444;
  --light-gray: #ccc;
  --button-bg: #3c3c3c;
  --button-border: orange;
  --button-hover-bg: orange;
  --button-hover-text: black;
  --highlight-text: #FFD700;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --border-color: #555;
  --transition-speed: 0.3s;
}

body {
  margin: 0;
  padding: 0;
  background: var(--background-dark);
  color: var(--secondary-color);
  font-family: 'Orbitron', sans-serif;
  text-align: center;
}

/* === Header === */
header h1 {
  font-size: clamp(1.8rem, 7vw, 3.5rem);
  text-align: center;
  margin: 20px 0 5px;
  color: var(--primary-color);
  text-shadow: 2px 2px 4px var(--shadow-color);
  line-height: 1em;
}

header p {
  text-align: center;
  font-size: clamp(0.9rem, 3.5vw, 1.1rem);
  margin-bottom: 15px;
  color: var(--secondary-color);
  text-shadow: 1px 1px 2px var(--shadow-color);
  line-height: 1em;
}

/* === Hauptinhalt === */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px; /* Dieser Abstand zum Rand ist für alle Elemente entscheidend */
}

/* === Webcam-Bild === */
.webcam-img {
  max-width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 15px var(--shadow-color);
  margin: 10px auto;
  cursor: pointer;
  transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
  display: block;
  object-fit: cover;
}

.webcam-img:hover {
  transform: scale(1.01);
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px var(--shadow-color);
}

/* === Buttons unter der Webcam === */
.buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
  width: 100%;
  max-width: 400px;
}

.buttons button, .buttons a {
  background-color: var(--dark-gray);
  color: var(--secondary-color);
  border: 2px solid var(--border-color);
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color var(--transition-speed), border-color var(--transition-speed), transform var(--transition-speed), opacity var(--transition-speed);
  box-shadow: 0 2px 8px var(--shadow-color);
  font-family: "Orbitron", sans-serif;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  display: block;
}

.buttons button:hover, .buttons a:hover {
  background-color: var(--primary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
  color: var(--button-hover-text);
}

/* === Besucher-Zähler === */
.counter {
  margin: 10px 0 20px;
  font-size: 1.1em;
  color: var(--primary-color);
  font-weight: bold;
}

/* === Lightbox-Overlay === */
.lightbox,
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(5px);
}

.lightbox.show,
.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* === Lightbox-Inhalte === */
.lightbox-content,
.contact-box {
  background-color: var(--background-dark);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 30px var(--shadow-color);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--secondary-color);
  text-align: left;
}

/* === Lightbox Close Button === */
.lightbox-close,
.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 2.2em;
  color: var(--primary-color);
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 1001;
}

.lightbox-close:hover,
.share-close:hover {
  transform: rotate(90deg);
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 8px;
  box-shadow: 0 8px 30px var(--shadow-color);
  display: block;
}

/* Formularfelder im Kontaktformular */
.lightbox-content input,
.lightbox-content textarea {
  width: calc(100% - 20px);
  margin: 8px 0;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--background-dark);
  color: var(--secondary-color);
  font-family: 'Orbitron', sans-serif;
  box-sizing: border-box;
  transition: border-color var(--transition-speed);
}

.lightbox-content input:focus,
.lightbox-content textarea:focus {
  border-color: var(--primary-color);
  outline: none;
}

.lightbox-content textarea {
  resize: vertical;
  height: 80px;
}

.lightbox-content h2 {
  color: var(--primary-color);
  font-size: 1.5em;
  margin-bottom: 20px;
}

.lightbox-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.lightbox-content a:hover {
  text-decoration: underline;
}

/* CAPTCHA-Bild im Kontaktformular */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.captcha-container img {
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  height: 40px;
}

.captcha-container .input-wrapper {
  flex-grow: 1;
  margin-bottom: 0;
}

.captcha-container input[type="text"] {
  width: 100%;
}

.contact-box .button-group {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* === Wetter-Ticker Box (Wichtig für den Lauftext) === */
.weather-ticker-wrapper {
    background-color: var(--background-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 10px;
    /* Reduzierter unterer Abstand für bessere Kohärenz */
    margin: 10px auto 15px auto; 
    overflow: hidden; /* Versteckt den Text, der außerhalb des Containers ist */
    white-space: nowrap; /* Verhindert Zeilenumbrüche */
    position: relative;
    display: flex;
    align-items: center;
    width: 100%; /* Die Breite passt sich nun immer an den Container an */
    max-width: 400px; /* Standard-Breite für Porträt und größere Bildschirme */
    box-sizing: border-box; /* Sicherstellen, dass padding und border zur Gesamtbreite gehören */
    margin-bottom: 0px;
}

/* Media-Query für Querformat (Handy) */
@media (orientation: landscape) {
    .weather-ticker-wrapper {
        max-width: 100%; /* In der Querformat-Ansicht nimmt die Box die volle Breite des Eltern-Containers an */
    }
}

/* Die Lauftext-Animation selbst */
#weather-ticker {
    display: inline-block;
    padding-left: 100%; /* Startet den Text am rechten Rand */
    animation-name: marquee;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    /* Die Geschwindigkeit (animation-duration) wird später durch JavaScript gesetzt */
}

/* Die @keyframes-Regel für die Bewegung */
@keyframes marquee {
    0%   { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}

/* Countdown & Status */
#refreshCountdown,
#btn-updateInfo,
#btn-countdown {
  background-color: var(--dark-gray);
  color: var(--secondary-color);
  border: 2px solid var(--border-color);
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow-color);
  font-family: "Orbitron", sans-serif;
  width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-speed);
}

#btn-updateInfo,
#btn-countdown {
  pointer-events: none;
  color: var(--primary-color);
}

#btn-countdown .countdown-seconds {
  color: var(--primary-color);
  font-weight: bold;
  transition: color 0.3s ease;
}

.webcam-status {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  margin-top: 10px;
  color: var(--primary-color);
}

#loadingMessage {
  font-weight: bold;
  animation: blink 1.2s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}
