/* Gästebuch – Night */

.popup_guestbook {
  background-image: url(../../images/general/guestbook/popup_guestbook.png);
}
.popup_guestbookoptions { background-position: 0px 0px; }

/* Dialogkopf: altes Guestbook-Sprite durch Night-Icon ersetzen */
.popup_icondiv.popup_guestbookoptions {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border-radius: 7px;
  background-image: none;
  background-color: rgba(62, 207, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(62, 207, 255, 0.38);
  font-size: 0;
  line-height: 0;
  color: transparent;
}

.popup_icondiv.popup_guestbookoptions::before {
  content: "";
  width: 16px;
  height: 16px;
  background-color: var(--accent);
  -webkit-mask: url("../../images/general/guestbook/icon-guestbook.svg") center / contain no-repeat;
  mask: url("../../images/general/guestbook/icon-guestbook.svg") center / contain no-repeat;
}

.popup_top:has(.popup_guestbookoptions) .popup_tc {
  white-space: nowrap;
}

/* --- Guestbook settings dialog (overlib popup) --- */
.gb-settings-form {
  min-width: 300px;
}

.gb-settings-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 0;
}

.gb-settings-lead {
  margin: 0 0 2px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
}

.gb-settings-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color var(--ease),
    background-color var(--ease);
}

.gb-settings-option:hover {
  border-color: rgba(62, 207, 255, 0.55);
  background: rgba(62, 207, 255, 0.08);
}

.gb-settings-option:has(input:checked) {
  border-color: rgba(62, 207, 255, 0.65);
  background: rgba(62, 207, 255, 0.12);
}

.gb-settings-option input {
  flex: 0 0 auto;
  margin: 2px 0 0;
}

.gb-settings-option span {
  flex: 1 1 auto;
}

.gb-settings-secure {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.gb-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.gb-settings-actions .standardButton {
  margin: 0;
}

/* Legacy GIFs → Night action icons */
a:has(> img[src*="guestbook/guestbook.gif"]),
a:has(> img[src*="guestbook/email.gif"]),
a:has(> img[src*="guestbook/homepage.gif"]) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 0;
  text-decoration: none;
  transition:
    border-color var(--ease),
    box-shadow var(--ease),
    background-color var(--ease);
}

a:has(> img[src*="guestbook/guestbook.gif"]) > img,
a:has(> img[src*="guestbook/email.gif"]) > img,
a:has(> img[src*="guestbook/homepage.gif"]) > img {
  opacity: 0 !important;
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  pointer-events: none;
}

a:has(> img[src*="guestbook/guestbook.gif"])::before,
a:has(> img[src*="guestbook/email.gif"])::before,
a:has(> img[src*="guestbook/homepage.gif"])::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  pointer-events: none;
  background-color: var(--muted);
  -webkit-mask: var(--gb-icon-mask) center / contain no-repeat;
  mask: var(--gb-icon-mask) center / contain no-repeat;
  transition: background-color var(--ease);
}

a:has(> img[src*="guestbook/guestbook.gif"]) {
  --gb-icon-mask: url("../../images/general/guestbook/icon-guestbook.svg");
}

a:has(> img[src*="guestbook/email.gif"]) {
  --gb-icon-mask: url("../../images/general/shared/icon-mail.svg");
}

a:has(> img[src*="guestbook/homepage.gif"]) {
  --gb-icon-mask: url("../../images/general/guestbook/icon-homepage.svg");
}

a:has(> img[src*="guestbook/guestbook.gif"]):hover,
a:has(> img[src*="guestbook/email.gif"]):hover,
a:has(> img[src*="guestbook/homepage.gif"]):hover {
  border-color: var(--accent);
  background-color: rgba(62, 207, 255, 0.1);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

a:has(> img[src*="guestbook/guestbook.gif"]):hover::before,
a:has(> img[src*="guestbook/email.gif"]):hover::before,
a:has(> img[src*="guestbook/homepage.gif"]):hover::before {
  background-color: var(--accent);
}

table:has(> tbody > tr > td.body_mc .gb) {
  width: 100%;
  table-layout: fixed;
}

.gb,
.gb * {
  box-sizing: border-box;
}

.gb {
  width: 100%;
  max-width: 980px;
  min-width: 0;
  margin: 0 auto 8px;
  text-align: left;
  color: var(--text);
}

.gb-head {
  margin: 0 0 16px;
}

.gb-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.gb-head h1,
.body_mc .gb-head h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  text-align: left;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.gb-settings-btn {
  display: inline-flex;
  vertical-align: middle;
}

.gb-lead {
  margin: 0;
  max-width: 42em;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.gb-notices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
}

.gb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.gb-toolbar--footer {
  margin: 18px 0 0;
  justify-content: flex-end;
}

.gb-toolbar-main {
  min-width: 0;
}

.gb-toolbar-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.gb-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  transition: border-color var(--ease), background-color var(--ease), box-shadow var(--ease);
}

.gb-new-btn:hover,
.gb-new-btn:focus-visible {
  border-color: var(--accent);
  background: rgba(62, 207, 255, 0.08);
  box-shadow: 0 0 0 2px var(--accent-glow);
  color: var(--text);
  outline: none;
}

.gb-new-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.gb-toolbar-pager {
  margin-left: auto;
}

.gb .cc_pager {
  width: auto;
  max-width: none;
  margin: 0;
  justify-content: flex-end;
}

.gb-empty {
  margin: 0 0 16px;
  padding: 18px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
}

.gb-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gb-entry {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
  min-width: 0;
}

.gb-entry--locked {
  border-color: rgba(255, 176, 32, 0.45);
  box-shadow: inset 3px 0 0 rgba(255, 176, 32, 0.85);
}

.gb-entry-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--inset);
}

.gb-entry-nr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gb-entry-meta {
  min-width: 0;
}

.gb-entry-who {
  margin: 0;
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
}

.gb-entry-who a {
  color: var(--text);
  text-decoration: none;
}

.gb-entry-who a:hover {
  color: var(--accent);
}

.gb-entry-gb-link {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}

.gb-entry-gb-link img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.gb-entry-date {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.gb-entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.gb-entry-actions > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gb-entry-actions > a:has(> img[src*="guestbook/icq.gif"]) img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.gb-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gb-badge--locked {
  border: 1px solid rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.12);
  color: #ffb020;
}

.gb-mod-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(62, 207, 255, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--ease), background-color var(--ease);
}

.gb-mod-btn:hover {
  border-color: var(--accent);
  background: rgba(62, 207, 255, 0.14);
  color: var(--accent);
}

.gb-mod-btn--warn {
  background: rgba(255, 176, 32, 0.1);
  color: #ffb020;
}

.gb-mod-btn--warn:hover {
  border-color: rgba(255, 176, 32, 0.65);
  background: rgba(255, 176, 32, 0.18);
  color: #ffb020;
}

.gb-entry-body {
  padding: 14px 16px;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.gb-entry-body img {
  max-width: 100%;
  height: auto;
}

.gb-comments {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid var(--border);
  background: var(--border);
}

.gb-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
}

.gb-comment-main {
  flex: 1 1 auto;
  min-width: 0;
}

.gb-comment-meta {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.gb-comment-meta a {
  color: var(--text);
  text-decoration: none;
}

.gb-comment-meta a:hover {
  color: var(--accent);
}

.gb-comment-text {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.gb-comment-del {
  flex: 0 0 auto;
}

.gb-comment-form-wrap {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}

.gb-comment-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--ease), background-color var(--ease);
}

.gb-comment-toggle:hover {
  border-color: var(--accent);
  background: rgba(62, 207, 255, 0.08);
}

.gb-comment-form {
  margin-top: 12px;
}

.gb-comment-form .textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
}

.gb-comment-form .standardButton {
  width: auto !important;
  margin: 10px 0 0 !important;
}

.gb-panel {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  min-width: 0;
}

.gb-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
}

.gb-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(62, 207, 255, 0.12);
  color: var(--accent);
}

.gb-panel-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gb-panel-head h2,
.body_mc .gb-panel-head h2 {
  margin: 0 0 4px;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.gb-panel-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.gb-form {
  margin: 0;
}

.gb-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.gb-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gb-field .text,
.gb-field .textarea {
  width: 100%;
  max-width: 100%;
}

.gb-field .text[readonly] {
  opacity: 0.72;
  cursor: default;
}

.gb-secure {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.gb-secure .gb-field {
  max-width: 180px;
}

.gb-captcha {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.gb-captcha img {
  vertical-align: middle;
}

.gb-terms {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.gb-terms a {
  color: var(--accent);
}

.gb-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
}

.gb-form-actions .standardButton {
  width: auto !important;
  margin: 0 !important;
}

.gb-import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.gb-import-row .standardButton {
  width: auto !important;
  margin: 0 !important;
}

.gb-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.gb-table th,
.gb-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.gb-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gb-table tbody tr:last-child td {
  border-bottom: 0;
}

.gb-table tbody tr:hover td {
  background: rgba(62, 207, 255, 0.04);
}

.gb-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gb-num--ok {
  color: var(--green, #3dd68c);
  font-weight: 700;
}

.gb-num--error {
  color: var(--red, #ff6b6b);
  font-weight: 700;
}

.gb-col-actions {
  width: 56px;
  text-align: center !important;
}

.gb-status {
  font-weight: 650;
}

.gb-status--ok {
  color: var(--green, #3dd68c);
}

.gb-status--error {
  color: var(--red, #ff6b6b);
}

@media (max-width: 860px) {
  .gb-panel {
    padding: 14px;
  }

  .gb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gb-toolbar-pager,
  .gb .cc_pager {
    margin-left: 0;
    justify-content: center;
  }

  .gb-new-btn {
    width: 100%;
    justify-content: center;
  }

  .gb-entry-head {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "nr meta"
      "actions actions";
  }

  .gb-entry-nr {
    grid-area: nr;
  }

  .gb-entry-meta {
    grid-area: meta;
  }

  .gb-entry-actions {
    grid-area: actions;
    justify-content: flex-start;
  }

  .gb-fields {
    grid-template-columns: 1fr;
  }

  .gb-secure {
    flex-direction: column;
    align-items: stretch;
  }

  .gb-secure .gb-field {
    max-width: none;
  }

  .gb-comment-form .standardButton,
  .gb-form-actions .standardButton,
  .gb-import-row .standardButton {
    width: 100% !important;
    justify-content: center;
  }

  .gb-import-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gb-import-row .gb-field .text {
    max-width: none !important;
  }
}
