/* CC-BY-SA bildungssprit.de | Falk Szyba @medienrocker */
/* =========================================================
   learnWEB – Zertifikat Styles (Dialog + Vorschau)
   ========================================================= */

.zert {
  border: none;
  border-radius: 18px;
  padding: 24px 22px 20px;
  max-width: 560px;
  width: calc(100% - 28px);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4);
  color: var(--ink);
  position: relative;
  border-top: 8px solid var(--green);
}
.zert::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.zert[open] { animation: zert-pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes zert-pop {
  0%   { transform: scale(0.92) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.zert-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
}
.zert-close:hover { background: var(--bg); color: var(--ink); }

.zert-h {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: var(--green);
}
.zert-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.zert-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.zert-name {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 16px;
  min-height: 48px;
}
.zert-name:focus {
  outline: none;
  border-color: var(--green);
}

/* Vorschau: SVG skaliert auf Containerbreite */
.zert-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fffdf7;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  line-height: 0;
}
.zert-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.zert-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.zert-btn {
  flex: 1 1 180px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.zert-btn:hover { background: var(--bg); }
.zert-btn.primary {
  background: var(--green);
  color: #fff;
  border-color: transparent;
}
.zert-btn.primary:hover { background: var(--green-light); }

/* Ausloeser-Buttons im Coder-Pass / in der Map-Zeremonie */
.zert-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
  box-shadow: var(--shadow);
}
.zert-trigger:hover { filter: brightness(1.05); }

/* Zertifikat-Bereich im Coder-Pass */
.zert-block {
  margin: 24px 0;
  padding: 18px;
  background: linear-gradient(180deg, #fffbeb, #ffffff);
  border: 1px solid #fcd34d;
  border-radius: 14px;
}
.zert-block h2 { margin: 0 0 6px; font-size: 1.2rem; }
.zert-block-sub { margin: 10px 0 8px; color: var(--muted); font-size: 0.9rem; }
.zert-teil-row { display: flex; flex-wrap: wrap; gap: 8px; }
.zert-teil-row .zert-trigger.teil { font-size: 0.92rem; padding: 10px 16px; }

/* Zertifikat-Button in der Phasen-Zeremonie der Map */
.map-ceremony-btn.zert {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .zert[open] { animation: none !important; }
}
