/* ── Whiteboard View ── */
#whiteboard-view {
  padding: 0;
  overflow: hidden;
  position: relative;
}

#whiteboard-view.active {
  display: flex;
  flex: 1;
  min-width: 0;
}

#wb-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--wb-bg);
  position: relative;
  cursor: default;
}

#wb-board {
  width: 10000px;
  height: 10000px;
  position: absolute;
  background-image:
    radial-gradient(circle, var(--wb-dot) 1px, transparent 1px);
  background-size: 40px 40px;
}


/* ── Note Editing ── */
.wb-card-note.wb-note-editing {
  cursor: text;
  z-index: 2147483646;
  box-shadow: 0 0 0 2px var(--primary), 0 6px 24px var(--shadow);
}

.wb-card-note.wb-note-editing:active {
  cursor: text;
}

.wb-note-textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  border: none;
  outline: none;
  resize: none;
  overflow: auto;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

/* ── Note Resize Handle ── */
.wb-note-resize-handle {
  display: none;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  z-index: 10;
}

.wb-card-note:hover .wb-note-resize-handle {
  display: block;
}

.wb-note-resize-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text3);
  border-bottom: 2px solid var(--text3);
}

/* ── Link Cards ── */
.wb-link-loading {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.wb-link-thumb {
  width: 80px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}

.wb-link-info {
  min-width: 0;
  flex: 1;
}

.wb-link-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.wb-link-desc {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wb-link-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.wb-link-icon {
  flex-shrink: 0;
  font-size: 12px;
}

.wb-link-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Image Cards ── */
.wb-card-image {
  padding: 0;
  background: var(--bg3);
  overflow: hidden;
}

.wb-image {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}

.wb-image-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text2);
  text-align: center;
}

/* ── Video Cards (YouTube) ── */
.wb-card-link.wb-video-card {
  padding: 0;
  overflow: hidden;
  width: 360px;
}

.wb-video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background: #000;
  cursor: pointer;
}

.wb-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.wb-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
  padding-left: 4px;
}

.wb-video-play:hover {
  background: rgba(255,0,0,0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

.wb-video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.wb-video-container.playing .wb-video-iframe {
  pointer-events: auto;
}

.wb-video-title {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Add Button & Menu ── */
#wb-add-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow);
  z-index: 2147483647;
  transition: transform 0.15s, box-shadow 0.15s;
}

#wb-add-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px var(--shadow);
}

.wb-add-menu {
  position: absolute;
  bottom: 76px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 2147483647;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wb-add-menu-item {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s;
}

.wb-add-menu-item:hover {
  background: var(--surface2);
}

.wb-add-menu-item + .wb-add-menu-item {
  border-top: 1px solid var(--border);
}

/* ── File Drop Indicator ── */
#wb-viewport.wb-drag-over {
  background: var(--primary-bg) !important;
}

#wb-viewport.wb-drag-over::after {
  content: 'Drop image here';
  position: absolute;
  inset: 20px;
  border: 3px dashed var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0,0,0,0.15);
  z-index: 2147483647;
  pointer-events: none;
}

/* ── Whiteboard Split Layout ── */
#wb-split-layout {
  display: flex;
  flex: 1;
  min-width: 0;
  position: relative;
}

#wb-item-list {
  width: 280px;
  min-width: 280px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 8px;
  flex-shrink: 0;
}

#wb-canvas-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#wb-canvas-area {
  min-width: 0;
}

.wb-item-list-header {
  padding: 12px 12px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
}

/* Sidebar cards reuse kanban .board-card styles */
#wb-item-list .board-card {
  cursor: pointer;
  padding: 10px 12px;
  margin-bottom: 6px;
}

#wb-item-list .board-card .card-title {
  font-size: 12px;
}

#wb-item-list .board-card .badge {
  font-size: 10px;
  padding: 1px 6px;
}

#wb-item-list .board-card .card-assignee {
  font-size: 11px;
}

.wb-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text3);
  font-size: 15px;
  padding: 40px;
  text-align: center;
}

.wb-empty-canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text3);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  opacity: 0.6;
}

/* ── Context Menu ── */
.wb-context-menu {
  position: fixed;
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 2147483647;
  padding: 4px;
  display: none;
}

.wb-context-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
  gap: 20px;
}

.wb-context-menu-item:hover {
  background: var(--surface2);
}

.wb-context-menu-item.danger {
  color: var(--danger);
}

.wb-context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.wb-context-submenu-arrow {
  font-size: 10px;
  color: var(--text3);
}

.wb-context-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--shadow);
  padding: 8px;
  gap: 6px;
  flex-wrap: wrap;
  width: 130px;
  z-index: 2147483647;
}

.wb-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform 0.1s, border-color 0.1s;
  flex-shrink: 0;
}

.wb-color-swatch:hover {
  transform: scale(1.2);
  border-color: var(--text);
}

.wb-color-swatch-none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--bg3);
  color: var(--text3);
}
