:root {
  --accent-color: #8b5cf6;
  --accent-color-rgb: 139, 92, 246;
  --accent-color-light: #a78bfa;
  --accent-color-lighter: #c4b5fd;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --success-color: #10b981;
  --transition-speed: 0.3s;
  --glow-intensity: 0;
  
  /* Page Dimensions & Zoom */
  --page-scale: 1;
  --page-width: 816px;
  --page-height: 1056px;
  --page-gap: 40px;

  /* Canvas Themes Default (Classic) */
  --canvas-bg: #000000;
  --canvas-text: #e0e0e0;
  --canvas-border: #1a1a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', 'Arial', sans-serif;
}

option {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.light-theme option {
  background-color: #ffffff;
  color: #1a1a1a;
}

/* Dark Mode Defaults (The "Self-Luminous" System) */
body {
  background: #000000; 
  color: #e0e0e0;
  font-family: 'Roboto', 'Arial', sans-serif;
}

#docLibrary {
  background: rgba(5, 2, 13, 0.8) !important;
}

.doc-item {
  background: linear-gradient(90deg, #0a0a0a 0%, #1a1a1a 100%) !important;
  border-bottom: 1px solid #2a2a2a !important;
  transition: all 0.3s ease;
  animation: fadeIn 0.4s ease-out backwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc-item:nth-child(1) { animation-delay: 0.05s; }
.doc-item:nth-child(2) { animation-delay: 0.1s; }
.doc-item:nth-child(3) { animation-delay: 0.15s; }
.doc-item:nth-child(4) { animation-delay: 0.2s; }
.doc-item:nth-child(5) { animation-delay: 0.25s; }

.create-doc-card {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
  border: 2px solid #333;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.create-doc-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

body.light-theme .create-doc-card {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .create-doc-card:hover {
  border-color: var(--accent-color) !important;
  box-shadow: 0 10px 15px -3px rgba(var(--accent-color-rgb), 0.2) !important;
}

.delete-doc-btn {
  background: transparent !important;
  border: none !important;
  color: #6b7280 !important;
  padding: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border-radius: 6px !important;
}

.delete-doc-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

.editor-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  max-width: none;
  width: calc(var(--page-width) * var(--page-scale));
  height: calc(var(--page-height) * var(--page-scale));
  flex-shrink: 0;
  position: relative;
  display: block;
  overflow: visible;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--page-gap);
  transition: height 0.3s ease, width 0.3s ease;
}

#profileModal > div {
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.9) 0%, rgba(17, 17, 17, 0.8) 50%, rgba(13, 13, 13, 0.9) 100%) !important;
  border: 1px solid #333;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
}

.profile-input {
  background: #111111;
  border: 1px solid #2a2a2a;
  color: #e0e0e0;
}

/* Light Mode: Studio White (The "Reflective Surface" System) */
body.light-theme {
  background: #f0f2f5; /* More distinct background grey */
  color: #111827;
}

body.light-theme #docLibrary {
  background: #f0f2f5 !important;
}

body.light-theme .doc-item {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  margin-bottom: 12px;
  border-radius: 10px;
}

/* Darker Alternating Gradients for Light Mode - No Pure White */
body.light-theme .doc-item:nth-child(odd) {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
  border-left: 4px solid var(--accent-color) !important;
}

body.light-theme .doc-item:nth-child(even) {
  background: linear-gradient(225deg, #cbd5e1 0%, #94a3b8 100%) !important;
  border-left: 4px solid #475569 !important;
}

body.light-theme .doc-item:hover {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(8px);
  border-color: var(--accent-color) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3) !important;
  transform: scale(1.02) translateY(-8px);
  z-index: 100;
}

body.light-theme #createNewDoc {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme #createNewDoc:hover {
  border-color: var(--accent-color) !important;
  box-shadow: 0 10px 15px -3px rgba(var(--accent-color-rgb), 0.2) !important;
}

body.light-theme #createNewDoc > div:first-child {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
  color: var(--accent-color) !important;
}

body.light-theme .ql-editor {
  color: #111827;
}

body.light-theme #profileModal > div {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid #ced4da !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
}

body.light-theme .profile-input {
  background: #f8f9fa !important;
  border: 1px solid #ced4da !important;
  color: #1f2937 !important;
}

body.light-theme .profile-tab {
  color: #4b5563 !important;
}

body.light-theme .profile-tab.active {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.light-theme .doc-title-text { color: #000000 !important; font-weight: 700 !important; }
body.light-theme .doc-meta-text { color: #000000 !important; }
body.light-theme .doc-icon-container i { color: #dee2e6 !important; }

body.light-theme #docLibrary {
  background: rgba(248, 249, 250, 0.8) !important;
  transition: background 0.45s ease-in-out;
}

body.light-theme .doc-item {
  background: #ffffff !important;
  border-bottom: 8px solid #f8f9fa !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.3s ease-in-out;
  border-radius: 8px;
}

body.light-theme .doc-item:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08) !important;
  position: relative;
  z-index: 10;
}

body.light-theme #docSearch {
  background: #f1f3f5 !important;
  border: 1px solid #e9ecef !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  color: #1a1a1a !important;
  transition: all 0.3s ease;
}

body.light-theme #docSearch:focus {
  background: #ffffff !important;
}

body.light-theme .doc-title-text {
  color: #1a1a1a !important;
}

body.light-theme .doc-meta-text {
  color: #6c757d !important;
}

body.light-theme .doc-icon-container {
  color: #dee2e6;
  font-size: 20px;
}

body.light-theme #createNewDoc {
  background: #ffffff !important;
  border: 1px solid #e9ecef !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
  border-radius: 8px;
  transition: all 0.3s ease;
}

body.light-theme #createNewDoc:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-4px) !important;
}

body.light-theme #createNewDoc > div {
  background: #f8f9fa !important;
}

/* Scrollbars Studio White */
body.light-theme ::-webkit-scrollbar-track {
  background: transparent;
}

body.light-theme ::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 10px;
  border: 4px solid #f8f9fa;
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

#dynamic-background {
  transition: opacity 0.5s ease;
}

.header {
  background: linear-gradient(
    90deg,
    #050505 0%,
    #0a0a0a 25%,
    #111111 50%,
    #0a0a0a 75%,
    #050505 100%
  );
  border-bottom: 1px solid #1a1a1a;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.15);
  min-height: 36px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.title-bar {
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  padding: 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 28px;
  flex-shrink: 0;
}

body.light-theme .title-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #d1d5db !important;
}

.header-save-as-btn {
  color: #b0b0b0;
  border: 1px solid #333 !important;
}

body.light-theme .header-save-as-btn {
  color: #000000 !important;
  border: 1px solid #000000 !important;
  background: #ffffff !important;
}

body.light-theme .header-save-as-btn:hover {
  background: #f3f4f6 !important;
}

.doc-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-color-lighter);
  background-color: transparent;
  border: none;
  outline: none;
  padding: 0 12px;
  border-radius: 6px;
  transition: all 0.3s;
  text-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.3);
}

.doc-title:hover {
  color: var(--accent-color-light);
  background: rgba(var(--accent-color-rgb), 0.1);
  text-shadow: 0 0 25px rgba(var(--accent-color-rgb), 0.5);
}

.doc-title:focus {
  color: var(--accent-color-light);
  background: rgba(var(--accent-color-rgb), 0.15);
  box-shadow:
    0 0 20px rgba(var(--accent-color-rgb), 0.3),
    inset 0 0 10px rgba(var(--accent-color-rgb), 0.1);
  text-shadow: 0 0 25px rgba(var(--accent-color-rgb), 0.6);
}

.toolbar {
  background-color: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  padding: 8px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

body.light-theme .toolbar {
  background-color: #faf8ff;
  border-bottom: 2px solid #e0b5f6;
}

.toolbar-group {
  display: flex;
  gap: 4px;
  align-items: center;
  border-right: 1px solid #2a2a2a;
  padding-right: 12px;
}

.toolbar-group:last-child {
  border-right: none;
  padding-right: 0;
}

.toolbar-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  color: #b0b0b0;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-btn:hover {
  background-color: rgba(var(--accent-color-rgb), 0.15);
  color: var(--accent-color-light);
  box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.3);
  border-radius: 6px;
}

.toolbar-btn:active {
  background-color: rgba(var(--accent-color-rgb), 0.25);
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.4);
}

.toolbar-btn.active {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-light) 100%);
  color: #ffffff;
  box-shadow:
    0 0 25px rgba(var(--accent-color-rgb), 0.6),
    inset 0 0 10px rgba(var(--accent-color-rgb), 0.2);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

select {
  border: 1px solid var(--accent-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  background-color: #1a1a1a;
  color: var(--accent-color-lighter);
  min-width: 80px;
  height: 24px;
  transition: all 0.3s;
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.2);
}

select option {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

select:hover {
  box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.4);
  background-color: rgba(var(--accent-color-rgb), 0.05);
}

select:focus {
  outline: none;
  box-shadow:
    0 0 20px rgba(var(--accent-color-rgb), 0.5),
    inset 0 0 5px rgba(var(--accent-color-rgb), 0.1);
}

/* Specific widths for font controls */
.ql-font {
  width: 100px !important; /* Reduced width */
}

.ql-size {
  width: 60px !important; /* Reduced width */
}

body.light-theme select,
body.light-theme .ql-align,
body.light-theme .ql-picker {
  border: 1px solid var(--accent-color);
  background-color: #f3e8ff;
  color: var(--accent-color);
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.2);
}

body.light-theme select option {
  background-color: #ffffff;
  color: #1a1a1a;
}

body.light-theme select:hover,
body.light-theme .ql-align:hover,
body.light-theme .ql-picker:hover {
  box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.4);
}

/* Quill format select dropdown styling */
.ql-align,
.ql-picker {
  border: 1px solid var(--accent-color) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  background-color: #1a1a1a !important;
  color: var(--accent-color-lighter) !important;
  min-width: 80px !important;
  height: 24px !important;
  transition: all 0.3s !important;
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.2) !important;
}

/* Custom Fonts */
.ql-font-roboto {
  font-family: 'Roboto', sans-serif;
}
.ql-font-open-sans {
  font-family: 'Open Sans', sans-serif;
}
.ql-font-lato {
  font-family: 'Lato', sans-serif;
}
.ql-font-montserrat {
  font-family: 'Montserrat', sans-serif;
}
.ql-font-oswald {
  font-family: 'Oswald', sans-serif;
}
.ql-font-merriweather {
  font-family: 'Merriweather', serif;
}
.ql-font-arial {
  font-family: 'Arial', sans-serif;
}
.ql-font-times-new-roman {
  font-family: 'Times New Roman', serif;
}
.ql-font-courier-new {
  font-family: 'Courier New', monospace;
}
.ql-font-georgia {
  font-family: 'Georgia', serif;
}
.ql-font-verdana {
  font-family: 'Verdana', sans-serif;
}

.ql-font-lobster { font-family: 'Lobster', cursive; }
.ql-font-pacifico { font-family: 'Pacifico', cursive; }
.ql-font-bebas-neue { font-family: 'Bebas Neue', sans-serif; }
.ql-font-anton { font-family: 'Anton', sans-serif; }
.ql-font-dancing-script { font-family: 'Dancing Script', cursive; }
.ql-font-shadows-into-light { font-family: 'Shadows Into Light', cursive; }
.ql-font-abril-fatface { font-family: 'Abril Fatface', cursive; }
.ql-font-playfair-display { font-family: 'Playfair Display', serif; }
.ql-font-indie-flower { font-family: 'Indie Flower', cursive; }
.ql-font-amatic-sc { font-family: 'Amatic SC', cursive; }
.ql-font-caveat { font-family: 'Caveat', cursive; }
.ql-font-comfortaa { font-family: 'Comfortaa', cursive; }
.ql-font-righteous { font-family: 'Righteous', cursive; }
.ql-font-cinzel { font-family: 'Cinzel', serif; }
.ql-font-poppins { font-family: 'Poppins', sans-serif; }
.ql-font-raleway { font-family: 'Raleway', sans-serif; }
.ql-font-nunito { font-family: 'Nunito', sans-serif; }
.ql-font-quicksand { font-family: 'Quicksand', sans-serif; }
.ql-font-inconsolata { font-family: 'Inconsolata', monospace; }
.ql-font-ubuntu { font-family: 'Ubuntu', sans-serif; }
.ql-font-bitter { font-family: 'Bitter', serif; }
.ql-font-dosis { font-family: 'Dosis', sans-serif; }
.ql-font-josefin-sans { font-family: 'Josefin Sans', sans-serif; }
.ql-font-libre-baskerville { font-family: 'Libre Baskerville', serif; }
.ql-font-mulish { font-family: 'Mulish', sans-serif; }
.ql-font-pt-sans { font-family: 'PT Sans', sans-serif; }
.ql-font-pt-serif { font-family: 'PT Serif', serif; }
.ql-font-titillium-web { font-family: 'Titillium Web', sans-serif; }
.ql-font-varela-round { font-family: 'Varela Round', sans-serif; }
.ql-font-zilla-slab { font-family: 'Zilla Slab', serif; }
.ql-font-fira-sans { font-family: 'Fira Sans', sans-serif; }
.ql-font-work-sans { font-family: 'Work Sans', sans-serif; }
.ql-font-dm-sans { font-family: 'DM Sans', sans-serif; }
.ql-font-ibm-plex-sans { font-family: 'IBM Plex Sans', sans-serif; }
.ql-font-karla { font-family: 'Karla', sans-serif; }
.ql-font-crimson-text { font-family: 'Crimson Text', serif; }
.ql-font-source-sans-pro { font-family: 'Source Sans Pro', sans-serif; }
.ql-font-source-serif-pro { font-family: 'Source Serif Pro', serif; }
.ql-font-space-mono { font-family: 'Space Mono', monospace; }
.ql-font-exo-2 { font-family: 'Exo 2', sans-serif; }
.ql-font-kanit { font-family: 'Kanit', sans-serif; }
.ql-font-maven-pro { font-family: 'Maven Pro', sans-serif; }
.ql-font-signika { font-family: 'Signika', sans-serif; }
.ql-font-bree-serif { font-family: 'Bree Serif', serif; }
.ql-font-fjalla-one { font-family: 'Fjalla One', sans-serif; }
.ql-font-patua-one { font-family: 'Patua One', serif; }
.ql-font-arvo { font-family: 'Arvo', serif; }
.ql-font-vollkorn { font-family: 'Vollkorn', serif; }
.ql-font-old-standard-tt { font-family: 'Old Standard TT', serif; }
.ql-font-great-vibes { font-family: 'Great Vibes', cursive; }

.ql-picker-label {
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ql-picker-options {
  background-color: #1a1a1a !important;
  border: 1px solid var(--accent-color) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.ql-picker-item {
  color: var(--accent-color-lighter) !important;
}

.ql-picker-item:hover {
  background-color: rgba(var(--accent-color-rgb), 0.2) !important;
  color: white !important;
}

body.light-theme .ql-picker-options {
  background-color: #ffffff !important;
  border: 1px solid var(--accent-color) !important;
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.2) !important;
}

body.light-theme .ql-picker-item {
  color: #1a1a1a !important;
}

body.light-theme .ql-picker-item:hover {
  background-color: #f3e8ff !important;
  color: var(--accent-color) !important;
}

.ql-align:hover {
  box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.4) !important;
  background-color: rgba(var(--accent-color-rgb), 0.05) !important;
}

.ql-align:focus {
  outline: none !important;
  box-shadow:
    0 0 20px rgba(var(--accent-color-rgb), 0.5),
    inset 0 0 5px rgba(var(--accent-color-rgb), 0.1) !important;
}

/* Workspace Layout */
.main-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  width: 100%;
  background: transparent;
}

body.light-theme .main-workspace {
  background: #f3f4f6 !important;
}

.sidebar {
  width: 250px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(var(--accent-color-rgb), 0.1);
  display: none;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  z-index: 20;
  overflow-y: auto;
}

body.light-theme .sidebar {
  background: rgba(255, 255, 255, 0.4);
  border-right-color: rgba(var(--accent-color-rgb), 0.1);
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid rgba(var(--accent-color-rgb), 0.1);
  width: 150px;
  display: none;
}

.sidebar-header {
  padding: 12px 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-color-light);
  border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.1);
  font-weight: bold;
}

/* Outline Styles */
.outline-container {
  padding: 10px 0;
}

.outline-item {
  padding: 6px 16px;
  font-size: 13px;
  color: #b0b0b0;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid transparent;
}

body.light-theme .outline-item {
  color: #444;
}

.outline-item:hover {
  background: rgba(var(--accent-color-rgb), 0.1);
  color: white;
}

body.light-theme .outline-item:hover {
  color: var(--accent-color);
}

.outline-item.active {
  color: var(--accent-color-light);
  border-left-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.05);
}

.outline-h1 { font-size: 14px; font-weight: bold; padding-left: 16px; }
.outline-h2 { font-size: 13px; padding-left: 28px; }
.outline-h3 { font-size: 12px; padding-left: 40px; color: #888; }

/* Minimap Styles */
#minimap {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
}

#minimap:hover {
  opacity: 1;
}

.minimap-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(var(--accent-color-rgb), 0.1);
  border: 1px solid var(--accent-color);
  pointer-events: none;
}

/* Pages Container - Word-like view */
.pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 40px 120px 40px;
  background: transparent;
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
  gap: 30px;
  z-index: 10;
  position: relative;
  scroll-behavior: smooth;
}

body.glow-enabled .pages-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 50% 30%,
    rgba(var(--accent-color-rgb), 0.15) 0%,
    rgba(var(--accent-color-rgb), 0.05) 30%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.page-scaler {
  background: #0d0d0d;
  padding: 60px 80px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  border: 1px solid #1a1a1a !important;
  border-radius: 4px;
  transform: scale(var(--page-scale));
  transform-origin: 0 0;
  transition:
    box-shadow 0.3s ease,
    outline-color 0.3s ease,
    transform 0.3s ease;
  width: var(--page-width);
  height: var(--page-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.editor-container:hover .page-scaler {
  outline: none;
  box-shadow: none;
}

/* Page Border Accent (Toggleable) */
.editor-container.border-enabled .page-scaler {
  outline: 2px solid var(--accent-color);
}

.editor-container.border-enabled:hover .page-scaler {
  outline-color: var(--accent-color-light);
}

/* Page Glow Effect (Toggleable) */
.editor-container.glow-effect .page-scaler {
  box-shadow:
    0 0 40px rgba(var(--accent-color-rgb), 0.3),
    0 0 80px rgba(var(--accent-color-rgb), 0.1);
}

.editor-container.glow-effect:hover .page-scaler {
  box-shadow:
    0 0 60px rgba(var(--accent-color-rgb), 0.6),
    0 0 120px rgba(var(--accent-color-rgb), 0.3),
    0 0 180px rgba(var(--accent-color-rgb), 0.15),
    inset 0 0 30px rgba(var(--accent-color-rgb), 0.1),
    inset 0 0 60px rgba(var(--accent-color-rgb), 0.05);
}

.editor-container.glow-effect .page-scaler::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 80px;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--accent-color-rgb), 0.3) 0%,
    rgba(var(--accent-color-rgb), 0.1) 40%,
    transparent 70%
  );
  filter: blur(20px);
  opacity: 0.6;
}

body.light-theme .page-scaler {
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .page-editor,
body.light-theme .ql-editor {
  color: #111827 !important;
}

#editor {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
  outline: none;
  padding: 0 !important;
  margin: 0 !important;
  height: auto;
  overflow: hidden !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
}

.page-editor {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
  outline: none;
  padding: 0 !important;
  margin: 0 !important;
  height: 100%;
  overflow: hidden !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
}

.ql-container {
  font-size: 15px;
  border: none !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ql-editor {
  flex: 1;
  min-height: 100%;
  padding: 0 !important;
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
  border: none !important;
  font-family: 'Inter', 'Segoe UI', 'Arial', sans-serif;
}

.ql-editor.ql-blank::before {
  color: #666 !important;
  font-style: italic;
  font-weight: 300;
  left: 0 !important;
  right: 0 !important;
  opacity: 0.4;
  pointer-events: none;
}

/* Quill toolbar styling */
.ql-toolbar {
  background: #0d0d0d !important;
  border: 1px solid #2a2a2a !important;
  border-radius: 4px 4px 0 0 !important;
}

.ql-toolbar button:hover,
.ql-toolbar button.ql-active {
  color: var(--accent-color) !important;
}

/* Hide all scrollbars */
::-webkit-scrollbar {
  display: none;
}

#editor img {
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: border 0.2s;
}

#editor img:hover {
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.3);
}

.ql-container {
  font-size: 16px;
  border: none !important;
}

/* Hide Quill's default toolbar */
.ql-toolbar {
  display: none !important;
}

.zoom-level {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

#imageInput {
  display: none;
}

/* Ribbon Tabs */
.ribbon-tabs {
  background-color: #0a0a0a;
  padding: 0 16px;
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.2);
}

body.light-theme .ribbon-tabs {
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #d1d5db;
}

.ribbon-tab {
  padding: 8px 16px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 13px;
  color: #9ca3af;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  position: relative;
}

body.light-theme .ribbon-tab {
  color: var(--accent-color);
}

.ribbon-tab:hover {
  background-color: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color-light);
  box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.2) inset;
}

body.light-theme .ribbon-tab:hover {
  background-color: #f3e8ff;
  color: var(--accent-color);
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.15) inset;
}

.ribbon-tab.active {
  color: var(--accent-color-light);
  border-bottom-color: var(--accent-color);
  font-weight: 600;
  text-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.6);
  background: linear-gradient(180deg, rgba(var(--accent-color-rgb), 0.1) 0%, transparent 100%);
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.3);
}

body.light-theme .ribbon-tab.active {
  color: #6b4ec9;
  border-bottom-color: var(--accent-color);
  text-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.4);
  background: rgba(var(--accent-color-rgb), 0.1);
}

/* Ribbon Content */
.ribbon-content {
  display: none;
  background-color: #0a0a0a;
  padding: 8px 16px;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 40px;
  flex-shrink: 0;
  box-shadow:
    0 0 20px rgba(var(--accent-color-rgb), 0.15),
    inset 0 0 10px rgba(var(--accent-color-rgb), 0.05);
}

body.light-theme .ribbon-content {
  background-color: #f9fafb;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  border-bottom: 1px solid #d1d5db;
}

.ribbon-content.active {
  display: flex;
}

.ribbon-section {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2a2a2a;
  padding-right: 6px;
  margin-right: 4px;
}

body.light-theme .ribbon-section {
  border-right: 1px solid #d0d0d0;
}

.ribbon-section-title {
  font-size: 6px;
  color: #6b7280;
  margin-bottom: 1px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

body.light-theme .ribbon-section-title {
  color: #6b7280;
}

.ribbon-section-tools {
  display: flex;
  gap: 1px;
  align-items: center;
}

.ribbon-section-tools .toolbar-btn {
  padding: 2px 4px;
  font-size: 12px;
}

.ribbon-section:last-child {
  border-right: none;
}

.page-navigator {
  background-color: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
}

body.light-theme .page-navigator {
  background-color: #f8f8f8;
  border-bottom: 1px solid #d0d0d0;
}

.page-tab {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #b0b0b0;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}

body.light-theme .page-tab {
  background-color: #f3e8ff;
  border: 1px solid var(--accent-color-lighter);
  color: #6b4ec9;
}

.page-tab:hover {
  background-color: #252525;
  color: var(--accent-color-light);
}

body.light-theme .page-tab:hover {
  background-color: #ede9fe;
  color: var(--accent-color);
  border-color: #ddd6fe;
}

.page-tab.active {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.4);
}

body.light-theme .page-tab.active {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.4);
}

.page-tab.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #4a90e2;
}

.page-tab .close-page {
  margin-left: 8px;
  cursor: pointer;
  font-size: 12px;
}

.page-tab .close-page:hover {
  color: #f44336;
}

.new-page-btn {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.new-page-btn:hover {
  background-color: #357abd;
}

.status-bar {
  background-color: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  padding: 6px 24px;
  font-size: 12px;
  color: #5f6368;
  position: fixed;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1000;
}

/* Close Button Gradient - High Contrast */
.close-btn-gradient {
  background: linear-gradient(135deg, #b91c1c 0%, #450a0a 100%) !important;
  color: #ffffff !important;
  border: 1px solid #7f1d1d !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.close-btn-gradient:hover {
  background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%) !important;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3) !important;
  transform: translateY(-2px);
  border-color: #ef4444 !important;
}

.close-btn-gradient:active {
  transform: translateY(1px);
}

.doc-list-header th {
  color: #9ca3af !important; /* Lighter grey for dark mode */
}

.doc-list-container {
  background: linear-gradient(to bottom, #050505 0%, #0d0d0d 100%);
  border: 1px solid #1a1a1a;
}

body.light-theme .doc-list-container {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
}

.section-title {
  color: #e0e0e0;
}

body.light-theme .section-title {
  color: #000000 !important;
  font-weight: 800 !important;
}

body.light-theme .doc-list-header th {
  color: #000000 !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #000000 !important;
}

body.light-theme .doc-title {
  color: #000000 !important;
  text-shadow: none !important;
}

body.light-theme .doc-title:hover {
  background: #f3f4f6 !important;
}

body.light-theme .doc-title:focus {
  background: #ffffff !important;
  border: 1px solid var(--accent-color) !important;
}

.doc-item:hover {
  background: rgba(var(--accent-color-rgb), 0.1) !important;
}

/* Removed redundant delete-doc-btn:hover */

#docSearch {
  width: 100%;
  max-width: 500px;
  padding: 12px 16px;
  border: 1px solid var(--accent-color);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: #1a1a1a;
  color: #e0e0e0;
  transition: all 0.3s ease;
}

#docSearch:focus {
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.3);
  background: #252525;
}

body.light-theme #docSearch {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-color: #d1d5db !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme #docSearch:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb), 0.1) !important;
}

/* Light Theme Overrides */
body.light-theme #createNewDoc {
  background: var(--accent-color-lighter);
  border-color: var(--accent-color-light);
}

body.light-theme #createNewDoc > div {
  background: var(--accent-color-lighter);
  border-color: var(--accent-color-light);
  color: var(--accent-color);
}

body.light-theme #createNewDoc > div:last-child {
  color: var(--accent-color);
}

body.light-theme #docSearch {
  background: #f3e8ff;
  color: #1a1a1a;
  border-color: #e0b5f6 !important;
}

body.light-theme #docSearch::placeholder {
  color: var(--accent-color-light);
}

/* Animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Skeleton Loading */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.skeleton {
  background: #1a1a1a !important;
  background-image: linear-gradient(
    to right,
    #1a1a1a 0%,
    #2a2a2a 20%,
    #1a1a1a 40%,
    #1a1a1a 100%
  ) !important;
  background-repeat: no-repeat !important;
  background-size: 800px 104px !important;
  display: inline-block;
  position: relative;
  animation: shimmer 1.5s infinite linear forwards !important;
  color: transparent !important;
  border-color: #2a2a2a !important;
}

.profile-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  background: #0d0520;
  color: #e0e0e0;
  font-size: 11px;
  transition: all 0.3s ease;
}

.profile-input[readonly] {
  color: #888;
  cursor: default;
}

body.light-theme .profile-input {
  background: #ffffff !important;
  border-color: #d1d5db !important;
  color: #000000 !important;
}

body.light-theme #loginHistoryContainer,
body.light-theme .privacy-row {
  background: #ffffff !important;
  border-color: #d1d5db !important;
}

body.light-theme #loginHistoryContainer tr {
  border-bottom: 1px solid #f3f4f6;
}

body.light-theme #loginHistoryContainer td {
  color: #000000 !important;
}

body.light-theme .privacy-text-main {
  color: #000000 !important;
  font-weight: 600;
}

body.light-theme .session-item {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #000000 !important;
}

body.light-theme .history-date-text {
  color: #000000 !important;
}

body.light-theme .doc-list-header {
  background: #f3f4f6 !important;
}

.profile-section-title {
  color: var(--accent-color-lighter);
}

body.light-theme .profile-section-title {
  color: #000000 !important;
  font-weight: 700 !important;
}

.profile-label {
  color: var(--accent-color-light);
}

body.light-theme .profile-label {
  color: #000000 !important;
  font-weight: 700 !important;
}

.preference-label {
  color: #e0e0e0;
}

.preference-desc {
  color: #666;
}

body.light-theme .preference-label {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.light-theme .preference-desc {
  color: #4b5563 !important;
}

body.light-theme .preference-row {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.light-theme #newPassword {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #d1d5db !important;
}

body.light-theme .entropy-bar {
  background: #e5e7eb !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme #passwordRequirements li,
body.light-theme .requirement-item {
  color: #000000 !important;
  font-weight: 600;
}

body.light-theme .skeleton {
  background: #f0f0f0;
  background-image: linear-gradient(
    to right,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-text {
  height: 12px;
  border-radius: 4px;
  width: 100%;
}

/* Avatar Initials */
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  border-radius: 50%; /* Circle shape */
  text-transform: uppercase;
  user-select: none;
  background-color: var(--accent-color);
  overflow: hidden;
}

/* Yjs / Quill Collaboration Cursors */
.yRemoteSelection {
    background-color: rgba(250, 250, 250, 0.5); /* Fallback */
}

.yRemoteSelectionHead {
    position: absolute;
    border-left: 2px solid black;
    height: 100%;
    box-sizing: border-box;
}

.yRemoteSelectionHead::after {
    position: absolute;
    content: ' ';
    border: 3px solid black;
    border-radius: 4px;
    left: -4px;
    top: -5px;
}

.yRemoteSelectionHead::before {
    position: absolute;
    content: attr(data-name);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    font-family: sans-serif;
    background-color: black;
    border-radius: 4px;
    top: -20px;
    left: -2px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.yRemoteSelectionHead:hover::before {
    opacity: 1;
}

/* Make name tag visible when typing (optional) */
/* .yRemoteSelectionHead.yRemoteSelectionHead--active::before { opacity: 1; } */

/* Micro-States Utility Classes */
.glow-on-hover {
  transition: box-shadow var(--transition-speed);
}

.input-glow-focus:focus {
  box-shadow: 0 0 calc(5px + (15px * var(--glow-intensity, 1))) rgba(var(--accent-color-rgb), 0.4) !important;
}

.shake-animation {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.floating-label-container {
  position: relative;
  margin-top: 20px;
}

.floating-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  padding: 0 4px;
  color: #666;
  pointer-events: none;
  transition: all 0.2s ease;
  font-size: 14px;
}

.floating-label-container input:focus + .floating-label,
.floating-label-container input:not(:placeholder-shown) + .floating-label {
  top: 0;
  font-size: 11px;
  color: var(--accent-color);
  background: #0d0d0d;
}

body.light-theme .floating-label-container input:focus + .floating-label,
body.light-theme .floating-label-container input:not(:placeholder-shown) + .floating-label {
  background: #ffffff;
}

/* Entropy Bar Styling */
.entropy-bar {
  height: 6px; /* Slightly thicker for better visibility */
  width: 100%;
  background: #2a2a2a;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
  display: flex;
}

body.light-theme .entropy-bar {
  background: #e5e7eb !important;
  border: 1px solid #d1d5db !important;
}

.entropy-segment {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
}

.entropy-weak { background: var(--error-color); }
.entropy-fair { background: var(--warning-color); }
.entropy-strong { background: var(--accent-color); }
.entropy-elite { 
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 200% 100%;
  animation: rainbow-shimmer 2s linear infinite;
}

@keyframes rainbow-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.requirement-item {
  font-size: 11px;
  color: #666;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.requirement-item.met {
  color: var(--success-color);
  text-decoration: line-through;
}

.requirement-item.met i {
  color: var(--success-color);
}

/* Glass Overlay for Rate Limiting */
.glass-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  color: white;
  text-align: center;
  padding: 20px;
}

/* Canvas Themes */
.page-scaler {
  background: var(--canvas-bg) !important;
  color: var(--canvas-text) !important;
}

.editor-container {
  border-color: var(--canvas-border);
}

.canvas-classic {
  --canvas-bg: #000000;
  --canvas-text: #e0e0e0;
}

body.light-theme .canvas-classic {
  --canvas-bg: #ffffff;
  --canvas-text: #1a1a1a;
}

.canvas-sepia {
  --canvas-bg: #f4ecd8;
  --canvas-text: #5b4636;
  --canvas-border: #d3c1a5;
}

.canvas-midnight {
  --canvas-bg: #0f172a;
  --canvas-text: #f8fafc;
  --canvas-border: #334155;
}

.canvas-math {
  --canvas-bg: #ffffff;
  --canvas-text: #1a1a1a;
  --canvas-border: #ced4da;
}

.canvas-math .ql-editor {
  font-family: 'CMU Serif', serif;
}

/* Whitespace Visualization */
.show-invisibles .ql-editor p::after {
  content: '¶';
  color: rgba(var(--accent-color-rgb), 0.3);
  margin-left: 4px;
}

/* Gutter & Line Numbers */
.page-container-wrapper {
  display: flex;
  position: relative;
}

.line-numbers-gutter {
  width: 40px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid rgba(var(--accent-color-rgb), 0.1);
  padding-top: 20px;
  color: #666;
  font-size: 12px;
  text-align: right;
  padding-right: 8px;
  user-select: none;
  font-family: monospace;
}

/* Focus Mode */
body.focus-mode .header,
body.focus-mode .ribbon-tabs,
body.focus-mode .ribbon-content,
body.focus-mode .status-bar,
body.focus-mode .page-navigator,
body.focus-mode .doc-title-container {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

body.focus-mode .pages-container {
  padding-top: 100px;
}

.focus-exit-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(var(--accent-color-rgb), 0.2);
  color: white;
  border: 1px solid var(--accent-color);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 10000;
  display: none;
}

/* ==========================================
   FINAL THEME OVERRIDES (HIGH PRIORITY)
   ========================================== */

body.light-theme #profileModal .profile-input,
body.light-theme #profileModal input[type="password"] {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme .entropy-bar {
  background: #e5e7eb !important;
  border: 1px solid #d1d5db !important;
  overflow: hidden;
}

body.light-theme #passwordStrengthBar {
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

body.light-theme .collapsible-header h3 {
  color: #000000 !important;
}

body.light-theme .collapsible-header i {
  color: #000000 !important;
}

body.light-theme #loginHistoryContainer,
body.light-theme .privacy-row,
body.light-theme .session-item {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
}

body.light-theme .preference-label,
body.light-theme .profile-section-title,
body.light-theme .profile-label {
  color: #000000 !important;
  font-weight: 700 !important;
}

/* ==========================================
   LOGO STYLING
   ========================================== */
.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  user-select: none;
}

.logo-container:hover {
  background: rgba(var(--accent-color-rgb), 0.1);
}

.logo-icon-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-sync {
  font-size: 18px;
  color: var(--accent-color);
  animation: logo-spin 10s linear infinite;
}

.icon-pen {
  position: absolute;
  font-size: 10px;
  color: #ffffff;
  transform: rotate(-45deg);
  text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.logo-text {
  font-family: 'Montserrat', 'Roboto', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}

.logo-syncro {
  color: #ffffff;
  text-transform: uppercase;
}

.logo-edit {
  color: var(--accent-color-light);
  margin-left: 1px;
}

.logo-container:hover .logo-syncro {
  color: var(--accent-color-light);
  text-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.5);
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body.light-theme .logo-syncro {
  color: #1a1a1a;
}

body.light-theme .icon-pen {
  color: #1a1a1a;
}

body.light-theme .logo-container:hover {
  background: rgba(var(--accent-color-rgb), 0.05);
}




.pages-container.drag-over {

  border: 4px dashed var(--accent-color);

  opacity: 0.8;

}

/* Code Theme Workspace Override */
body.bg-code-mode .main-workspace,
body.bg-code-mode .pages-container {
  background-color: rgba(0, 0, 0, 0.3) !important;
}

/* =========================================
   MOBILE & RESPONSIVE DASHBOARD (Fluid Layout)
   ========================================= */

/* Bottom Navigation (Mobile Only) - High End */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  z-index: 9000;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.bottom-nav-item {
  color: #888;
  text-align: center;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
}

.bottom-nav-item i {
  font-size: 22px;
  transition: transform 0.3s ease;
}

.bottom-nav-item.active {
  color: var(--accent-color-light);
  text-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.5);
}

.bottom-nav-item.active i {
  transform: translateY(-2px);
}

/* Floating Action Buttons (Mobile) */
.fab-create, .fab-edit {
  display: none;
  position: fixed;
  bottom: calc(85px + env(safe-area-inset-bottom));
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-light));
  color: white;
  border-radius: 20px; /* Squircle look */
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 10px 25px rgba(var(--accent-color-rgb), 0.4),
    0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 9001;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-create:active, .fab-edit:active {
  transform: scale(0.9) rotate(-10deg);
}

/* Mobile Contextual Toolbar */
.mobile-toolbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--accent-color);
  z-index: 9500;
  transition: transform 0.3s ease;
}

.mobile-toolbar-scroll {
  display: flex;
  overflow-x: auto;
  padding: 10px;
  gap: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mobile-toolbar-scroll::-webkit-scrollbar {
  display: none;
}

.mobile-tool-btn {
  flex: 0 0 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.mobile-tool-btn:active {
  background: var(--accent-color);
  color: white;
}

.mobile-tool-separator {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 10px;
  flex: 0 0 1px;
}

/* Mobile Media Queries */
@media (max-width: 768px) {
  /* Hide Desktop Elements */
  #menuBtn, 
  #localModeBadge,
  .sidebar,
  .sidebar-right,
  .ribbon-tabs,
  .ribbon-content,
  .header-right > div:not(#userProfileTrigger),
  .status-bar,
  .zoom-level {
    display: none !important;
  }

  .header-right {
    gap: 8px !important;
  }
  
  /* Show Mobile Elements */
  .bottom-nav { display: flex; }
  .fab-create { display: flex; }
  
  /* Document Library Card Transformation */
  #documentList {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px 0;
  }

  .doc-item {
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%) !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    display: grid !important;
    grid-template-columns: 36px 1fr 32px !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    margin-bottom: 0 !important;
  }

  .doc-item::before {
    content: '\f15c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 20px;
    color: var(--accent-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .doc-item td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
  }

  .doc-item td:nth-child(1) { /* Name */
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin-bottom: 2px;
  }

  .doc-item td:nth-child(2),
  .doc-item td:nth-child(3) { /* Location & Date */
    font-size: 11px !important;
    color: #888 !important;
  }

  .doc-item td:nth-child(2) { display: none !important; } /* Hide location on mobile */

  .doc-item .delete-doc-btn {
    grid-column: 3;
    grid-row: 1 / span 2;
    font-size: 16px !important;
  }

  /* Library Layout */
  #docLibrary {
    padding-bottom: 100px;
  }

  #docLibrary h1 {
    font-size: 24px !important;
  }

  .section-title {
    font-size: 18px !important;
    margin-top: 20px;
  }

  #createNewDoc {
    display: none;
  }

  /* Header adjustments */
  .header {
    height: 60px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px);
  }
  
  .header-left {
    gap: 12px !important;
  }

  #docTitle {
    font-size: 18px;
    font-weight: 700;
  }

  /* Editor Mobile Experience */
  .main-workspace {
    top: 60px;
    height: calc(100vh - 60px);
  }

  .pages-container {
    padding: 10px 10px 120px 10px !important;
    background: #050505 !important;
  }
  
  .page-scaler {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    padding: 24px 16px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Focus mode on mobile should be even cleaner */
  body.focus-mode .header {
    transform: translateY(-100%);
  }

  body.focus-mode .bottom-nav {
    transform: translateY(100%);
  }
}
