:root {
  --primary: #FF3366;
  --secondary: #772CE8;
  --bg-dark: #120e1f;
  --text-light: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --font-main: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at center, #1a162b 0%, #120e1f 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
  background: var(--primary);
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
}

.blob-2 {
  background: var(--secondary);
  width: 400px;
  height: 400px;
  bottom: -150px;
  right: -100px;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(30px) scale(1.1);
  }
}

.container {
  width: 90%;
  max-width: 500px;
  padding: 2.5rem;
  border-radius: 24px;
  z-index: 10;
  margin: 2rem 0;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #FF3366, #FF9933);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: #ccc;
  font-weight: 300;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

input[type="text"],
select {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.3);
}

option {
  background: var(--bg-dark);
  color: #fff;
}

input[type="file"] {
  display: none;
}

.custom-file-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  background: rgba(0, 0, 0, 0.1);
}

.custom-file-upload:hover {
  border-color: var(--primary);
  background: rgba(255, 51, 102, 0.05);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

#fileNameDisplay {
  font-weight: 400;
  font-size: 0.9rem;
  color: #ddd;
}

.preview-container {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.preview-img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  border: 2px solid var(--glass-border);
}

.btn-primary {
  width: 100%;
  padding: 1.2rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
  margin-top: 1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 51, 102, 0.6);
}

.btn-primary:active {
  transform: translateY(1px);
}

#statusMessage {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.4);
}

.error {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.4);
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 2rem;
  z-index: 10;
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.dashboard-link {
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

.dashboard-link:hover {
  color: white;
  background: rgba(0, 0, 0, 0.6);
}

/* Dashboard Styles */
body.dashboard-body {
  overflow: hidden !important;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  background-color: #050505;
  position: fixed;
  top: 0;
  left: 0;
}
/* This only affects the dashboard because of the body class */
body.dashboard-body::-webkit-scrollbar {
  display: none;
}



.dashboard-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 40px;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FF3366, #FF9933);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dashboard-subtitle {
  font-size: 1.1rem;
  color: #ddd;
  font-weight: 300;
}

.highlight-url {
  font-weight: 700;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  margin-left: 5px;
}

.slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden !important; /* Contain the scaling images */
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out, transform 8s linear;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  overflow: hidden !important; /* Ensure children don't cause scrollbars */
}

.slide.active {
  opacity: 1;
  z-index: 10;
}

.slide.active .slide-bg,
.slide.active .slide-img {
  transform: scale(1.05);
}

/* Add a blurred background image for the slide container to fill letterboxes */
.slide-bg {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.3);
  z-index: 0;
  transition: transform 8s linear;
  will-change: transform;
}

.slide-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
  transition: transform 8s linear;
  will-change: transform;
}

.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 60px 40px 40px 200px;
  /* links: Platz für QR-Code (180px + 20px Puffer) */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.7), transparent);
  text-align: center;
  z-index: 5;
}

.slide-challenge {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 15px;
  color: white;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.slide-author {
  font-size: 1.5rem;
  color: #FF9933;
  font-weight: 600;
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 20px;
  border-radius: 30px;
  backdrop-filter: blur(10px);
}

.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  opacity: 0.5;
  animation: float 4s infinite alternate ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.8;
  }
}

.uploading {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.uploading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  100% {
    left: 200%;
  }
}

/* ── QR-Code Ecke ────────────────────────────────────────────────────────── */
.qr-corner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(12px);
  opacity: 0.85;
  transition: opacity 0.3s;
}

.qr-corner:hover {
  opacity: 1;
}

#qrCanvas img,
#qrCanvas canvas {
  border-radius: 8px;
  display: block;
}

.qr-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.controls-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
}

.dashboard-body:hover .controls-overlay {
  opacity: 1;
}

/* Button im Vollbild ausblenden – F-Taste übernimmt */
:fullscreen .controls-overlay,
:-webkit-full-screen .controls-overlay,
:-moz-full-screen .controls-overlay {
  display: none;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* ── Portrait-Modus (Dashboard & 1080x2560 Optimization) ───────────────────── */
@media (orientation: portrait) {

  /* Dashboard Header: Dezent oben fixiert */
  .dashboard-header {
    padding: 30px;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  }

  .dashboard-title {
    font-size: 4.2rem;
    letter-spacing: 5px;
    background: linear-gradient(135deg, #FF3366, #FF9933);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
  }

  /* Slide: Flexbox-Layout für vertikale Stapelung */
  .slide {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 14rem;
  }

  /* Slide-Img: Mittig platziert */
  .slide-img {
    position: relative;
    top: auto;
    left: auto;
    width: 94%;
    height: 48vh;
    margin: 30px auto;
    border-radius: 40px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    box-shadow: none; /* Shadow removed */
    border: none !important;
  }

  /* Slide-Content: Jetzt UNTER dem Foto */
  .slide-content {
    position: relative;
    bottom: auto;
    left: auto;
    width: 100%;
    padding: 20px 50px;
    background: transparent;
    text-align: center;
  }

  .slide-challenge {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 30px;
    text-shadow: 0 5px 25px rgba(0, 0, 0, 0.9);
    background: linear-gradient(135deg, #fff, #ffcc33);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.6));
    font-weight: 800;
  }

  .slide-author {
    font-size: 2.5rem;
    padding: 15px 50px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* QR-Code: Ganz unten */
  .qr-corner {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translate3d(-50%, 0, 0); /* Locked in place */
    top: auto;
    right: auto;
    padding: 0;
    background: none;
    border: none !important;
    backdrop-filter: none;
    width: auto;
    gap: 30px;
    z-index: 200;
  }

  /* Stabilized container for QR + Label */
  #qrCorner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: none !important;
    border-radius: 50px;
    padding: 40px 50px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
  }


  #qrCanvas img,
  #qrCanvas canvas {
    width: 450px !important;
    height: 450px !important;
    border: 20px solid white;
    border-radius: 25px;
  }

  .qr-label {
    font-size: 3.5rem;
    color: white;
    letter-spacing: 8px;
    font-weight: 800;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  }
}

.selected-challenge-display {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.1rem 1rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  text-align: center;
  margin-bottom: 5px;
  transition: all 0.3s ease;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selected-challenge-display.clickable {
  cursor: pointer;
  border-color: rgba(255, 255, 255, 0.3);
}

.selected-challenge-display.clickable:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.selected-challenge-display.placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* Modal for choosing challenge */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: 90%;
  max-width: 450px;
  max-height: 80vh;
  border-radius: 24px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0;
  background: linear-gradient(135deg, #FF3366, #FF9933);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.close-btn:hover {
  opacity: 1;
}

.challenge-list {
  overflow-y: auto;
  padding-right: 5px;
  display: grid;
  gap: 0.75rem;
}

/* Custom scrollbar for modal */
.challenge-list::-webkit-scrollbar {
  width: 6px;
}

.challenge-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.challenge-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.challenge-option {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
}

.challenge-option:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
  transform: translateX(5px);
}

.challenge-option.selected {
  background: rgba(255, 51, 102, 0.15);
  border-color: var(--primary);
  color: #fff;
}