/* --- Ground Up FlipBoard Styles --- */
:root {
  --board-bg: #f9f9fb;
  --dry-erase-white: #ffffff;
  --marker-black: #1f2937;
  --marker-red: #ef4444;
  --marker-yellow: #f59e0b;
  --marker-green: #10b981;
  --marker-blue: #3b82f6;
  --marker-purple: #8b5cf6;
  
  --rule-color: rgba(59, 130, 246, 0.08); /* faint blue notebook line */
  --rule-spacing: 50px;
  
  --font-hand: 'Patrick Hand', cursive;
  --font-sans: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: #d1d5db; /* gray border around board */
  color: var(--marker-black);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Whiteboard container */
.whiteboard {
  width: 100vw;
  height: 100vh;
  background-color: var(--dry-erase-white);
  border: 12px solid #374151; /* aluminum frame */
  box-shadow: inset 0 0 10px rgba(0,0,0,0.15), 0 10px 25px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header */
.board-header {
  padding: 15px 30px;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: white;
  z-index: 10;
}

.board-title-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.board-logo {
  font-size: 28px;
}

.board-title {
  font-family: var(--font-hand);
  font-size: 32px;
  font-weight: normal;
  color: var(--marker-black);
}

.board-subtitle {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #6b7280;
}

.board-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  background: white;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.btn-primary {
  background: var(--marker-black);
  color: white;
  border-color: var(--marker-black);
}

.btn-primary:hover {
  background: #374151;
  border-color: #374151;
}

/* Notebook lined pattern page area */
.board-page-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background-color: var(--board-bg);
  background-image: linear-gradient(var(--rule-color) 1px, transparent 1px);
  background-size: 100% var(--rule-spacing);
  background-attachment: local;
  padding: 20px 40px 100px 40px;
}

/* Lined list items */
.task-list {
  list-style: none;
}

.task-line {
  height: var(--rule-spacing);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(0,0,0,0.05);
  font-family: var(--font-hand);
  font-size: 24px;
  padding: 0 10px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.task-line:hover {
  background-color: rgba(59, 130, 246, 0.02);
}

.task-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  overflow: hidden;
}

.task-num {
  color: #9ca3af;
  font-family: var(--font-sans);
  font-size: 14px;
  min-width: 25px;
}

.task-text-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.task-assignee {
  color: #4b5563;
  margin-right: 10px;
}

.priority-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.prio-urgent { background-color: var(--marker-red); }
.prio-normal { background-color: var(--marker-yellow); }
.prio-low { background-color: var(--marker-green); }

/* Completed task styling */
.task-line.done {
  text-decoration: line-through;
  color: #9ca3af;
  opacity: 0.6;
}

.task-line.done .task-assignee {
  color: #9ca3af;
}

/* Sidebar folders panel */
.sidebar {
  position: absolute;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100%;
  background: white;
  box-shadow: 5px 0 15px rgba(0,0,0,0.1);
  z-index: 100;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  left: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.folder-item {
  padding: 12px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.folder-item:hover {
  background: #f9fafb;
}

.folder-item.active {
  background: #eff6ff;
  border-color: #3b82f6;
}

.folder-title {
  font-weight: 600;
  font-size: 15px;
}

.folder-meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* Canvas drawing canvas and floating save button */
.drawing-container {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100% - 80px);
  z-index: 5;
  pointer-events: none; /* let clicks pass through when drawing is inactive */
}

.drawing-container.active {
  pointer-events: auto;
}

#paint-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating Save Button on the right */
.floating-save-btn {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s;
  border: 1px solid #e5e7eb;
}

.floating-save-btn:hover {
  transform: translateY(-50%) scale(1.05);
  background: #f9fafb;
}

.floating-save-btn span {
  font-size: 28px;
  color: var(--marker-black);
}

/* Floating Draw Toggle button at the bottom center */
.bottom-toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 30px;
  padding: 10px 25px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  display: flex;
  gap: 15px;
  z-index: 50;
  border: 1px solid #e5e7eb;
  align-items: center;
}

/* Modals and input forms */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

.modal-header {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Employee dropdown selector list */
.employee-select-popover {
  position: absolute;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 8px;
  z-index: 1000;
  display: none;
}

.employee-option {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-option:hover {
  background: #f3f4f6;
}

/* Material Icons webfont fallback if offline */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* Custom styled scrollbars */
.board-page-container::-webkit-scrollbar {
  width: 8px;
}

.board-page-container::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 4px;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  .whiteboard {
    border: 4px solid #374151;
  }
  .board-header {
    padding: 10px 15px;
  }
  .board-title {
    font-size: 24px;
  }
  .board-page-container {
    padding: 15px 15px 100px 15px;
  }
  .task-line {
    font-size: 18px;
    height: 45px;
  }
  .task-right {
    gap: 8px;
  }
  .btn span {
    display: none;
  }
}
