/* Copyright (c) 2026 Murr (https://github.com/vtstv) */

:root {
  --bg-dark: #0b0d13;
  --bg-canvas: #0e121b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-bg-hover: rgba(30, 41, 59, 0.85);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-bright: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);

  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Safe Area Insets */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  overflow: hidden;
  overflow-x: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

/* Canvas & Workspace Layering */
#board-container {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0);
  background-size: 28px 28px;
  cursor: crosshair;
}

#paint-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
  overscroll-behavior: none;
}

#laser-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  pointer-events: none;
  touch-action: none;
}

#canvas-world {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 0 0;
  z-index: auto !important;
}

#images-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: auto !important;
}

#notes-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: auto !important;
}

#cursor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

#reaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}

/* Drag & Drop Canvas Overlay Hint */
#drop-zone-overlay {
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.08);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: scale(0.98);
}

#drop-zone-overlay.drag-over {
  opacity: 1;
  transform: scale(1);
}

.drop-zone-text {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

/* Subtle, Non-Intrusive Footer Attribution */
.app-footer {
  position: absolute;
  bottom: max(8px, var(--sab));
  left: max(14px, var(--sal));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  opacity: 0.25;
  font-family: var(--font-mono);
  pointer-events: auto;
  transition: opacity var(--transition-fast);
}

.app-footer:hover,
.app-footer:focus-within {
  opacity: 0.6;
}

.app-footer a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.app-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .app-footer {
    display: none;
  }
}

#print-view-container {
  display: none;
}

@media print {
  @page {
    size: landscape;
    margin: 0;
  }
  html, body {
    background: #0b0d13 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  #board-container,
  #canvas-container,
  #app-header,
  #main-toolbar,
  .modal-backdrop,
  #cursor-layer,
  #reaction-dock,
  .app-footer,
  .color-popover,
  #drop-zone-overlay,
  .context-menu,
  #marquee-box,
  .settings-wrapper,
  .peers-counter,
  #toast-container,
  .draw-popover,
  .shapes-popover,
  .more-actions-popover,
  .cards-popover,
  .popover-panel {
    display: none !important;
  }
  #print-view-container {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw !important;
    height: 100vh !important;
    background: #0b0d13 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  #print-view-container img {
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
  }
}

