/* ═══ Tableau Blanc P2P ═══ */

/* Override main max-width for fullscreen canvas */
.wb-app {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 82px);
  overflow: hidden;
}

/* ── Toolbar ── */
.wb-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  z-index: 10;
}

.wb-tool-group {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.wb-separator {
  width: 1px;
  height: 24px;
  background: var(--glass-border);
  margin: 0 0.25rem;
}

.wb-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.wb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .wb-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.wb-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wb-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ── Couleurs ── */
.wb-color-picker {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.wb-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.wb-color-swatch:hover {
  transform: scale(1.15);
}

.wb-color-swatch.active {
  border-color: var(--text-primary);
}

.wb-color-custom {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
}

/* ── Épaisseur ── */
.wb-size-slider {
  width: 72px;
  accent-color: var(--accent);
}

.wb-size-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 26px;
  text-align: center;
}

/* ── P2P ── */
.wb-p2p-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wb-p2p-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wb-p2p-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.wb-p2p-dot.connected {
  background: #22c55e;
}

.wb-p2p-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.wb-participants {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}

.wb-participant-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

.wb-p2p-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.wb-p2p-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Canvas ── */
.wb-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #fff;
  cursor: crosshair;
}

[data-theme="dark"] .wb-canvas-wrapper {
  background: #1a1a2e;
}

.wb-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* ── Curseurs distants ── */
.wb-remote-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  transition: left 0.08s linear, top 0.08s linear;
}

.wb-remote-cursor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.wb-remote-cursor-label {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  color: #fff;
  position: absolute;
  top: 12px;
  left: 4px;
  white-space: nowrap;
}

/* ── Modal P2P ── */
.wb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wb-modal {
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
}

[data-theme="light"] .wb-modal {
  background: #fff;
}

.wb-modal h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.wb-modal label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.3rem;
}

.wb-modal-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  outline: none;
}

.wb-modal-input:focus {
  border-color: var(--accent);
}

.wb-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.wb-modal-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}

.wb-modal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .wb-modal-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.wb-modal-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wb-modal-btn.primary:hover {
  opacity: 0.85;
}

.wb-session-id {
  font-family: monospace;
  background: var(--glass-bg);
  padding: 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  word-break: break-all;
  margin: 0.5rem 0;
  border: 1px solid var(--glass-border);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .wb-toolbar {
    padding: 0.4rem 0.5rem;
    gap: 0.25rem;
  }

  .wb-btn {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .wb-color-swatch {
    width: 18px;
    height: 18px;
  }

  .wb-size-slider {
    width: 50px;
  }

  .wb-separator {
    height: 18px;
  }

  .wb-p2p-group {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}
