/* 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 «gekauft | verschenkt» auf eigenen Geschenken (components/WishCard.tsx). */
.gift-status {
  display: inline-flex;
  border: 1px solid #ced4da;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.gift-status button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border: 0;
  background: none;
  color: #6c757d;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.gift-status button + button {
  border-left: 1px solid #ced4da;
}

.gift-status button:hover {
  color: #28a745;
}

.gift-status button:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 0.15rem rgba(40, 167, 69, 0.5);
}

.gift-status button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.gift-status .gift-status-bought[aria-pressed="true"] {
  background: #28a745;
  color: #fff;
}

.gift-status .gift-status-given[aria-pressed="true"] {
  background: #851abc;
  color: #fff;
}

/* Auf schmalen Geräten rutscht der Schalter unter «Wunsch nicht schenken». */
@media (max-width: 400px) {
  .unpublish_this ~ .float-right .gift-status {
    margin-top: 0.5rem;
  }
}

/* Gekauft: Haken vor dem Titel. Verschenkt: durchgestrichen. */
.gift-bought-check {
  color: #28a745;
}

div.card.gift-given .card-body {
  text-decoration: line-through;
}

/* 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;
  /* Verschenkte 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;
}

/* iOS Safari zoomt beim Fokus in Felder mit weniger als 16px Schrift. */
@media (pointer: coarse) {
  .wish-comment-form textarea {
    font-size: 16px;
  }
}

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

.comment-hidden {
  color: #851abc;
}

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

/* Wünsche, die seit dem letzten Login neu sind (components/WishCard.tsx). */
.card.wish-new {
  border-color: #851abc;
  box-shadow: 0 0 0 0.15rem rgba(133, 26, 188, 0.2), 0 0.25rem 0.75rem rgba(133, 26, 188, 0.15);
}

.card.wish-new > .card-header {
  background: #f3e8fa;
}

.wish-new-badge {
  font-size: 0.7rem;
  vertical-align: middle;
}

/* Home: drei Kacheln mit Zahlen, darunter Einstellungen, Neuheiten und meinwuns.ch (app/home/page.tsx). */
.home-tiles {
  display: grid;
  gap: 1rem;
  max-width: 60rem;
  margin: 0.5rem auto 1.5rem;
}

@media (min-width: 768px) {
  .home-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-news {
    grid-column: span 2;
  }

  .home-about {
    grid-column: 1 / -1;
  }
}

.home-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.home-list li {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.home-list i {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.home-settings {
  margin: 0;
  font-size: 0.9rem;
}

.home-settings > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 0.75rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.home-settings > div:last-child {
  border-bottom: 0;
}

.home-settings dt {
  font-weight: 400;
}

.home-settings dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Konto (components/AccountShell.tsx): Navigation links, auf dem Handy als 2×2-Raster oben. */
.account-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.account-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.25;
  text-decoration: none;
}

.account-nav a:hover {
  border-color: #851abc;
  color: #851abc;
}

.account-nav a.active {
  border-color: #851abc;
  background: #851abc;
  color: #fff;
}

@media (max-width: 575.98px) {
  .account-nav a {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 992px) {
  .account-nav {
    position: sticky;
    top: 7rem;
    grid-template-columns: minmax(0, 1fr);
  }
}

.account-card {
  margin-bottom: 1.5rem;
}

.notify-group {
  margin: 1.25rem 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.notify-group legend {
  float: left;
  width: 100%;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.notify-group .custom-control {
  clear: both;
  margin-bottom: 0.75rem;
}

/* Einladungslink (app/invite, components/forms/InviteSettings.tsx). */
.invite-icon {
  margin-bottom: 1rem;
  font-size: 3rem;
}

.invite-url {
  height: auto;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* 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;
}

/* Login, zweiter Schritt: «Login» und «Login-Link senden» auf einer Zeile. */
.login-buttons {
  gap: 0.75rem;
}

/* Auf schmalen Bildschirmen etwas weniger Innenabstand, damit beide Knöpfe auf eine Zeile passen. */
@media (max-width: 575.98px) {
  .login-buttons {
    gap: 0.5rem;
  }

  .login-buttons .btn-xl {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .login-buttons .btn-outline-primary {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}
