/* =========================================================================
   Wireframe Sharer 3000 — app-spezifische Styles
   Baut auf ui-system.css auf (Tokens, App-Shell, Buttons, Cards, Notices …).
   ========================================================================= */

/* ---------- Login-Screen ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  max-width: 24rem;
  width: 100%;
  text-align: center;
}
.login-card .brand-logo { height: 3rem; color: var(--brand); margin-bottom: 1.25rem; }
html.dark .login-card .brand-logo { color: #fff; }
.login-card h1 { font-size: 1.25rem; margin-bottom: .35rem; }
.login-card p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }

.btn-google {
  display: inline-flex; align-items: center; gap: .625rem;
  width: 100%; justify-content: center;
}
.btn-google svg { width: 1.125rem; height: 1.125rem; }

/* ---------- Sidebar-Logo + Wireframe-Liste ---------- */
.sidebar__brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: inherit; min-width: 0; flex: 1; }
.sidebar__logo { color: var(--brand); height: 1.5rem; width: auto; }
html.dark .sidebar__logo { color: #fff; }
.sidebar__body { overflow-y: auto; }
.nav-link__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  font-family: var(--font-mono); font-size: .65rem; font-weight: 700;
  color: var(--text-muted); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0 .35rem; flex: none;
}
.nav-link.is-active .nav-badge { color: var(--primary-700); border-color: var(--primary-100); background: var(--primary-50); }
html.dark .nav-link.is-active .nav-badge { color: #bfdbfe; background: rgba(37,99,235,.18); border-color: transparent; }
.nav-empty { color: var(--text-dim); font-size: .82rem; padding: .5rem .25rem; list-style: none; }
.topbar__logo { color: var(--brand); height: 1.35rem; }
html.dark .topbar__logo { color: #fff; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 2.25rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover { border-color: var(--primary-500); color: var(--text-soft); }
.dropzone.is-drag {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}
html.dark .dropzone.is-drag { background: rgba(37,99,235,.12); color: #bfdbfe; }
.dropzone__icon { width: 2rem; height: 2rem; margin-bottom: .5rem; opacity: .7; }
.dropzone__hint { font-size: .8rem; margin-top: .35rem; color: var(--text-dim); }

/* ---------- Wireframe-Grid (Dashboard) ---------- */
.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.wf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  display: flex; flex-direction: column;
}
.wf-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-500); }
.wf-card__thumb {
  height: 9rem; position: relative; overflow: hidden;
  background: var(--surface-3); border-bottom: 1px solid var(--border);
}
.wf-card__thumb iframe {
  position: absolute; top: 0; left: 0;
  width: 250%; height: 250%;
  transform: scale(.4); transform-origin: top left;
  border: 0; pointer-events: none; background: #fff;
}
.wf-card__thumb-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-dim); font-size: .8rem;
}
.wf-card__body { padding: .875rem 1rem; flex: 1; }
.wf-card__title { font-weight: 600; color: var(--text-strong); margin-bottom: .25rem; }
.wf-card__meta { font-size: .78rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Detail-Layout: Viewer + Panel ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.detail-head__main { flex: 1; min-width: 12rem; }
.detail-title-input {
  font-size: 1.5rem; font-weight: 700; color: var(--text-strong);
  border: 1px solid transparent; background: transparent;
  border-radius: var(--radius); padding: .15rem .4rem; margin: -.15rem -.4rem;
  width: 100%; font-family: var(--font-sans);
}
.detail-title-input:hover { border-color: var(--border); }
.detail-title-input:focus { border-color: var(--primary-500); background: var(--surface); outline: none; }

.split { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0,1fr) 21rem; align-items: start; } }

/* ---------- Version-Leiste ---------- */
.version-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .875rem; }
.version-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-soft); border-radius: var(--radius-pill);
  padding: .3rem .75rem; font-size: .8125rem; font-weight: 600; cursor: pointer;
  font-family: var(--font-mono);
}
.version-pill:hover { border-color: var(--primary-500); color: var(--primary-600); }
.version-pill.is-active { background: var(--primary-500); border-color: var(--primary-500); color: #fff; }
.version-pill .cnt {
  font-family: var(--font-sans); font-size: .7rem; background: rgba(0,0,0,.12);
  border-radius: var(--radius-pill); padding: 0 .35rem;
}
.version-pill.is-active .cnt { background: rgba(255,255,255,.25); }

/* ---------- Viewer ---------- */
.wf-viewer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.wf-toolbar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .5rem .75rem; border-bottom: 1px solid var(--border); background: var(--surface-3);
}
.wf-toolbar .spacer { flex: 1; }
.wf-toolbar__hint { font-size: .78rem; color: var(--text-muted); }
.wf-stage { position: relative; background: #fff; min-height: 20rem; }
.wf-frame { display: block; width: 100%; border: 0; background: #fff; }
.wf-overlay { position: absolute; inset: 0; pointer-events: none; }
.wf-overlay.is-annotate { pointer-events: auto; cursor: crosshair; }
.wf-stage.is-loading::after {
  content: "Lädt…"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: var(--text-dim); font-size: .85rem;
}

/* ---------- Pins ---------- */
.wf-pin {
  position: absolute; transform: translate(-50%, -100%);
  pointer-events: auto; cursor: pointer;
  width: 1.5rem; height: 1.5rem; border-radius: 50% 50% 50% 0;
  transform-origin: center; rotate: -45deg;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); border: 2px solid #fff;
  font-size: .7rem; font-weight: 700; color: #fff; font-family: var(--font-mono);
}
.wf-pin > span { rotate: 45deg; }
.wf-pin--internal { background: var(--primary-500); }
.wf-pin--external { background: var(--danger-500); }
.wf-pin--resolved { background: var(--success-500); }
.wf-pin.is-active { outline: 3px solid var(--amber-400); outline-offset: 1px; z-index: 5; }

/* ---------- Anmerkungs-Panel ---------- */
.anno-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; max-height: 80vh; }
.anno-panel__head { padding: .875rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.anno-panel__head h2 { font-size: 1rem; flex: 1; }
.anno-list { overflow-y: auto; padding: .5rem; flex: 1; }
.anno-empty { text-align: center; color: var(--text-muted); padding: 2rem 1rem; font-size: .85rem; }

.anno-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .625rem .75rem; margin-bottom: .5rem; background: var(--surface);
  cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.anno-item:hover { border-color: var(--primary-500); }
.anno-item.is-active { border-color: var(--amber-400); box-shadow: 0 0 0 2px var(--amber-100); }
.anno-item.is-resolved { opacity: .6; }
.anno-item__head { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.anno-badge {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border-radius: var(--radius-pill); padding: .05rem .4rem;
}
.anno-badge--internal { background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); }
.anno-badge--external { background: var(--danger-50); color: var(--danger-700); border: 1px solid var(--danger-100); }
html.dark .anno-badge--internal { background: rgba(37,99,235,.18); color: #bfdbfe; }
html.dark .anno-badge--external { background: rgba(215,38,61,.2); color: #fca5a5; }
/* Interne (ganztags.) Kommentare tragen das Logo statt einer Text-Pille */
.anno-logo { display: inline-flex; align-items: center; color: var(--brand); flex: none; }
html.dark .anno-logo { color: #fff; }
.anno-logo .brand-logo { height: 1.05rem; width: auto; }
.anno-item__author { font-weight: 600; font-size: .82rem; color: var(--text-strong); }
.anno-item__pin { margin-left: auto; font-size: .68rem; font-family: var(--font-mono); color: var(--text-dim); }
.anno-item__body { font-size: .85rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.anno-item__foot { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; font-size: .72rem; color: var(--text-muted); }
.anno-item__foot button { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: .72rem; padding: 0; }
.anno-item__foot button:hover { color: var(--primary-600); text-decoration: underline; }
.anno-item__foot .danger:hover { color: var(--danger-600); }

.anno-composer { border-top: 1px solid var(--border); padding: .75rem; background: var(--surface-3); }
.anno-composer textarea {
  width: 100%; resize: vertical; min-height: 3.5rem; font-family: var(--font-sans);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .625rem; font-size: .85rem;
  background: var(--surface); color: var(--text);
}
.anno-composer textarea:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.anno-composer input[type=text] {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .4rem .625rem; font-size: .82rem; margin-bottom: .4rem;
  background: var(--surface); color: var(--text);
}
.anno-composer__row { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.anno-composer__pin { font-size: .72rem; color: var(--primary-600); font-family: var(--font-mono); }

/* ---------- Antworten (Threads) ---------- */
.anno-item__foot button[data-act="reply"] { font-weight: 600; }
.anno-replies { margin-top: .5rem; padding-left: .75rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.anno-reply { background: var(--surface-3); border-radius: var(--radius); padding: .45rem .6rem; }
.anno-reply__head { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.anno-reply__author { font-weight: 600; font-size: .78rem; color: var(--text-strong); }
.anno-reply__date { font-size: .68rem; color: var(--text-muted); margin-left: auto; }
.anno-reply__del { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 .1rem; }
.anno-reply__del:hover { color: var(--danger-600); }
.anno-reply__body { font-size: .8rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.anno-reply .anno-logo .brand-logo { height: .9rem; }
.anno-reply-box { margin-top: .5rem; }
.anno-reply-box textarea {
  width: 100%; resize: vertical; min-height: 2.75rem; font-family: var(--font-sans);
  border: 1px solid var(--border); border-radius: var(--radius); padding: .45rem .6rem; font-size: .82rem;
  background: var(--surface); color: var(--text);
}
.anno-reply-box textarea:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.anno-reply-box input[type=text] {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .35rem .6rem; font-size: .8rem; margin-bottom: .35rem; background: var(--surface); color: var(--text);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,.55);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 100;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 30rem; width: 100%; padding: 1.5rem; max-height: 90vh; overflow-y: auto;
}
.modal-card h2 { font-size: 1.125rem; margin-bottom: 1rem; }
.modal-card .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* ---------- Copy-Field (Share-Link) ---------- */
.copy-field { display: flex; gap: .5rem; }
.copy-field input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .5rem .625rem; font-size: .82rem; font-family: var(--font-mono);
  background: var(--surface-2); color: var(--text);
}

/* ---------- Öffentliche Share-Ansicht ---------- */
.share-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.share-chrome {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1.25rem; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 20;
}
.share-brand { display: flex; align-items: center; gap: .625rem; }
.share-brand .brand-logo { height: 1.6rem; color: var(--brand); }
html.dark .share-brand .brand-logo { color: #fff; }
.share-brand__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.share-title { font-weight: 700; color: var(--text-strong); font-size: 1.05rem; }
.share-chrome .spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: .5rem; }
.topbar-user .user-name { font-weight: 600; color: var(--text-strong); font-size: .85rem; }
@media (max-width: 560px) { .topbar-user .user-name { display: none; } }
.share-main { flex: 1; padding: 1.25rem; max-width: 1400px; margin: 0 auto; width: 100%; }
.share-foot { text-align: center; padding: 1rem; color: var(--text-dim); font-size: .75rem; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.toast {
  background: var(--text-strong); color: #fff; padding: .625rem 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .85rem; animation: toast-in .2s ease;
}
.toast.error { background: var(--danger-600); }
.toast.success { background: var(--success-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Helfer ---------- */
[hidden] { display: none !important; }
.center-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
