html, body {
    margin: 0;
    padding: 0;
    height: 100%;
  }

  #map {
    width: 100%;
    height: 100vh;
  }

header {
  background-image: linear-gradient(to left, #2765B2, #98B0FF);
  height: clamp(60px, 8vw, 100px);
  width: 100%;
  outline: 5px solid black;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

/*
header .logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: clamp(80px, 15vw, 175px);
  height: auto;
}
*/

header .logo {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  height: clamp(25px, 4vw, 50px); /* jetzt kleiner */
  width: auto;
  object-fit: contain;
}

header h1 {
  flex: 1;
  text-align: center;
  color: white;
  font-size: clamp(20px, 3vw, 35px);
  font-weight: normal;
  margin: 0;
}

header button {
  margin: 10px;
  padding: clamp(6px, 1vw, 12px) clamp(10px, 2vw, 20px);
  /* font-size: clamp(12px, 1.2vw, 18px);*/
  color: white;
  background-image: linear-gradient(to left, #2765B2, #98B0FF);
  border: 2px solid black;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#langToggle {
  position: absolute;
  margin: 10px;
  right: 10px;
  padding: clamp(6px, 1vw, 12px) clamp(10px, 2vw, 20px);
  color: white;
  background-image: linear-gradient(to left, #2765B2, #98B0FF);
  border: 2px solid black;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s;
}

header button:hover {
  background-image: linear-gradient(to left, #2765B2, #98B0FF);
  transform: translateY(-2px);
}
.leaflet-tooltip.custom-tooltip {
  background: white;
  border: 1px solid #ccc;
  padding: 0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.leaflet-tooltip.custom-tooltip img {
  display: block;
  width: 120px;
  height: auto;
  border-radius: 6px;
}
#postcardContent {
  transition: transform 0.3s ease;
}
#postcardContent:hover {
  transform: scale(1.02);
}


    #miniMap {
      height: 400px;
      margin-top: 10px;
      border-radius: 10px;
      border: 2px solid #787878;
      align-self: center;
    }

    .buttoncard {
      display: block;
      text-align:center;
      margin-left: auto;
      margin-right: auto;
      margin-top: 5px;
      background: linear-gradient(90deg, #0044aa, #ffff00);
      color: white;
      border: none;
      border-radius: 30px;
      font-size: 18px;
      padding: 10px 20px;
      cursor: pointer;
    }

    #miniMapouter {
      background-color: white;
      margin-top:30px;
      margin-left:20px;
      margin-right:20px;
      z-index: 300;
    }

    .karte-wrapper {
      perspective: 1500px;
      position: fixed;
      z-index: 2000;
      margin-left: auto;
      margin-right: auto;
      margin-top: 150px;
      top: 0px;
      left: calc(50% - 460px);
    }

    .karte {
      width: 900px;
      height: 550px;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 1s;
    }

    .karte.flip {
      transform: rotateY(180deg);
    }

    .seite {
      position: absolute;
      width: 100%;
      height: 100%;
      background: white;
      border: 8px solid transparent;
      border-image: linear-gradient(to bottom, #0044aa, #ffff00) 1;
      box-shadow: 0 0 15px rgba(0,0,0,0.2);
      backface-visibility: hidden;
      display: flex;
      z-index:0;
    }

    .front { flex-direction: row; }

    /* === Rückseite fix === */
    .back {
      transform: rotateY(180deg);
      position: relative;
      overflow: hidden;
      flex-direction: column;
      padding: 0;
      justify-content: center;
      align-items: center;
      border-image: linear-gradient(to bottom, #ffffff, #ffffff) 1;
    }

    .upload-bereich {
      position: absolute;
      inset: 0;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    #previewImage {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      border: none;
      display: none;
      transition: opacity 0.5s ease;
    }

    #previewImage.active {
      display: block;
      opacity: 1;
    }

    .upload-bereich button {
      position: absolute;
      bottom: 25px;
      left: 50%;
      transform: translateX(-50%);
      background: linear-gradient(90deg, #0044aa, #108D00);
      color: white;
      border: none;
      border-radius: 25px;
      padding: 12px 25px;
      font-size: 16px;
      cursor: pointer;
      box-shadow: 0 5px 15px rgba(0,0,0,0.2);
      z-index: 2;
      transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .upload-bereich button:hover {
      transform: translateX(-50%) scale(1.07);
      box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    }

    .links, .rechts {
      flex: 1;
      position: relative;
    }

    .trennlinie {
      width: 2px;
      background: linear-gradient(to bottom, #0044aa, #ffff00);
      height: 100%;
    }

    #closeicon {
      text-align: right;
    }

    .briefmarke {
    position: absolute;
    display: block;
    top: -230px;
    right: -2px;
      width: 205px;
      height: 145px;
      background-image: url('Briefmarke.png');
      background-size: contain;
      background-repeat: no-repeat;
      background-color: white;
      z-index: 1;
    }

    #placeIN{
      text-align: right;
      margin-right: 20px;
      font-size: 26px;
      font-family: sans-serif;
    }

    #background_dark {
      width: 100%;
      height: 100%;
      background: black;
      opacity: 0.5;
      z-index: 800;
      top: 0px;
      left: 0px;
      position: absolute;
    }

    #eu_wertIn {
      font-size: 36px;
      text-transform: uppercase;
      font-family: sans-serif;
    }
    .adresse {
      position: absolute;
      bottom: 220px;
      right: 40px;
      width: 300px;
      font-family: sans-serif;
    }

    #botschaftIn {
      font-family: sans-serif;
      margin-left: 20px;
      margin-right: 20px;
    }

    .adresse input {
      display: block;
      width: 100%;
      border: none;
      border-bottom: 2px solid black;
      margin: 40px 0;
      font-size: 18px;
      outline: none;
      text-align: center;
    }

    .werte {
      display: flex;
      flex-direction: column;
      gap: 15px;
      align-items: center;
      margin-top: 30px;
    }

    select {
      width: 400px;
      padding: 10px;
      font-size: 16px;
      border: 2px solid #ccc;
      border-radius: 8px;
      resize: none;
      outline: none;
    }

    textarea {
      width: 380px;
      padding: 10px;
      font-size: 16px;
      border: 2px solid #ccc;
      border-radius: 8px;
      resize: none;
      outline: none;
      height: 200px;
    }

    .drehen-btn {
      transform: translateX(50%);
      background: linear-gradient(90deg, #0044aa, #ffff00);
      color: white;
      border: none;
      border-radius: 30px;
      padding: 15px 35px;
      font-size: 18px;
      cursor: pointer;
      animation: pulse 1.5s infinite;
      position: absolute;
      top:580px;
      right: 50%;
    }

    @keyframes pulse {
      0% { transform: translateX(50%) scale(1); }
      50% { transform: translateX(50%) scale(1.1); }
      100% { transform: translateX(50%) scale(1); }
    }

    /* === Lightbox Styling === */
    .lightbox {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(10, 15, 25, 0.75);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 2000;
      backdrop-filter: blur(8px);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease;
    }

    .lightbox:not(.hidden) {
      opacity: 1;
      pointer-events: all;
    }

    .lightbox-content {
      background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
      border-radius: 20px;
      padding: 35px;
      width: 90%;
      max-width: 950px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
      animation: popIn 0.5s ease;
      position: relative;
    }

    @keyframes popIn {
      from { transform: scale(0.96) translateY(30px); opacity: 0; }
      to { transform: scale(1) translateY(0); opacity: 1; }
    }

    .lightbox .close {
      position: absolute;
      top: 15px;
      right: 25px;
      font-size: 34px;
      font-weight: bold;
      color: #0044aa;
      cursor: pointer;
      transition: transform 0.3s ease, color 0.3s;
    }

    .lightbox .close:hover {
      color: #108D00;
      transform: rotate(90deg);
    }

    .gallery {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 20px;
      justify-items: center;
      padding: 10px;
    }

    .gallery img {
      width: 100%;
      aspect-ratio: 4/3;
      object-fit: cover;
      border-radius: 14px;
      border: 3px solid transparent;
      box-shadow: 0 3px 10px rgba(0,0,0,0.15);
      cursor: pointer;
      transition: transform 0.25s ease, box-shadow 0.25s, border-color 0.25s;
    }

    .gallery img:hover {
      transform: scale(1.05);
      box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    }

    .gallery img.selected {
      border-color: #108D00;
      box-shadow: 0 0 15px rgba(16,141,0,0.6);
      transform: scale(1.03);
    }

    #previewLargeContainer {
      display: flex;
      justify-content: center;
      margin-bottom: 25px;
    }

    #previewLargeImage {
      max-width: 100%;
      max-height: 320px;
      border-radius: 16px;
      box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
      transition: transform 0.3s ease;
    }

    #confirmImageBtn {
      background: linear-gradient(90deg, #0044aa, #108D00);
      color: white;
      border: none;
      padding: 14px 32px;
      border-radius: 30px;
      font-size: 17px;
      cursor: pointer;
      display: block;
      margin: 25px auto 10px auto;
      transition: transform 0.25s ease, opacity 0.3s, box-shadow 0.3s;
    }

    #confirmImageBtn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    #confirmImageBtn:hover:not(:disabled) {
      transform: scale(1.08);
      box-shadow: 0 6px 20px rgba(0,68,170,0.4);
    }

    .checkbox-container{
      margin-left: 20px;
      margin-right: 20px;
    }

    @media only screen and (max-width: 900px) {
  body {
    background-color: rgb(0, 191, 255);
  }
  #map {
    width: 100%;
    height: 90vh;
  }

  .front {
    flex-direction: column;
  }
  .back {
    background-size: contain;
    background-repeat: no-repeat;
    min-height: 350px;
    height: 20%;
  }
  .trennlinie {
    width: 100%;
    height: 4px;
  }
  .karte {
    width: 90%;
    height:unset;
    margin-left: auto;
    margin-right: auto;
  }
  .karte-wrapper {
    margin-top: 70px;
    left: 0px;
  }
  .seite {
    position: relative;
    width: auto;
  }
  select {
    width: calc(100% - 40px);
  }
  textarea {
    width: calc(100% - 67px);
  }
  .checkbox-container {
    margin-bottom: 20px;
  }
  #miniMap {
    height: 300px;
  }
  .adresse {
    position: relative;
    width: 100%;
  }
  .briefmarke {
    position: relative;
    top: 0px;
    right: 0px;
    margin-left: auto;
    margin-right: auto;
  }
  .adresse {
    bottom: 0px;
    right: 0px;
  }
  #placeIN {
    width: calc(100% - 8px);
  }
  .buttoncard {
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .drehen-btn {
    display: none!important;
  }

  .back {
    transform: rotateY(0deg);
  }

  .upload-bereich button{
    top:25px;
    bottom:unset;
  }
  #anleitungumklicken {
    display: none;
  }
  #Hinweise {
    margin-left: 23px;
    margin-right: 23px;
    text-align: justify;
  }

  /*
  .links {

  }
  .rechts {

  }
  */
}

/* Lightbox Hintergrund */
.lightbox {
  display: flex;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* Halbtransparenter dunkler Schleier
  background: rgba(10, 15, 25, 0.45); */
  background: transparent;
  
  /* Weichzeichner-Effekt */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); /* für Safari */

  justify-content: center;
  align-items: center;

  /* Für sanftes Ein-/Ausblenden */
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Box selbst */
.lightbox-box {
  background: #fff;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.de-text ul.left-align,
.en-text ul.left-align {
  text-align: left;           /* linksbündig */
  margin-left: 20px;          /* Einrückung */
  padding-left: 0;            /* Standard-UL-Padding entfernen */
  font-family: Arial, sans-serif; /* gleiche Schrift */
  font-size: 14px;            /* gleiche Größe wie restlicher Text */
  line-height: 1.6;           /* gleiche Zeilenhöhe */
  color: #222 !important;     /* exakt gleiche Farbe wie Text */
}


/* Info */
.lightbox-box h3 { margin: 0px 0; font-size: 18px; }
.lightbox-box p { margin: 0px 0; color: #555; font-size: 14px; }

.lightbox-box .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
  color: #000;
  background: none;
  border: none;
  z-index: 10;
  transition: transform 0.3s ease, color 0.3s ease;
}

.lightbox-box .close:hover {
  color: #108D00;
  transform: rotate(90deg);
}

.de-text {
  display: block;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #222;
}

.en-text {
  display: none;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #222;
}

#toggleLightboxLang:hover {
  transform: translateY(-2px);
}

#nextbutton:hover {
  transform: translateY(-2px);
}
