/* Whiteboard cards — live on the meta-canvas, like notes on the sticky canvas */

.wb-board {
  position: relative;
  min-height: calc(100vh - 240px);
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
  cursor: grab;
  touch-action: none;
}

.wb-board.panning {
  cursor: grabbing;
}

.wb-surface {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
  will-change: transform;
  background: radial-gradient(circle, rgba(44, 44, 44, 0.14) 1px, transparent 1.5px) 0 0 / 24px 24px;
}

.wb-surface::before {
  content: '';
  position: absolute;
  left: -5000px;
  top: -5000px;
  width: 10000px;
  height: 10000px;
  background: inherit;
  z-index: -1;
  pointer-events: none;
}

.wb-card {
  position: absolute;
  width: 280px;
  height: 200px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.wb-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), 0 14px 28px rgba(0, 0, 0, 0.14);
}

.wb-card.dragging {
  cursor: grabbing !important;
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.14), 0 26px 40px rgba(0, 0, 0, 0.22);
}

.wb-card-thumb {
  /* basis 0 + min-height 0 so the thumbnail image can't use its intrinsic
     pixel size as the flex basis and squeeze the card body out of view. */
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, #f6f6f6 25%, #fafafa 25%, #fafafa 50%, #f6f6f6 50%, #f6f6f6 75%, #fafafa 75%) 0 0 / 16px 16px,
    #fafafa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wb-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.wb-card-body {
  /* Fixed at content height so it always has room — prevents the thumbnail
     from bullying the title out of the card. */
  flex: 0 0 auto;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: #fff;
}

.wb-card-title {
  font-weight: 600;
  color: #222;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-card-meta {
  font-size: 0.74rem;
  color: #888;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wb-card-actions {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: flex;
  gap: 0.15rem;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.wb-card:hover .wb-card-actions {
  opacity: 1;
}

.wb-card-actions button {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: #333;
}

.wb-card-actions button:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.25);
}

/* Meta-canvas toolbar — mirrors the notes canvas toolbar for consistency */
.wb-toolbar {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: none;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-size: 0.82rem;
  z-index: 50;
  user-select: none;
}

.wb-toolbar.visible {
  display: flex;
}

.wb-toolbar button {
  background: #f5f5f5;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.wb-toolbar button:hover {
  background: #eaeaea;
}

.wb-toolbar button.active {
  background: #ffd7a9;
  border-color: #e0a878;
}

.wb-toolbar .wb-zoom-label {
  min-width: 3.2rem;
  text-align: center;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.wb-toolbar .wb-sep {
  width: 1px;
  height: 16px;
  background: rgba(0, 0, 0, 0.14);
}

/* Mobile — same vertical layout as the desktop canvas cards (thumb up
   top, title + meta below) so the preview actually reads as a preview,
   not a thumb cropped to a tiny horizontal strip. */
.wb-mobile-list {
  display: none;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.4rem 0 1rem;
  align-items: center;
}

.wb-mobile-list.visible {
  display: flex;
}

.wb-mobile-list .wb-card {
  position: static;
  width: 100%;
  max-width: 420px;
  /* height grows with content — 160px of thumb + body = ~200px total. */
  height: auto;
  min-height: 210px;
  flex-direction: column;
  touch-action: manipulation;
  cursor: pointer;
}

.wb-mobile-list .wb-card-thumb {
  flex: 1 1 0;
  min-height: 160px;
  border-right: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.wb-mobile-list .wb-card-thumb img {
  object-fit: contain;
}

.wb-mobile-list .wb-card-body {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  gap: 0.15rem;
}

/* Always-visible delete button — no hover on touch. */
.wb-mobile-list .wb-card-actions {
  opacity: 1;
}

/* Empty state */
.wb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-direction: column;
  color: #666;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
}

.wb-empty h2 {
  font-size: 1.4rem;
  color: #333;
  margin: 0;
}

.wb-empty p {
  max-width: 420px;
  margin: 0;
}

/* Floating add button — reuse dashboard.css .fab */
