/* ===== BASE ===== */
body {
  margin: 0;
  padding: 0 0 60px;
  background: linear-gradient(135deg, #e3f2ff, #f8faff);
  font-family: Arial, Helvetica, sans-serif;
  color: #1d2330;
}

/* ===== HEADER ===== */
.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #005fa3, #0095ff);
  padding: 17px 0;
  padding-top: calc(17px + env(safe-area-inset-top, 0px));
  margin-bottom: 28px;
}
.header h1 {
  margin: 0;
  font-size: 46px;
  color: #fff;
  letter-spacing: 1.1px;
}

/* ===== BUTTONS ===== */
.BTN {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  color: #000;
  cursor: pointer;
  transition:
    scale 0.12s ease,
    background 0.25s ease,
    box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
/* Hover nur mit Maus – auf Touch-Geräten bleibt der Button sonst "markiert" */
@media (hover: hover) and (pointer: fine) {
  .BTN:hover {
    background: #d1cfcf;
    scale: 1.12;
  }
}
.BTN:active {
  background: #c4c4c4;
}
.BTN svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}
#resetBtn {
  position: absolute;
  top: 50%;
  right: 20px;
  translate: 0 -50%;
}

/* Copy-Button: Kopier-Symbol -> Haken */
#CopyBtn {
  position: relative;
  flex: none;
}
#CopyBtn svg {
  position: absolute;
  transition:
    transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1),
    opacity 0.25s;
}
#CopyBtn .ic-check {
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  opacity: 0;
  transform: scale(0.4) rotate(-30deg);
}
#CopyBtn.done {
  background: #1c8a3a !important;
}
#CopyBtn.done .ic-copy {
  opacity: 0;
  transform: scale(0.3) rotate(90deg);
}
#CopyBtn.done .ic-check {
  opacity: 1;
  transform: none;
  stroke-dashoffset: 0;
  transition:
    stroke-dashoffset 0.4s ease 0.15s,
    transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1) 0.1s,
    opacity 0.2s;
}

/* ===== UMSCHALTER ===== */
.switch {
  display: flex;
  box-sizing: border-box;
  max-width: 715px;
  margin: 0 auto 22px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.05),
    0 12px 20px rgba(0, 0, 0, 0.1);
}
.switch a {
  flex: 1;
  padding: 12px 8px;
  border-radius: 999px;
  color: #1d2330;
  font-size: 1.1rem;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.switch a:hover {
  background: rgba(0, 119, 204, 0.12);
}
.switch a.active {
  background: linear-gradient(135deg, #0077cc, #00a2ff);
  color: #fff;
}

/* ===== KARTEN ===== */
.card {
  position: relative;
  box-sizing: border-box;
  max-width: 715px;
  margin: 0 auto 22px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.05),
    0 12px 20px rgba(0, 0, 0, 0.1);
}
.card.datum {
  z-index: 5;
}

/* ===== DROP-FELD ===== */
.drop {
  padding: 26px 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.65);
  border: 2px dashed #7fb4e6;
  border-radius: 16px;
  cursor: pointer;
  outline: none;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.drop:hover,
.drop.over,
.drop:focus {
  background: rgba(0, 119, 204, 0.08);
  border-color: #0077cc;
}
.drop b {
  font-size: 1.15rem;
}
.drop p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  opacity: 0.65;
}
.pill {
  margin-top: 14px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0077cc, #00a2ff);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
#msg {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 0.95rem;
}
#msg.ok {
  color: #1c8a3a;
  font-weight: bold;
}

/* ===== DATUM ===== */
.umrechner {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
}
.title {
  font-size: 1.1rem;
}
.eingabefeld {
  display: flex;
  flex-direction: column;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 13px;
  transition:
    transform 0.2s,
    box-shadow 0.25s;
}
.eingabefeld:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.08);
}
.eingabefeld.dd {
  position: relative;
  max-width: 260px;
}
.eingabefeld.dd:hover {
  transform: none;
  box-shadow: none;
}
/* Browser-Datepicker, sieht aus wie der frühere Button: "Datum ▾" */
.eingabefeld.dd input[type="date"] {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 24px 8px 5px;
  border: none;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23222'/%3E%3C/svg%3E")
    no-repeat right 5px center;
  color: inherit;
  font: inherit;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.eingabefeld.dd input[type="date"]:hover {
  border-bottom-color: #0077cc;
}
.eingabefeld.dd input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}
/* natives Kalender-Symbol unsichtbar, aber über das ganze Feld klickbar */
.eingabefeld.dd input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

/* ===== AUSGABE ===== */
.outrow {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 13px;
  font:
    13px/1.55 ui-monospace,
    Menlo,
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.hint {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.65;
}

/* ===== HANDY ===== */
@media (max-width: 650px) {
  html {
    overflow-x: hidden;
  }
  .header h1 {
    font-size: 26px;
  }
  #resetBtn {
    width: 40px;
    height: 40px;
    right: 10px;
  }
  .card {
    margin: 0 12px 16px;
    padding: 18px 14px;
  }
  .umrechner {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .title {
    text-align: center;
    font-size: 1.3rem;
  }
  .eingabefeld.dd {
    max-width: none;
  }
  .eingabefeld.dd input[type="date"] {
    min-height: 44px;
    font-size: 20px;
  }
  .BTN {
    width: 50px;
    height: 50px;
  }
  .switch {
    margin: 0 12px 16px;
  }
}

/* Copy-Button: Wackeln + Hinweis, wenn noch nichts zum Kopieren da ist */
#CopyBtn.shake {
  animation: copy-shake 0.5s ease;
}
@keyframes copy-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-9px);
  }
  35% {
    transform: translateX(9px);
  }
  55% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
/* Hinweis-Blase: liegt INNERHALB der Karte (über dem Textfeld), wackelt nicht mit
   und kann deshalb nie unter anderen Karten verschwinden */
.outrow {
  position: relative;
}
.outrow::after {
  content: "Noch keine Werte zum Kopieren";
  position: absolute;
  left: 8px;
  top: 8px;
  max-width: calc(100% - 90px);
  padding: 8px 12px;
  border-radius: 10px;
  background: #222;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  pointer-events: none;
  z-index: 5;
}
.card.tip-open .outrow::after {
  opacity: 1;
  transform: none;
}