/* CourseMine Platform - Minimal CSS (Tailwind handles most styling) */

/* Code blocks */
pre {
  position: relative;
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
}
code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* Copy button on code blocks */
pre .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #a1a1aa;
  border-radius: 0.375rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
pre:hover .copy-btn {
  opacity: 1;
}
pre .copy-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #e4e4e7;
}
pre .copy-btn.copied {
  color: #4ade80;
}

/* Video iframe styling */
iframe {
  border-radius: 0.75rem;
}

/* Sortable drag-and-drop */
.sortable-item {
  position: relative;
  cursor: grab;
}

.chapter-drag-handle {
  display: none;
  width: 30px;
  cursor: grab;
  align-items: center;
  justify-content: center;
}

.chapter-drag-handle:hover {
  cursor: grabbing;
}

.edit-button,
.add-button {
  display: none;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #e4e4e7;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #1E98D8;
  box-shadow: 0 0 0 3px rgba(30, 152, 216, 0.1);
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 0.5rem;
  border: 1px solid #e4e4e7;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

table.dataTable thead th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717a;
  border-bottom: 1px solid #e4e4e7;
  padding: 0.75rem 1rem;
}

table.dataTable tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #3f3f46;
  border-bottom: 1px solid #f4f4f5;
}

table.dataTable tbody tr:hover {
  background-color: #fafafa;
}

/* Lesson page sidebar */
#course-sidebar::-webkit-scrollbar {
  width: 4px;
}
#course-sidebar::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 2px;
}
#course-sidebar {
  scrollbar-width: thin;
  scrollbar-color: #d4d4d8 transparent;
}

/* Lesson page: hide footer to keep sidebar full-height */
.lesson-page footer {
  display: none;
}

/* iOS Safari: compensate for bottom toolbar that never collapses on lesson page */
@supports (-webkit-touch-callout: none) {
  .lesson-bottom-nav {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 3rem);
  }
}

/* Flatpickr input styling */
.flatpickr-input {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #e4e4e7;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* Dark mode overrides */
.dark .dataTables_wrapper .dataTables_filter input {
  background-color: #27272a;
  border-color: #52525b;
  color: #f4f4f5;
}
.dark .dataTables_wrapper .dataTables_filter input:focus {
  border-color: #1E98D8;
  box-shadow: 0 0 0 3px rgba(30, 152, 216, 0.2);
}
.dark .dataTables_wrapper .dataTables_length select {
  background-color: #27272a;
  border-color: #52525b;
  color: #f4f4f5;
}
.dark table.dataTable thead th {
  color: #a1a1aa;
  border-bottom-color: #3f3f46;
}
.dark table.dataTable tbody td {
  color: #d4d4d8;
  border-bottom-color: #27272a;
}
.dark table.dataTable tbody tr:hover {
  background-color: #27272a;
}
.dark #course-sidebar::-webkit-scrollbar-thumb {
  background: #52525b;
}
.dark #course-sidebar {
  scrollbar-color: #52525b transparent;
}
.dark .flatpickr-input {
  background-color: #27272a;
  border-color: #52525b;
  color: #f4f4f5;
}
