/* Ergänzungen der vinext-Portierung zum übernommenen Theme. */

/* Der Footer enthält neu den Sprachumschalter und ist dadurch höher. */
#main_content {
  padding-bottom: 130px;
}

.footer .btn-link {
  font-size: inherit;
  vertical-align: baseline;
}

/* Aktions-Symbole sind neu <button> statt <a href="#">. */
.card-header .btn-link {
  line-height: inherit;
  vertical-align: baseline;
}

.navbar .nav-item button.nav-link {
  font-weight: inherit;
  letter-spacing: inherit;
}

/* Empfänger-Auswahl (ersetzt bootstrap-select). */
.reciver-select .dropdown-toggle {
  min-width: 14rem;
  max-width: 100%;
  white-space: normal;
  border: 1px solid #ced4da;
}

.reciver-select .dropdown-menu {
  max-height: 18rem;
  overflow-y: auto;
}

.card-text > :last-child {
  margin-bottom: 0;
}

/* «abmelden?» ist ein Formular-Button und soll wie die übrigen Navigationslinks aussehen. */
#mainNav .navbar-nav li.nav-item button.nav-link {
  color: #fff;
  font-weight: 700;
}

#mainNav .navbar-nav li.nav-item button.nav-link:hover {
  color: #851abc;
}

/* Bestätigungsdialog (components/ConfirmDialog.tsx, ersetzt window.confirm).
   Natives <dialog>; der Inhalt nutzt die Bootstrap-Klassen .modal-content usw. */
dialog.confirm-dialog {
  width: calc(100% - 2rem);
  max-width: 30rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  overflow: visible;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
  animation: confirm-dialog-in 0.15s ease-out;
}

dialog.confirm-dialog::backdrop {
  background: rgba(44, 62, 80, 0.6);
  animation: confirm-backdrop-in 0.15s ease-out;
}

/* Abstände ausdrücklich setzen: Das Theme gibt .modal-body 4rem Innenabstand oben und
   unten, und der Wert für .modal-footer ist dort ungültig («1rem-0.25rem»). */
dialog.confirm-dialog .modal-content {
  border: 0;
  border-radius: 0.5rem;
}

dialog.confirm-dialog .modal-header {
  padding: 1.25rem 1.25rem 0.5rem;
}

dialog.confirm-dialog .modal-title {
  font-size: 1.25rem;
  text-transform: none;
}

dialog.confirm-dialog .modal-body {
  padding: 0.25rem 1.25rem 1.25rem;
  color: #495057;
}

dialog.confirm-dialog .modal-footer {
  padding: 0 1rem 1rem;
}

@keyframes confirm-dialog-in {
  from {
    opacity: 0;
    transform: translateY(-1rem) scale(0.98);
  }
}

@keyframes confirm-backdrop-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.confirm-dialog,
  dialog.confirm-dialog::backdrop {
    animation: none;
  }
}

/* Schalter «erledigen» auf eigenen Geschenken (bisher Checkbox-Symbol mit Text). */
.done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.7rem 0.2rem 0.3rem;
  border: 1px solid #ced4da;
  border-radius: 999px;
  background: #fff;
  color: #6c757d;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.done-toggle:hover {
  border-color: #28a745;
  color: #28a745;
}

.done-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.35);
}

.done-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.done-toggle-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0.6rem;
}

/* Häkchen erst im erledigten Zustand; beim Überfahren als Vorschau angedeutet. */
.done-toggle-box i {
  opacity: 0;
  transition: opacity 0.15s;
}

.done-toggle:hover .done-toggle-box i {
  opacity: 0.5;
}

.done-toggle[aria-pressed="true"] {
  border-color: #28a745;
  background: #28a745;
  color: #fff;
}

.done-toggle[aria-pressed="true"] .done-toggle-box {
  border-color: #fff;
  background: #fff;
  color: #28a745;
}

.done-toggle[aria-pressed="true"] .done-toggle-box i {
  opacity: 1;
}

.done-toggle[aria-pressed="true"]:hover {
  border-color: #218838;
  background: #218838;
}

/* Live-Prüfung neuer Passwörter (components/NewPasswordFields.tsx). */
.password-rules {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  font-size: 0.875rem;
}

.password-rule {
  display: flex;
  align-items: center;
  padding: 0.15rem 0;
  color: #6c757d;
  transition: color 0.15s;
}

.password-rule i {
  width: 1rem;
  text-align: center;
}

.password-rule-met {
  color: #28a745;
}

.password-rule-unmet {
  color: #dc3545;
}

/* Version im Footer (components/Shell.tsx). */
.footer-version {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Kommentare (components/WishCard.tsx, components/WishComments.tsx). */
.comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: #6c757d;
  font-size: inherit;
  line-height: 1.5;
  cursor: pointer;
}

.comment-toggle:hover,
.comment-toggle.open {
  border-color: #851abc;
  color: #851abc;
}

.comment-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(133, 26, 188, 0.3);
}

.comment-toggle.has-comments {
  color: #851abc;
}

.comment-toggle .badge {
  font-size: 0.7rem;
}

.card-comments {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.125);
  background: #fbf9fd;
  /* Erledigte Karten streichen den Inhalt durch, die Kommentare nicht. */
  text-decoration: none;
}

.wish-comments {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.wish-comment {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.9rem;
}

.wish-comment:first-child {
  padding-top: 0;
}

.wish-comment-meta {
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.wish-comment-body {
  overflow-wrap: anywhere;
}

.wish-comment-body > :last-child {
  margin-bottom: 0;
}

/* Das Theme gibt Textfeldern eine feste Höhe; hier zählen die zwei Zeilen (rows). */
.wish-comment-form textarea {
  height: auto;
  min-height: 0;
  resize: vertical;
}

.wish-comment-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.wish-comment-actions .btn {
  flex-shrink: 0;
}

/* Priorität als farbige Ecke oben rechts in der Wunsch-Karte (components/WishCard.tsx).
   Rein dekorativ; die Priorität steht zusätzlich als Text im Kartenfuss.
   Klein genug, dass sie die Symbole im Kartenkopf nicht überdeckt. */
.card[class*="wish-priority-"]::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 1.6rem 1.6rem 0;
  border-color: transparent var(--wish-priority) transparent transparent;
  border-top-right-radius: calc(0.5rem - 0.125rem);
  pointer-events: none;
}

.card.wish-priority-warning {
  --wish-priority: #ffc107;
}

.card.wish-priority-info {
  --wish-priority: #17a2b8;
}

.card.wish-priority-danger {
  --wish-priority: #dc3545;
}
