/* Custom Stationery & Notebook Aesthetics */

:root {
  --paper-bg: #FFFDF9;
  --grid-line: rgba(226, 218, 208, 0.6);
  --rule-line: rgba(235, 200, 200, 0.45);
}

body {
  font-family: 'Tajawal', sans-serif;
  user-select: none;
  touch-action: manipulation;
}

.font-cairo {
  font-family: 'Cairo', sans-serif;
}

.font-kufi {
  font-family: 'Reem Kufi', sans-serif;
}

/* Paper Grid & Notebook Backgrounds */
.paper-grid {
  background-color: #FAF7F2;
  background-image: 
    radial-gradient(#d8cfc0 1px, transparent 1px);
  background-size: 24px 24px;
}

.paper-grid.lines-mode {
  background-image: linear-gradient(0deg, #e7decb 1px, transparent 1px);
  background-size: 100% 32px;
}

.paper-grid.blank-mode {
  background-image: none;
  background-color: #F8F5EE;
}

/* Notebook holes along right margin */
.notebook-holes {
  width: 16px;
}
.notebook-holes::before,
.notebook-holes::after {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #EDE5D8;
  border: 1.5px solid #DCD0C0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.12);
  margin: 28px 0;
}

/* Washi Tape styling */
.washi-tape {
  background: rgba(254, 240, 138, 0.85);
  border-left: 2px dashed rgba(202, 138, 4, 0.4);
  border-right: 2px dashed rgba(202, 138, 4, 0.4);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 700;
  color: #854d0e;
  font-size: 11px;
}

/* Drawing Canvas & Mode */
#drawingCanvas {
  touch-action: none;
}

#drawingCanvas.drawing-active {
  pointer-events: auto !important;
  cursor: crosshair;
}

.draw-tool-btn.active {
  background-color: #EDE9FE;
  color: #5B21B6;
  border: 1px solid #C4B5FD;
}

.draw-color-dot.active {
  ring: 2px solid #7C3AED;
  outline: 2px solid #7C3AED;
  outline-offset: 1px;
  transform: scale(1.15);
}

.draw-width-btn.active {
  background-color: #EDE9FE;
  border-color: #8B5CF6;
}

/* Sticky Note styling */
.sticky-note {
  position: absolute;
  width: 220px;
  min-height: 160px;
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: grab;
  user-select: text;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  pointer-events: auto;
  z-index: 30;
}

.sticky-note:active {
  cursor: grabbing;
  box-shadow: 0 18px 26px -6px rgba(0, 0, 0, 0.22);
}

.sticky-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}

/* Research Image Frame on Canvas */
.canvas-image-card {
  position: absolute;
  background: #FFFFFF;
  padding: 10px 10px 28px 10px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  cursor: grab;
  pointer-events: auto;
  z-index: 25;
  transition: box-shadow 0.15s ease;
  max-width: 320px;
}

.canvas-image-card:active {
  cursor: grabbing;
  box-shadow: 0 14px 30px rgba(0,0,0,0.22);
}

/* Sticker on Canvas */
.canvas-sticker {
  position: absolute;
  cursor: grab;
  pointer-events: auto;
  z-index: 28;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12));
}

.canvas-sticker.selected {
  outline: 2px dashed #6366F1;
  outline-offset: 4px;
  border-radius: 12px;
}

.sticker-action-dock {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  color: #FFFFFF;
  padding: 3px 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  z-index: 60;
  white-space: nowrap;
}

.sticker-action-dock button {
  padding: 2px 5px;
  font-size: 11px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  color: #FFFFFF;
  line-height: 1;
}

.sticker-action-dock button:hover {
  background: rgba(255,255,255,0.25);
}

.canvas-sticker:hover {
  transform: scale(1.06);
}

.canvas-sticker:active {
  cursor: grabbing;
  transform: scale(1.12);
}

/* Sticker grid button in drawer */
.sticker-item-btn {
  background: white;
  border: 1px solid #E2DAD0;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.sticker-item-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  border-color: #F59E0B;
}

.sticker-item-btn:active {
  transform: scale(0.95);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn {
  animation: fadeIn 0.2s ease-out forwards;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #D8CFBF;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #C4BAA9;
}