:root {
  --primary: #B4572E;
  --primary-hover: #96421F;
  --primary-subtle: rgba(180, 87, 46, 0.08);
  --secondary: #4A6B53;
  --secondary-hover: #37523e;
  --secondary-subtle: rgba(74, 107, 83, 0.10);
  --gold: #D9822B;
  --gold-subtle: rgba(217, 130, 43, 0.12);
  --bg: #FAF8F4;
  --card: #FFFFFF;
  --card-hover: #FDFBF8;
  --border: #E8E4DC;
  --border-strong: #D5CEBF;
  --text: #1E2022;
  --text-muted: #6B665D;
  --text-faint: #9E988D;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

/* Sidebar Drawer Navigation */
#sidebar-drawer {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
#sidebar-drawer.drawer-open {
  transform: translateX(0) !important;
}
#sidebar-drawer-backdrop {
  transition: opacity 0.2s ease;
}
#sidebar-drawer-backdrop.backdrop-open {
  opacity: 1 !important;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #D8D2C5;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #BDB5A4;
}

/* Drag overlay */
.drag-overlay {
  transition: all 0.2s ease-in-out;
}

/* File card hover & selected */
.file-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 32, 34, 0.06);
  border-color: var(--primary);
}
.file-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-subtle);
}

/* Kanban column */
.kanban-col {
  min-height: calc(100vh - 240px);
  background-color: #F4EFEB;
  border-radius: var(--radius-md);
  padding: 14px;
}

/* Kanban task card */
.task-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: grab;
}
.task-card:active {
  cursor: grabbing;
}
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 32, 34, 0.08);
}

/* Docx Document Page Styling (Clean A4 Paper look) */
.docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.docx-wrapper > section.docx {
  background: #FFFFFF !important;
  box-shadow: 0 4px 25px rgba(30, 32, 34, 0.08) !important;
  border: 1px solid #D5CEBF !important;
  border-radius: 4px !important;
  padding: 48px 56px !important;
  margin: 15px auto 40px auto !important;
  width: 100% !important;
  max-width: 820px !important;
  min-height: 850px !important;
  box-sizing: border-box !important;
  color: #1E2022 !important;
}

.docx-wrapper > section.docx p {
  margin-bottom: 0.8em !important;
  line-height: 1.6 !important;
}

/* Excel preview table */
.excel-table-container {
  overflow-x: auto;
  max-height: 70vh;
}
.excel-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: white;
}
.excel-table th, .excel-table td {
  border: 1px solid #D5CEBF;
  padding: 8px 12px;
  text-align: left;
}
.excel-table th {
  background-color: #F5F2EB;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}
.excel-table tr:hover {
  background-color: #FAF8F4;
}

/* Resize Handles */
#preview-resize-left::after, #preview-resize-right::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 40px;
  background-color: #D5CEBF;
  border-radius: 999px;
  opacity: 0.5;
  transition: opacity 0.15s, background-color 0.15s, transform 0.15s;
}
#preview-resize-left::after { left: 4px; }
#preview-resize-right::after { right: 4px; }
#preview-resize-left:hover::after, #preview-resize-right:hover::after {
  background-color: var(--primary);
  opacity: 1;
  transform: translateY(-50%) scaleY(1.2);
}

/* Modal animation */
.modal-enter {
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Deep Link Highlight Animation */
@keyframes deepLinkPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(180, 87, 46, 0.65);
    border-color: #B4572E;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(180, 87, 46, 0.2);
    border-color: #B4572E;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(180, 87, 46, 0);
  }
}
.deep-link-highlight {
  animation: deepLinkPulse 1.4s ease-in-out 3;
  border-color: #B4572E !important;
}

/* Whiteboard Viewport Fix */
#wb-canvas-container {
  position: relative !important;
  min-height: 640px !important;
  height: calc(100vh - 230px) !important;
  width: 100% !important;
  overflow: hidden !important;
}

#wb-viewport {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background-color: #FAF8F4 !important;
}

/* ==================== WHITEBOARD STYLES ==================== */
#wb-grid-layer {
  background-size: 24px 24px;
  background-image: radial-gradient(circle, #D5CEBF 1px, transparent 1px);
  opacity: 0.6;
}

.wb-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #4B5563;
  transition: all 0.15s ease;
}

.wb-tool-btn:hover {
  background-color: #F3F4F6;
  color: #1E2022;
}

.wb-tool-btn.active {
  background-color: #B4572E !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(180, 87, 46, 0.35);
}

.wb-sticky-note {
  position: absolute;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s ease;
  touch-action: none;
}

.wb-sticky-note:active {
  cursor: grabbing;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
}

.wb-sticky-note .note-textarea {
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #1E2022;
}

.wb-sticky-note .note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

.wb-image-card {
  position: absolute;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: white;
  border: 1px solid #E8E4DC;
  cursor: grab;
  touch-action: none;
  transition: box-shadow 0.15s ease;
}

.wb-image-card:active {
  cursor: grabbing;
}

.wb-image-card img {
  width: 100%;
  height: calc(100% - 24px);
  object-fit: contain;
  pointer-events: none;
}

.wb-image-card .card-bar {
  height: 24px;
  background: #FAF8F4;
  border-bottom: 1px solid #E8E4DC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 10px;
  color: #6B7280;
}

.wb-text-box {
  position: absolute;
  min-width: 120px;
  cursor: move;
  padding: 4px 8px;
  border-radius: 8px;
  background: transparent;
  transition: background 0.15s;
}

.wb-text-box:hover, .wb-text-box:focus-within {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wb-remote-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 40;
  transition: transform 0.08s linear;
  will-change: transform;
}

.wb-cursor-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin-top: 14px;
  margin-left: 8px;
}

/* Document revision list styles */
.rev-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 0.15s ease;
  background: white;
}

.rev-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(30, 32, 34, 0.04);
}

.rev-item.current {
  border-color: var(--primary);
  background: var(--primary-subtle);
}
