/* Result page: dark mode = black background, white text */
:root[data-theme="dark"] body,
:root[data-theme="dark"] main {
  background: #000000 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .main-area,
:root[data-theme="dark"] .tox .tox-editor-container {
  background: #ffffff !important;
  color: #000000 !important;
}
:root[data-theme="dark"] .doc-action-meta-bar,
:root[data-theme="dark"] #loading-state {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}
:root[data-theme="dark"] .doc-action-meta-bar *,
:root[data-theme="dark"] #loading-state * {
  color: #ffffff !important;
  fill: #ffffff !important;
}
:root[data-theme="dark"] #document-title,
:root[data-theme="dark"] #process-date,
:root[data-theme="dark"] #original-filename {
  color: #ffffff !important;
}
/* TinyMCE in dark mode should mimic light mode */
:root[data-theme="dark"] .tox,
:root[data-theme="dark"] .tox .tox-toolbar,
:root[data-theme="dark"] .tox .tox-toolbar__primary,
:root[data-theme="dark"] .tox .tox-menubar,
:root[data-theme="dark"] .tox .tox-statusbar,
:root[data-theme="dark"] .tox .tox-edit-area {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #cccccc !important;
}
:root[data-theme="dark"] .tox .tox-tbtn,
:root[data-theme="dark"] .tox .tox-mbtn,
:root[data-theme="dark"] .tox .tox-tbtn svg,
:root[data-theme="dark"] .tox .tox-mbtn svg {
  color: #000000 !important;
  fill: #000000 !important;
}
:root[data-theme="dark"] .tox .tox-tbtn--enabled,
:root[data-theme="dark"] .tox .tox-tbtn:hover,
:root[data-theme="dark"] .tox .tox-tbtn:focus {
  background: #e0e0e0 !important;
  color: #000000 !important;
}
/* Minimalist Topbar-only Styles for ClarifyDocuments */
/* Removed dark toolbar restoration block – using light-mode styling */

/* Removed conflicting dark mode toolbar and editor container styles – using light-mode appearance */
/* Style dropdown selects inside toolbar */
:root[data-theme="dark"] .tox .tox-toolbar select {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #cccccc !important;
  border-radius: 2px !important;
}
:root[data-theme="dark"] .tox .doc-list-header {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #444444 !important;
  border-radius: 0;
  font-weight: 700;
}
.align-item.support-form {
  background: #000000 !important;
  border: 1px solid #444444 !important;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.docs-toolbar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, .08);
  padding: 4px 12px;
  margin: 16px 0 24px 0;
  gap: 0.5rem;
  min-height: 40px;
  overflow-x: auto;
}
.toolbar-select {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 4px;
  font-size: 15px;
  background: #fafafa;
  color: #222;
  height: 28px;
}
.toolbar-btn {
  background: none;
  border: none;
  color: #444;
  font-size: 17px;
  min-width: 28px;
  min-height: 28px;
  margin: 0 1px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.toolbar-btn:hover, .toolbar-btn:focus {
  background: #e8f0fe;
  color: #1967d2;
  outline: none;
}
.toolbar-divider {
  display: inline-block;
  width: 1px;
  height: 24px;
  background: #e0e0e0;
  margin: 0 6px;
}
.docs-toolbar .toolbar-btn[data-command="foreColor"] {
  border-bottom: 2px solid #000;
}
.docs-toolbar .toolbar-btn[data-command="hiliteColor"] {
  border-bottom: 2px solid #ff0;
}

/* END: SIDEBAR & TOPBAR */

/* SLIDES EDITOR STYLES (EMBEDDED) */
.layout { display: grid; grid-template-columns: 220px 1fr; height: calc(100vh - 54px); }
.sidebar { background:#fff; border-right:1px solid #e5e7eb; overflow: auto; }
.thumb { padding:10px; cursor:pointer; border-bottom:1px solid #f3f4f6; }
.thumb.active { background:#eef2ff; }
.thumb .thumb-canvas { width: 160px; height: 90px; background:#fff; border:1px solid #e5e7eb; margin:auto; display:flex; align-items:center; justify-content:center; color:#9ca3af; font-size:12px; }
.main { display:flex; flex-direction: column; justify-content:center; align-items:center; }
.toolbar {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 10px 18px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 22px;
  margin-bottom: 0;
  min-height: 56px;
}
.toolbar button { padding:8px 10px; border:1px solid #e5e7eb; border-radius:6px; background:#fff; cursor:pointer; }
.canvas-wrap {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  width: 100%;
}
.slide-canvas {
  width: 960px; height: 720px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  position: relative;
  margin-bottom: 32px;
}
.slide-content { width:100%; height:100%; padding:60px; box-sizing:border-box; }
.hidden { display:none; }
body.aspect-169 .slide-canvas { width: 1280px; height: 720px; }
body.aspect-43 .slide-canvas { width: 960px; height: 720px; }
@media print {
  body { background: #fff; }
  header, .sidebar, .toolbar { display: none !important; }
  .canvas-wrap { padding: 0; }
  body.aspect-169 .slide-canvas { width: 13.333in; height: 7.5in; border: none; box-shadow: none; }
  body.aspect-169 .slide-content { padding: 0.8in; }
  body.aspect-43 .slide-canvas { width: 10in; height: 7.5in; border: none; box-shadow: none; }
  body.aspect-43 .slide-content { padding: 0.8in; }
}

/* Auth Modal Styles */
#auth-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.36);
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#auth-modal.show { /* visible when toggled */
  display: flex;
}
#auth-modal[style*="display: none"], #auth-modal[hidden] {
  display: none !important;
}
.modal-content {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16);
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 370px;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}
.modal-content .close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  font-size: 1.35rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-content .close:hover {
  color: #222;
}
.auth-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.auth-tabs {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.tab-btn {
  background: none;
  border: none;
  font-size: 1.08rem;
  font-weight: 500;
  color: #666;
  padding: 0.45rem 1.2rem;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab-btn.active, .tab-btn:focus {
  background: #222;
  color: #fff;
}
.auth-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
}
.auth-form.active {
  display: flex;
}
.auth-form h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #222;
  text-align: center;
}
.auth-form input {
  border: 1px solid #ddd;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 1rem;
  outline: none;
  background: #fafafa;
  margin-bottom: 0.1rem;
}
.auth-form input:focus {
  border-color: #222;
}
.auth-form .btn {
  background: #222;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-form .btn:hover {
  background: #111;
}

/* Dark mode: Sign-in/Sign-up only (scoped to auth modal) */
:root[data-theme="dark"] #auth-modal .modal-content {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}
:root[data-theme="dark"] #auth-modal .modal-content * {
  color: #fff !important;
}
:root[data-theme="dark"] #auth-modal .close {
  color: #fff !important;
}

/* Tabs inside auth modal */
:root[data-theme="dark"] #auth-modal .auth-tabs .tab-btn {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}
:root[data-theme="dark"] #auth-modal .auth-tabs .tab-btn.active,
:root[data-theme="dark"] #auth-modal .auth-tabs .tab-btn:focus {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

/* Inputs inside auth modal */
:root[data-theme="dark"] #auth-modal .auth-form input,
:root[data-theme="dark"] #auth-modal .auth-form textarea,
:root[data-theme="dark"] #auth-modal .auth-form select {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] #auth-modal .auth-form input::placeholder,
:root[data-theme="dark"] #auth-modal .auth-form textarea::placeholder {
  color: #f5f5f5 !important;
}
:root[data-theme="dark"] #auth-modal .auth-form input:focus,
:root[data-theme="dark"] #auth-modal .auth-form textarea:focus,
:root[data-theme="dark"] #auth-modal .auth-form select:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25) !important;
  border-color: #fff !important;
}

/* Buttons inside auth modal */
:root[data-theme="dark"] #auth-modal .auth-form .btn {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}
:root[data-theme="dark"] #auth-modal .auth-form .btn:hover,
:root[data-theme="dark"] #auth-modal .auth-form .btn:focus {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

/* Consent/checkboxes/links inside auth modal */
:root[data-theme="dark"] #auth-modal #consent-boxes {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}
:root[data-theme="dark"] #auth-modal a { color: #fff !important; }
:root[data-theme="dark"] #auth-modal a:hover { text-decoration: underline !important; }
:root[data-theme="dark"] #auth-modal input[type="checkbox"] { accent-color: #fff !important; }

.layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  position: relative; /* allow absolute centering of nav */
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.03em;
}

.topbar-actions {
  display: flex;
  gap: 2rem;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* prevent the nav from shrinking or pushing other elements */
  white-space: nowrap;
}

/* Ensure the translate widget container doesn't squeeze nav */
.topbar #gt-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  z-index: 2; /* above centered nav if overlapping */
}

/* Remove unintended margins around buttons inside the right group */
#topbar-right .auth-btn,
#topbar-right #appearance-btn {
  margin: 0;
}

/* Compact dropdown menu alignment for appearance */
#appearance-container .dropdown-menu {
  right: 0;
  left: auto;
}

/* Group on the right: keep it right-aligned */
#topbar-right {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Make sure Google Translate select is visible */
select.goog-te-combo {
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-size: 12px !important;
  color: #111 !important;
}
/* Avoid any accidental hiding by global styles */
#google_translate_element, #google_translate_element * {
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== Dark Theme Overrides ===== */
:root[data-theme="dark"] {
  color-scheme: dark;
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] .layout-wrapper {
  background: #0b0f19;
  color: #e5e7eb;
}
:root[data-theme="dark"] .topbar {
  background: #111;
  border-bottom-color: #333;
}
:root[data-theme="dark"] .topbar-title {
  color: #e5e7eb;
}
:root[data-theme="dark"] .topbar-link {
  color: #e5e7eb;
}
:root[data-theme="dark"] .topbar-link:hover,
:root[data-theme="dark"] .topbar-link:focus {
  background: #e5e7eb;
  color: #111;
}
:root[data-theme="dark"] .auth-btn {
  border-color: #e5e7eb;
  background: #111;
  color: #e5e7eb;
}
:root[data-theme="dark"] .auth-btn:hover,
:root[data-theme="dark"] .auth-btn:focus {
  background: #e5e7eb;
  color: #111;
  border-color: #e5e7eb;
}
:root[data-theme="dark"] #appearance-btn {
  background: #111;
  border-color: #e5e7eb;
  color: #e5e7eb;
}
:root[data-theme="dark"] #appearance-container .dropdown-menu {
  background: #0f172a !important;
  border-color: #334155 !important;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5) !important;
}
:root[data-theme="dark"] #appearance-container .dropdown-item {
  color: #e5e7eb !important;
}
:root[data-theme="dark"] #appearance-container .dropdown-item:hover {
  background: #1f2937 !important;
}
:root[data-theme="dark"] select.goog-te-combo {
  background: #111 !important;
  color: #e5e7eb !important;
  border-color: #444 !important;
}
:root[data-theme="dark"] .main-content,
:root[data-theme="dark"] .main-area,
:root[data-theme="dark"] .upload-container,
:root[data-theme="dark"] .dashboard-container,
:root[data-theme="dark"] .layout-wrapper {
  background: #000000 !important;
  color: #fff !important;
}
/* Ensure all inner text, links, and headings are white */
:root[data-theme="dark"] .upload-container *,
:root[data-theme="dark"] .dashboard-container *,
:root[data-theme="dark"] .layout-wrapper * {
  color: #fff !important;
}
:root[data-theme="dark"] .upload-container a,
:root[data-theme="dark"] .dashboard-container a,
:root[data-theme="dark"] .layout-wrapper a {
  color: #fff !important;
}

/* Card/box surfaces in dark mode */
:root[data-theme="dark"] .doc-card,
:root[data-theme="dark"] .quiz-container,
:root[data-theme="dark"] .quiz-card,
:root[data-theme="dark"] .edit-container,
:root[data-theme="dark"] .clean-list,
:root[data-theme="dark"] .clean-list-header,
:root[data-theme="dark"] .doc-list-header,
:root[data-theme="dark"] .doc-row,
:root[data-theme="dark"] .bulk-actions,
:root[data-theme="dark"] .support-form {
  background: #000000 !important;
  color: #ffffff !important;
}
:root[data-theme="dark"] .docs-toolbar,
:root[data-theme="dark"] .upload-area,
:root[data-theme="dark"] .toolbar-select {
  background: #111827 !important; /* slate-900 */
  border-color: #334155 !important; /* slate-700 */
  box-shadow: 0 2px 12px rgba(0,0,0,0.35) !important;
  color: #e5e7eb !important;
}
:root[data-theme="dark"] .doc-card-title,
:root[data-theme="dark"] .quiz-title,
:root[data-theme="dark"] .editable-title {
  color: #e5e7eb !important;
}
:root[data-theme="dark"] .doc-card-meta,
:root[data-theme="dark"] .quiz-meta {
  color: #9CA3AF !important; /* gray-400 */
}
:root[data-theme="dark"] .doc-action-btn,
:root[data-theme="dark"] .quiz-option {
  background: #0f172a !important; /* slate-900 deeper */
  color: #E5E7EB !important;
  border: 1px solid #334155 !important;
}
:root[data-theme="dark"] .doc-action-btn:hover,
:root[data-theme="dark"] .doc-action-btn:focus,
:root[data-theme="dark"] .quiz-option:hover,
:root[data-theme="dark"] .quiz-option.selected {
  background: #2563EB !important; /* blue-600 */
  color: #fff !important;
  border-color: #2563EB !important;
}
:root[data-theme="dark"] .btn-upload,
:root[data-theme="dark"] .floating-upload-btn {
  background: #2563EB !important;
  color: #fff !important;
}
:root[data-theme="dark"] .toolbar-btn:hover,
:root[data-theme="dark"] .toolbar-btn:focus {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #93c5fd !important;
}

/* Support page: only force text color black; do not box all elements */
.support-form label,
.support-form h1,
.support-form h2,
.support-form h3,
.support-form p,
.support-form span {
  color: #000 !important;
}
/* Keep form fields readable */
.support-form input,
.support-form textarea,
.support-form select {
  color: #000 !important;
  background: #ffffff !important;
  border: 1px solid #ddd !important;
}

/* In dark mode, do NOT change ticket window surfaces */
:root[data-theme="dark"] .support-form {
  background: #fff !important;
  border-color: #e5e5e5 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05) !important;
}
:root[data-theme="dark"] .support-form .upload-area {
  background: #fff !important;
  border-color: #cbd5e1 !important;
  color: #000 !important;
  box-shadow: none !important;
}

/* Ensure white inputs stay white in dark mode */
:root[data-theme="dark"] .support-form input,
:root[data-theme="dark"] .support-form textarea,
:root[data-theme="dark"] .support-form select {
  background: #ffffff !important;
  color: #000 !important;
  border: 1px solid #ddd !important;
}


.topbar-link {
  text-decoration: none;
  color: #111;
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.topbar-link:hover, .topbar-link:focus {
  background: #222;
  color: #fff;
}

.auth-btn {
  margin-left: 2rem;
  border: 1px solid #222;
  background: #fff;
  color: #222;
  border-radius: 4px;
  padding: 0.25rem 0.9rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.auth-btn:hover, .auth-btn:focus {
  background: #222;
  color: #fff;
  border-color: #222;
}


.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.main-content, .hero, .hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}
.feature-preview {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.7rem;
  margin-bottom: 2.5rem;
  width: 100%;
}
.features {
  margin-top: -2cm;
}
.features-grid {
  gap: 2.5rem;
}

/* Center homepage hero section and CTA */
.hero-section, .cta-buttons {
  margin-bottom: 2.5rem;
}
/* Remove stray properties above that caused CSS errors */

/* Remove all sidebar remnants */
.sidebar, .sidebar-*, .sidebar.collapsed, .sidebar-header, .sidebar-logo, .sidebar-title, .sidebar-toggle, .sidebar-nav, .sidebar-link, .sidebar-icon, .sidebar.collapsed .sidebar-label {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #3B82F6;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.btn-upload {
  background: #3B82F6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(59,130,246,0.06);
}
.btn-upload:hover {
  background: #2563EB;
}
.profile-placeholder {
  background: #E5E7EB;
  color: #3B82F6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: bold;
}

.main-content {
  padding: 2rem 2.5rem 2rem 2.5rem;
  flex: 1;
  background: #F5F5F5;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  min-height: 0;
}

@media (max-width: 900px) {
  .sidebar {
    width: 64px;
  }
  .sidebar-title {
    display: none;
  }
  .main-content {
    padding: 1rem 0.5rem 1rem 0.5rem;
  }
  .topbar {
    padding: 0.75rem 1rem 0.75rem 1rem;
  }
}

/* Upload page: Document Type Selection */
.doc-type-select {
  margin: 2rem auto 1.5rem auto;
  text-align: center;
}
.doc-type-select h3 {
  margin-bottom: 1rem;
  color: #222;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Dark mode: make upload prompt text clearly visible */
:root[data-theme="dark"] .doc-type-select h3 {
  color: #fff !important;
}

/* Dark mode: style doc type buttons (Test, Slides, Class Notes, Other) */
:root[data-theme="dark"] .doc-type-btn {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

/* Dark mode: style dashboard view button (but not delete button) */
:root[data-theme="dark"] .btn.btn-small:not(.btn-danger) {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

/* Dark mode: override support form text to black (labels, headings, paragraphs, upload area, file types, buttons, radio label spans) */
:root[data-theme="dark"] .support-form label,
:root[data-theme="dark"] .support-form label span,
:root[data-theme="dark"] .support-form h1,
:root[data-theme="dark"] .support-form h3,
:root[data-theme="dark"] .support-form p,
:root[data-theme="dark"] .support-form .upload-content h3,
:root[data-theme="dark"] .support-form .upload-content p,
:root[data-theme="dark"] .support-form .file-types span,
:root[data-theme="dark"] .support-form .btn {
  color: #000 !important;
}

.doc-type-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.doc-type-btn {
  background: #E5EFFE;
  color: #2563EB;
  border: none;
  border-radius: 16px;
  padding: 1.2rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(59,130,246,0.08);
  outline: none;
}
.doc-type-btn.selected, .doc-type-btn:focus, .doc-type-btn:hover {
  background: #3B82F6;
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,0.16);
}
@media (max-width: 700px) {
  .doc-type-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  .doc-type-btn {
    width: 100%;
    padding: 1.2rem 0;
  }
}

.upload-area.disabled {
  opacity: 0.5;
  pointer-events: none;
  border: 2px dashed #d1d5db !important;
  background: #f3f4f6 !important;
}

/* Dark mode: force TinyMCE editor to light appearance */
:root[data-theme="dark"] .tox .tox-toolbar,
:root[data-theme="dark"] .tox .tox-editor-header,
:root[data-theme="dark"] .tox .tox-edit-area,
:root[data-theme="dark"] .tox .tox-statusbar,
:root[data-theme="dark"] .tox .tox-button,
:root[data-theme="dark"] .tox .tox-tbtn {
  background: #fff !important;
  color: #111 !important;
  border-color: #ccc !important;
}

/* Ensure toolbar icons and text are black */
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg *,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-label {
  color: #111 !important;
  fill: #111 !important;
}

/* Force all TinyMCE toolbar elements to light mode */
:root[data-theme="dark"] .tox .tox-toolbar,
:root[data-theme="dark"] .tox .tox-toolbar * {
  background: #fff !important;
  color: #111 !important;
  border-color: #ccc !important;
}

/* Additional toolbar subcomponents */
:root[data-theme="dark"] .tox .tox-toolbar__primary,
:root[data-theme="dark"] .tox .tox-toolbar__group {
  background: #fff !important;
  color: #111 !important;
  border-color: #ccc !important;
}

/* Ensure SVG path fill for toolbar icons is black */
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg path,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg polygon,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg rect,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg circle {
  fill: #111 !important;
  stroke: #111 !important;
}

/* Catch-all for all TinyMCE elements to enforce light mode */
:root[data-theme="dark"] .tox * {
  background: #fff !important;
  color: #111 !important;
}

/* Explicit component styling */
:root[data-theme="dark"] .tox .tox-editor-header,
:root[data-theme="dark"] .tox .tox-toolbar,
:root[data-theme="dark"] .tox .tox-edit-area,
:root[data-theme="dark"] .tox .tox-statusbar,
:root[data-theme="dark"] .tox .tox-content {
  background: #fff !important;
  color: #111 !important;
}

/* Force toolbar buttons and icons to light mode appearance */
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-label,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon {
  background: #fff !important;
  color: #111 !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg {
  fill: #111 !important;
  stroke: #111 !important;
}

/* Appearance button dark mode adaptation */
:root[data-theme="dark"] #appearance-btn {
  background: #222 !important;
  color: #fff !important;
  border-color: #fff !important;
}
/* Ensure SVG icon inherits color in dark mode */
:root[data-theme="dark"] #appearance-btn svg {
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* Appearance button dark mode hover */
:root[data-theme="dark"] #appearance-btn:hover {
  background: #fff !important;
  color: #111 !important;
  border-color: #222 !important;
}

/* Result page meta box white border in dark mode */
:root[data-theme="dark"] .doc-action-meta-bar {
  border: 1px solid #fff !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-label,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon {
  background: #fff !important;
  color: #111 !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg {
  fill: #111 !important;
  stroke: #111 !important;
}

/* Ensure all content text inside TinyMCE is black */
:root[data-theme="dark"] .tox .tox-content,
:root[data-theme="dark"] .tox .tox-content * {
  color: #111 !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-label,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon {
  background: #fff !important;
  color: #111 !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg {
  fill: #111 !important;
  stroke: #111 !important;
}


:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg path,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg polygon,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg rect,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg circle {
  fill: #111 !important;
  stroke: #111 !important;
}


:root[data-theme="dark"] .tox .tox-toolbar,
:root[data-theme="dark"] .tox .tox-toolbar * {
  background: #fff !important;
  color: #111 !important;
  border-color: #ccc !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon svg *,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-label {
  color: #111 !important;
  fill: #111 !important;
}
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn,
:root[data-theme="dark"] .tox .tox-toolbar .tox-tbtn .tox-icon {
  color: #111 !important;
  fill: #111 !important;
}


/* Dashboard: Document Cards */
.documents-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  justify-content: flex-start;
}
.doc-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(59,130,246,0.06);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 2rem;
  min-width: 300px;
  max-width: 420px;
  flex: 1 1 320px;
  margin-bottom: 0.5rem;
  transition: box-shadow 0.18s, transform 0.18s;
}
.doc-card:hover {
  box-shadow: 0 6px 24px rgba(59,130,246,0.15);
  transform: translateY(-2px) scale(1.01);
}
.doc-card-icon {
  font-size: 2.3rem;
  color: #3B82F6;
}
.doc-card-info {
  flex: 1;
}
.doc-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #222;
}
.doc-card-meta {
  font-size: 0.96rem;
  color: #6B7280;
  margin-top: 0.2rem;
}
.doc-card-actions {
  display: flex;
  gap: 0.5rem;
}
#lets-organizing-btn {
  background: #111 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: background 0.2s, color 0.2s;
}
#lets-organizing-btn:hover, #lets-organizing-btn:focus {
  background: #000 !important;
  color: #fff !important;
}
.doc-action-btn {
  background: #E5EFFE;
  border: none;
  border-radius: 8px;
  color: #2563EB;
  font-size: 1.15rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  outline: none;
}
.doc-action-btn:hover, .doc-action-btn:focus {
  background: #3B82F6;
  color: #fff;
}
.floating-upload-btn {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  background: #3B82F6;
  color: #fff;
  border-radius: 20px;
  padding: 1.1rem 2.2rem;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(59,130,246,0.18);
  z-index: 1000;
  text-decoration: none;
  transition: background 0.18s, transform 0.16s;
}
.floating-upload-btn:hover {
  background: #2563EB;
  transform: scale(1.04);
}
@media (max-width: 700px) {
  .documents-grid {
    flex-direction: column;
    gap: 1rem;
  }
  .doc-card {
    min-width: 0;
    max-width: 100%;
    padding: 1rem 1rem;
  }
  .floating-upload-btn {
    right: 1rem;
    bottom: 1rem;
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
  }
}

/* Quiz Page Styles */
.quiz-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  border: 1px solid #eee;
  margin: 2.5rem auto 2rem auto;
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  max-width: 720px;
  min-height: 440px;
}
.quiz-header {
  margin-bottom: 1.2rem;
}
.quiz-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 0.25em;
}
.quiz-meta {
  color: #444;
  font-size: 1.02rem;
  margin-top: 0.2em;
}
.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.quiz-card {
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
  border: 1px solid #eee;
  padding: 1.5rem 1.2rem;
  font-size: 1.13rem;
  color: #222;
  line-height: 1.7;
  word-break: break-word;
  position: relative;
}
.quiz-question {
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.quiz-option {
  background: #f5f5f5;
  color: #111;
  border: 1px solid #bbb;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  font-size: 1.08rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  outline: none;
  text-align: left;
}
.quiz-option.selected, .quiz-option:focus, .quiz-option:hover {
  background: #111;
  color: #fff;
}
.quiz-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.quiz-score {
  font-size: 1.15rem;
  font-weight: 600;
  color: #111;
  margin-top: 1.5rem;
  text-align: center;
}
.quiz-header {
  margin-bottom: 1.2rem;
}
.quiz-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #2563EB;
  margin-bottom: 0.25em;
}
.quiz-meta {
  color: #6B7280;
  font-size: 1.02rem;
  margin-top: 0.2em;
}
.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.quiz-card {
  background: #F5F7FB;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(59,130,246,0.04);
  padding: 1.5rem 1.2rem;
  font-size: 1.13rem;
  color: #222;
  line-height: 1.7;
  word-break: break-word;
  position: relative;
}
.quiz-question {
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2563EB;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.quiz-option {
  background: #E5EFFE;
  color: #2563EB;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  font-size: 1.08rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  outline: none;
  text-align: left;
}
.quiz-option.selected, .quiz-option:focus, .quiz-option:hover {
  background: #3B82F6;
  color: #fff;
}
.quiz-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.edit-container {
  margin: 2.5rem auto 2rem auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 18px rgba(0,0,0,0.04);
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  min-height: 440px;
}
.edit-header {
  margin-bottom: 1.2rem;
}
.editable-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #2563EB;
  border-radius: 8px;
  outline: none;
  transition: background 0.16s;
  padding: 0.1em 0.4em;
  margin-bottom: 0.25em;
  cursor: text;
  border: none;
  width: 100%;
}
.editable-title:focus {
  background: #e5effe;
}
.edit-meta {
  color: #6B7280;
  font-size: 1.02rem;
  margin-top: 0.2em;
}
.edit-toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.toolbar-btn {
  background: #E5EFFE;
  color: #2563EB;
  border: none;
  border-radius: 8px;
  font-size: 1.12rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  outline: none;
}
.toolbar-btn:hover, .toolbar-btn:focus {
  background: #3B82F6;
  color: #fff;
}
.edit-content {
  background: #F5F7FB;
  border-radius: 14px;
  padding: 2rem 1.5rem;
  font-size: 1.15rem;
  color: #222;
  min-height: 240px;
  margin-bottom: 1.7rem;
  box-shadow: 0 1px 6px rgba(59,130,246,0.04);
  line-height: 1.7;
  word-break: break-word;
  outline: none;
}
.edit-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Result View Styles */
.result-container {
  margin: 2.5rem auto 2rem auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 18px rgba(59,130,246,0.07);
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  max-width: 720px;
  min-height: 440px;
}
.editable-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #2563EB;
  border-radius: 8px;
  outline: none;
  transition: background 0.16s;
  padding: 0.1em 0.4em;
  margin-bottom: 0.25em;
  cursor: text;
}
.editable-title:focus {
  background: #e5effe;
}
.result-meta {
  color: #6B7280;
  font-size: 1.02rem;
  margin-top: 0.2em;
}
.result-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}
.document-content {
  background: #F5F7FB;
  border-radius: 14px;
  padding: 2rem 1.5rem;
  font-size: 1.15rem;
  color: #222;
  min-height: 240px;
  margin-top: 1.5rem;
  box-shadow: 0 1px 6px rgba(59,130,246,0.04);
  line-height: 1.7;
  word-break: break-word;
}
.btn {
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: #3B82F6;
  color: #fff;
  transition: background 0.16s;
}
.btn-secondary {
  background: #E5EFFE;
  color: #2563EB;
}
.btn-secondary:hover, .btn-secondary:focus {
  background: #3B82F6;
  color: #fff;
}
.btn-primary {
  background: #3B82F6;
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: #2563EB;
}
.dropdown {
  position: relative;
}
.dropdown-toggle {
  background: #3B82F6;
  color: #fff;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(59,130,246,0.12);
  min-width: 160px;
  z-index: 10;
  display: none;
  flex-direction: column;
  padding: 0.2rem 0;
}
.dropdown-item {
  background: none;
  border: none;
  color: #2563EB;
  font-size: 1.04rem;
  text-align: left;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: #E5EFFE;
  color: #2563EB;
}