/* ============================================================
   OranguDraw — Fullscreen collaborative canvas
   Append to chat.css or load as draw.css
   ============================================================ */

/* ── FULLSCREEN TAKEOVER ──────────────────────────────────── */
#draw-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #1a1a2e;
  display: none;
  flex-direction: column;
  font-family: 'Nunito', sans-serif;
}

#draw-screen.open {
  display: flex;
}

/* ── TOP BAR ──────────────────────────────────────────────── */
#draw-topbar {
  height: 52px;
  background: rgba(10, 10, 30, 0.92);
  border-bottom: 1.5px solid rgba(255, 106, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
}

#draw-topbar-title {
  font-family: 'Pacifico', cursive;
  font-size: 15px;
  color: #ff6a00;
  letter-spacing: 0.03em;
  margin-right: 6px;
  white-space: nowrap;
}

#draw-resort-name {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-right: 10px;
}

.draw-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
  margin: 0 4px;
}

/* ── TOOL BUTTONS ─────────────────────────────────────────── */
.draw-tool-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  position: relative;
}

.draw-tool-btn:hover {
  background: rgba(255,106,0,0.15);
  border-color: rgba(255,106,0,0.5);
  color: #ff6a00;
  transform: translateY(-1px);
}

.draw-tool-btn.active {
  background: rgba(255,106,0,0.25);
  border-color: #ff6a00;
  color: #ff9a50;
  box-shadow: 0 0 10px rgba(255,106,0,0.3);
}

.draw-tool-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
}

/* Color & brush controls */
#draw-color-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

#draw-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.3);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#draw-color-swatch:hover { transform: scale(1.12); }

#draw-color-pick {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.draw-palette {
  display: flex;
  gap: 4px;
  align-items: center;
}

.draw-palette-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, border-color 0.12s;
}

.draw-palette-dot:hover {
  transform: scale(1.25);
  border-color: rgba(255,255,255,0.7);
}

.draw-slider-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.draw-slider-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.draw-slider-val {
  font-size: 11px;
  font-weight: 700;
  color: #ff9a50;
  min-width: 34px;
  text-align: right;
}

input[type="range"].draw-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type="range"].draw-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff6a00;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255,106,0,0.5);
}

/* Spacer */
#draw-topbar-spacer { flex: 1; }

/* Action buttons (export, clear, close) */
.draw-action-btn {
  height: 32px;
  padding: 0 12px;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}

.draw-action-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.draw-action-btn.danger {
  border-color: rgba(255,80,80,0.3);
  color: rgba(255,130,130,0.8);
}

.draw-action-btn.danger:hover {
  background: rgba(255,50,50,0.15);
  border-color: rgba(255,80,80,0.7);
  color: #ff8080;
}

.draw-action-btn.close-btn {
  background: rgba(255,106,0,0.12);
  border-color: rgba(255,106,0,0.4);
  color: #ff9a50;
}

.draw-action-btn.close-btn:hover {
  background: rgba(255,106,0,0.25);
  border-color: #ff6a00;
  color: #ffb880;
}

/* Undo/redo */
.draw-history-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.draw-history-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── BODY (canvas + layer panel) ──────────────────────────── */
#draw-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ── CANVAS WRAP ──────────────────────────────────────────── */
#draw-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1a1a2e;
  cursor: crosshair;
}

#draw-composite {
  position: absolute;
  inset: 0;
  image-rendering: pixelated;
}

#draw-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* ── LAYER PANEL ──────────────────────────────────────────── */
#draw-layer-panel {
  width: 200px;
  background: rgba(8, 8, 24, 0.95);
  border-left: 1.5px solid rgba(255,106,0,0.18);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

#draw-layer-header {
  padding: 12px 12px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.draw-layer-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,106,0,0.4);
  background: rgba(255,106,0,0.1);
  color: #ff9a50;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s;
}

.draw-layer-add-btn:hover {
  background: rgba(255,106,0,0.25);
  border-color: #ff6a00;
}

#draw-layer-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

#draw-layer-list::-webkit-scrollbar { width: 4px; }
#draw-layer-list::-webkit-scrollbar-track { background: transparent; }
#draw-layer-list::-webkit-scrollbar-thumb { background: rgba(255,106,0,0.25); border-radius: 4px; }

.draw-layer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  margin: 2px 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.draw-layer-row:hover {
  background: rgba(255,255,255,0.05);
}

.draw-layer-row.active {
  background: rgba(255,106,0,0.14);
  outline: 1px solid rgba(255,106,0,0.35);
}

.draw-layer-eye {
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.12s;
}

.draw-layer-eye:hover { opacity: 1; }

.draw-layer-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-layer-move {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.12s;
  flex-shrink: 0;
}

.draw-layer-move:hover { color: #ff9a50; }

#draw-layer-footer {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 6px;
}

.draw-layer-del-btn {
  flex: 1;
  height: 28px;
  border: 1.5px solid rgba(255,80,80,0.25);
  border-radius: 7px;
  background: rgba(255,50,50,0.07);
  color: rgba(255,130,130,0.7);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  transition: all 0.15s;
}

.draw-layer-del-btn:hover {
  background: rgba(255,50,50,0.18);
  border-color: rgba(255,80,80,0.6);
  color: #ff8080;
}

/* ── REMOTE CURSORS ───────────────────────────────────────── */
.draw-remote-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 200;
  display: flex;
  align-items: center;
  transform: translate(-2px, -2px);
  transition: left 0.06s linear, top 0.06s linear;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #draw-layer-panel { display: none; }

  #draw-topbar {
    gap: 4px;
    padding: 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #draw-topbar::-webkit-scrollbar { display: none; }

  .draw-slider-group { display: none; }
  .draw-sep { display: none; }
  #draw-resort-name { display: none; }
}

/* ── DRAW SIDEBAR BUTTON ──────────────────────────────────── */
.sidebar-draw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 106, 0, 0.1);
  border: 1.5px solid rgba(255, 106, 0, 0.35);
  border-style: solid;
  color: rgba(255, 180, 80, 0.9);
  transition: background 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.18s;
}

.sidebar-draw-btn:hover {
  background: rgba(255, 106, 0, 0.22);
  border-color: rgba(255, 106, 0, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 106, 0, 0.25);
}

/* Sidebar button in header area */
#draw-header-btn {
  position: relative;
}
