/* css/main.css - Modern Infinity Notes Theme */
:root {
  --bg-primary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  --bg-surface: rgba(255, 255, 255, 0.65);
  --bg-sidebar: rgba(255, 255, 255, 0.75);
  --bg-sidebar-hover: rgba(0, 0, 0, 0.04);
  --bg-sidebar-active: rgba(37, 99, 235, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-border-subtle: rgba(226, 232, 240, 0.7);
  --glass-blur: blur(20px) saturate(140%);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
  --glass-shadow-active: 0 12px 36px 0 rgba(37, 99, 235, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: #334155;
  --text-sidebar-bright: #0f172a;
  --border-color: rgba(226, 232, 240, 0.8);
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --success-color: #10b981;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-primary: linear-gradient(135deg, #090d16 0%, #111827 50%, #090d16 100%);
  --bg-surface: rgba(17, 24, 39, 0.65);
  --bg-sidebar: rgba(15, 23, 42, 0.75);
  --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
  --bg-sidebar-active: rgba(255, 255, 255, 0.12);
  --glass-bg: rgba(17, 24, 39, 0.6);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-subtle: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(24px) saturate(180%);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --glass-shadow-active: 0 12px 36px 0 rgba(59, 130, 246, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  --text-sidebar-bright: #ffffff;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
}

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

html, body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* App Layout */


/* App Container */
.app-container {
  display: flex;
  width: 100vw;
  height: calc(100vh - 78px);
  overflow: hidden;
  background: var(--bg-primary);
}

/* Glassy Sidebar */
.sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  height: 100%;
  z-index: 20;
}

[data-theme="dark"] .sidebar {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: #4338ca;
}

[data-theme="dark"] .brand-name {
  color: #818cf8;
}

.btn-sidebar-collapse {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
}

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

.brand-logo {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.45));
}

.brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-sidebar-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-version {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 1px;
}

.btn-new-note {
  margin: 16px;
  padding: 11px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.95));
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-new-note:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 1));
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.45);
}

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

/* Slim Custom Scrollbars */
.sidebar-content::-webkit-scrollbar,
.notes-list::-webkit-scrollbar {
  width: 5px;
}

.sidebar-content::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.notes-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}

.sidebar-group {
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-add-category {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.btn-add-category:hover {
  color: var(--text-sidebar-bright);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-sidebar);
  transition: all 0.15s ease;
}

.sidebar-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-sidebar-bright);
}

.sidebar-item.active {
  background: var(--bg-sidebar-active);
  backdrop-filter: blur(8px);
  color: var(--text-sidebar-bright);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-item .badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-left: auto;
}

.sidebar-item:hover .category-actions {
  opacity: 1;
}

.category-color-picker {
  -webkit-appearance: none;
  border: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.category-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.category-color-picker::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

/* Sidebar Tag Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px;
}

.sidebar-tag-item {
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-tag-item:hover, .sidebar-tag-item.active {
  background: var(--accent-color);
  color: #ffffff;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .sidebar-footer {
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-footer-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-sidebar);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 4px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  user-select: none;
  min-width: 0;
  line-height: 1.1;
}

.btn-footer-action i {
  font-size: 0.95rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.btn-footer-action span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.btn-footer-action:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-sidebar-bright);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.btn-footer-action:hover i {
  transform: scale(1.12);
}

.btn-footer-action:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Individual accent colors on icons */
#btn-toggle-theme i, #header-btn-theme i {
  color: #6366f1;
}

#btn-feedback i, #header-btn-feedback i {
  color: #0ea5e9;
}

#btn-export-notes i {
  color: #10b981;
}

#btn-import-trigger i {
  color: #f59e0b;
}

/* Suite header footer-action buttons */
.suite-header-right .btn-footer-action {
  flex-direction: row;
  padding: 6px 10px;
  border-radius: 6px;
  gap: 6px;
  font-size: 0.82rem;
}

/* Default Layout: Split Column Layout for Normal View Mode */
.notes-panel {
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.25s ease;
}

/* 3-Pane Split View for Normal View Mode */
.notes-panel.view-mode-normal {
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
}

.notes-panel.view-mode-normal ~ .editor-modal-overlay {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  height: 100% !important;
  max-height: 100% !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  padding: 0 !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.notes-panel.view-mode-normal ~ .editor-modal-overlay .editor-panel {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: 1px solid var(--border-color) !important;
  transform: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.notes-panel.view-mode-normal ~ .editor-modal-overlay .btn-close-editor-modal {
  display: none !important;
}

.notes-panel.view-mode-normal ~ .editor-modal-overlay .editor-panel .editor-body {
  height: auto !important;
  min-height: 0 !important;
  flex: 1 1 0% !important;
  position: relative;
  z-index: 1;
}

/* Maximized State in Normal View Mode */
.notes-panel.view-mode-normal ~ .editor-modal-overlay.maximized {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.notes-panel.view-mode-normal ~ .editor-modal-overlay.maximized .editor-panel {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-left: none !important;
}

.notes-panel.view-mode-normal ~ .editor-modal-overlay.maximized .btn-close-editor-modal {
  display: flex !important;
}

/* Full Window Mode for Grid & List Views */
.notes-panel.view-mode-grid,
.notes-panel.view-mode-list {
  width: 100%;
  min-width: 0;
  flex: 1;
}

/* Editor Modal Overlay & Pop-up (Active in Grid and List modes) */
.editor-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-modal-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.editor-panel {
  width: 100%;
  max-width: 1000px;
  height: 90vh;
  max-height: 850px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-modal-overlay.active .editor-panel {
  transform: scale(1);
}

.btn-close-editor-modal {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-close-editor-modal:hover {
  background: var(--danger-color);
  color: #ffffff;
  border-color: var(--danger-color);
  transform: scale(1.05);
}

.btn-maximize-editor-modal {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-maximize-editor-modal:hover {
  background: var(--primary-color, #3b82f6);
  color: #ffffff;
  border-color: var(--primary-color, #3b82f6);
  transform: scale(1.05);
}

.editor-modal-overlay.maximized {
  padding: 0 !important;
}

.editor-modal-overlay.maximized .editor-panel {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* View Mode Switcher Selector */
.view-mode-selector {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-view-mode:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-view-mode.active {
  background-color: var(--accent-color);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.notes-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-box {
  position: relative;
  margin-top: 8px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.notes-list.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-content: start;
}

.notes-list.view-grid .note-item {
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.notes-list.view-grid .note-snippet {
  flex: 1;
  -webkit-line-clamp: 4;
}

.note-date-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: #4f46e5;
}

[data-theme="dark"] .note-date-sub {
  color: #818cf8;
}

.duration-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: #a5f3fc;
  color: #0891b2;
  padding: 2px 8px;
  border-radius: 6px;
}

[data-theme="dark"] .duration-badge {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}
.note-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
}

[data-theme="dark"] .note-item {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.note-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-active);
  border-color: rgba(37, 99, 235, 0.3);
}

.note-item.dragging {
  opacity: 0.45;
  transform: scale(0.98);
  border: 2px dashed var(--accent-color) !important;
}

.note-item.drag-above {
  border-top: 3px solid var(--accent-color) !important;
}

.note-item.drag-below {
  border-bottom: 3px solid var(--accent-color) !important;
}

.drag-handle {
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: grab;
  padding: 0 2px;
  opacity: 0.4;
  transition: opacity 0.15s, color 0.15s;
}

.note-item:hover .drag-handle {
  opacity: 1;
  color: var(--accent-color);
}

.note-item.is-pinned {
  border-left: 4px solid #f59e0b !important;
}

.note-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  padding: 2px;
}

.badge-pinned {
  color: #f59e0b;
}

.badge-fav {
  color: #eab308;
}

.note-item.active {
  border-color: #818cf8;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .note-item.active {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: #818cf8;
}

.note-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.note-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.note-actions-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.note-item:hover .note-actions-inline {
  opacity: 1;
}

.btn-icon-sm {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.btn-icon-sm:hover {
  color: var(--accent-color);
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-icon-sm.active {
  color: var(--warning-color);
}

.note-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  line-height: 1.4;
}

.note-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tag-badge {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-color);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: 4px;
}

/* Note Editor Container */

.editor-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.editor-title-input {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.editor-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.select-category {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--glass-bg);
  color: var(--text-primary);
  outline: none;
  font-size: 0.85rem;
}

.tags-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.tags-input-container input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  color: var(--text-primary);
  min-width: 140px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.tb-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.tb-btn:hover {
  background: var(--accent-light);
  color: var(--accent-color);
}

/* Glassy Emoji Picker Popup */
.emoji-picker-wrapper {
  position: relative;
}

.emoji-picker-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-height: 380px;
  background: #ffffff;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.45), 0 8px 16px -4px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
  animation: emojiPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .emoji-picker-dropdown {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .emoji-search-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .emoji-tab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .emoji-item:hover {
  background: rgba(37, 99, 235, 0.25) !important;
}

@keyframes emojiPopIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.emoji-search-input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.emoji-search-input:focus {
  border-color: var(--accent-color);
}

.emoji-picker-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-picker-close:hover {
  color: var(--danger-color);
}

.emoji-categories-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
}

.emoji-tab {
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-size: 1.05rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.emoji-tab:hover {
  background: rgba(255, 255, 255, 0.15);
}

.emoji-tab.active {
  background: var(--accent-light);
  border-bottom: 2px solid var(--accent-color);
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
  padding: 2px;
}

.emoji-item {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease;
}

.emoji-item:hover {
  background: var(--accent-light);
  transform: scale(1.25);
}

/* Glassy Context Menu */
.context-menu {
  position: fixed;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  padding: 6px;
  min-width: 170px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.context-menu-item:hover {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

/* Glassy Modal Overlay & Content */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow-active);
  width: 90%;
  max-width: 440px;
  overflow: hidden;
}

.html-tag-btn {
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 0.8rem !important;
  color: #569cd6 !important;
}

.html-tag-btn:hover {
  background-color: #04395e !important;
  color: #ffffff !important;
}

.cpp-snippet-btn {
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 0.8rem !important;
  color: #ce9178 !important;
}

.cpp-snippet-btn:hover {
  background-color: rgba(206, 145, 120, 0.15) !important;
  color: #ffffff !important;
}

.editor-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* CodeMirror Editor Base Styles */
.CodeMirror {
  flex: 1;
  width: 100%;
  height: 100% !important;
}

/* 1. General Notes Editor Mode (Clean Modern Sans-Serif Editor, No Line Numbers) */
.cm-general-mode.CodeMirror {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  background-color: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  padding: 16px 20px !important;
}

.cm-general-mode .CodeMirror-gutters {
  display: none !important;
}

.cm-general-mode .CodeMirror-cursor {
  border-left: 2px solid var(--accent-color) !important;
}

.cm-general-mode .CodeMirror-lines {
  padding: 0 !important;
}

/* 2. Code Notes Editor Mode (VS Code Dark+ Style with Line Numbers & Monospace) */
.cm-code-mode.CodeMirror {
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
}

.cm-code-mode .CodeMirror-gutters {
  display: flex !important;
  background-color: #1e1e1e !important;
  border-right: 1px solid #2d2d2d !important;
}

.cm-code-mode .CodeMirror-linenumber {
  color: #858585 !important;
  padding: 0 10px 0 5px !important;
  font-size: 12px !important;
}

/* VS Code Dark+ Token Colors */
.cm-s-material-darker .cm-tag,
.cm-s-material-darker .cm-tag.cm-bracket {
  color: #808080 !important; /* Brackets <> in grey */
}

.cm-s-material-darker .cm-tag {
  color: #569cd6 !important; /* HTML Tag names in VS Code Blue e.g. html, head, title, body, h1, p */
}

.cm-s-material-darker .cm-attribute {
  color: #9cdcfe !important; /* HTML Attributes in VS Code Light Blue e.g. lang, class, id */
}

.cm-s-material-darker .cm-string {
  color: #ce9178 !important; /* Strings in VS Code Orange/Peach e.g. "en", "UTF-8" */
}

.cm-s-material-darker .cm-comment {
  color: #6a9955 !important; /* Comments in VS Code Green e.g. <!-- comment --> */
}

.cm-s-material-darker .cm-keyword {
  color: #c586c0 !important; /* JS Keywords in VS Code Purple e.g. import, const, return */
}

.cm-s-material-darker .cm-atom,
.cm-s-material-darker .cm-number {
  color: #b5cea8 !important; /* Numbers/Booleans in Light Green */
}

.cm-s-material-darker .cm-variable,
.cm-s-material-darker .cm-def {
  color: #9cdcfe !important; /* Variables in VS Code Light Blue */
}

/* VS Code Style Autocomplete Suggestions Dropdown */
.CodeMirror-hints {
  background-color: #252526 !important;
  border: 1px solid #454545 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  border-radius: 4px !important;
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 13px !important;
  padding: 4px 0 !important;
  max-height: 200px !important;
  z-index: 100 !important;
}

.CodeMirror-hint {
  color: #cccccc !important;
  padding: 4px 12px !important;
  border-radius: 2px !important;
  margin: 0 4px !important;
}

li.CodeMirror-hint-active {
  background-color: #04395e !important;
  color: #ffffff !important;
}

.editor-textarea {
  flex: 1;
  height: 100%;
  padding: 24px;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-family);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 30px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Responsive mobile toggle button */
.mobile-sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-sidebar-toggle {
    display: block;
  }
}

/* Context Menu */
.context-menu {
  position: fixed;
  z-index: 1000;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  padding: 6px;
  min-width: 170px;
}

[data-theme="dark"] .context-menu {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.context-menu-item:hover {
  background-color: var(--accent-light);
  color: var(--accent-color);
}

.context-menu-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.context-menu-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* Live HTML Render Preview Container */
.html-preview-container {
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  background-color: #ffffff;
}

.html-preview-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  background: #f8fafc;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.html-preview-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* Compiled C/C++ Terminal Preview Container */
.cpp-terminal-body {
  flex: 1;
  background-color: #0f172a;
  color: #38bdf8;
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.88rem;
  padding: 16px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.cpp-terminal-output {
  color: #f8fafc;
  margin-top: 8px;
}

.cpp-terminal-error {
  color: #f87171;
  margin-top: 8px;
}

/* Media & Video Embeds */
.media-preview-container {
  width: 480px;
  max-width: 50%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

.media-preview-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.youtube-embed-box {
  margin-bottom: 20px;
  background: var(--bg-surface);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.youtube-embed-box a {
  display: inline-block;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 10px;
  word-break: break-all;
  text-decoration: none;
}

.youtube-embed-box a:hover {
  text-decoration: underline;
}

.responsive-video {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000000;
}

.responsive-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-embed-box {
  margin-bottom: 20px;
  background: var(--bg-surface);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.map-embed-box a {
  display: inline-block;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 10px;
  word-break: break-all;
  text-decoration: none;
}

.map-embed-box a:hover {
  text-decoration: underline;
}

.responsive-map {
  position: relative;
  padding-bottom: 65%; /* Map Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}

.responsive-map iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Sidebar Backdrop Overlay */
.sidebar-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(3px) !important;
  z-index: 9998 !important;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.open {
  display: block !important;
  opacity: 1 !important;
}

/* Mobile Back Button in Editor Header */
.btn-back-notes {
  display: none;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-back-notes:hover {
  background: var(--accent-light);
  color: var(--accent-color);
}

.editor-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Media Queries for Tablets & Laptops (max-width: 992px) */
@media (max-width: 992px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transform: translateX(-100%);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    display: flex !important;
  }

  .mobile-sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .notes-panel {
    width: 100vw;
    min-width: 100vw;
  }

  .notes-panel.view-mode-grid,
  .notes-panel.view-mode-list,
  .notes-panel.view-mode-normal {
    width: 100vw;
    min-width: 100vw;
  }

  .notes-panel.view-mode-normal ~ .editor-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9000 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .notes-panel.view-mode-normal ~ .editor-modal-overlay.active {
    display: flex !important;
  }

  .notes-panel.view-mode-normal ~ .editor-modal-overlay .btn-close-editor-modal {
    display: flex !important;
  }
}

/* Media Queries for Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .app-container {
    position: relative;
    width: 100vw;
    height: 100%;
    height: 100dvh;
    min-height: -webkit-fill-available;
    overflow: hidden;
  }

  .btn-back-notes {
    display: inline-flex;
  }

  .editor-modal-overlay {
    padding: 0;
  }

  .editor-panel {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .empty-state-container {
    display: none;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background: var(--bg-surface);
  }



  /* Editor Header formatting for Mobile */
  .editor-header {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .editor-title-input {
    font-size: 1.15rem;
    flex: 1;
    min-width: 120px;
  }

  .editor-header-actions {
    gap: 4px;
    margin-left: auto;
  }

  .editor-header-actions .btn-icon-sm {
    padding: 4px 6px;
    font-size: 0.8rem;
  }

  /* Editor Meta Bar formatting */
  .editor-meta-bar {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.8rem;
  }

  .select-category {
    padding: 4px 8px;
    font-size: 0.8rem;
  }

  .tags-input-container {
    width: 100%;
    margin-top: 4px;
  }

  /* Dock Toolbar to the bottom of the editor on Mobile */
  .editor-toolbar {
    order: 99;
    padding: 8px 12px;
    padding-bottom: calc(max(10px, env(safe-area-inset-bottom)) + 6px);
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    background: var(--bg-surface);
    position: relative;
    z-index: 10;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  }

  .editor-body {
    order: 1;
    flex: 1 1 0%;
    min-height: 0;
  }

  .emoji-picker-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
  }

  .toolbar-group {
    flex-shrink: 0;
  }

  .tb-btn {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  /* Editor Body: Stack Code Mirror and Live HTML / Terminal vertically on Mobile */
  .editor-body {
    flex-direction: column;
    height: calc(100vh - 170px);
  }

  .CodeMirror, .editor-textarea {
    width: 100% !important;
    height: 50% !important;
    flex: none;
  }

  .html-preview-container,
  .media-preview-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 50% !important;
    border-left: none;
    border-top: 2px solid var(--border-color);
  }

  .cpp-terminal-body {
    width: 100% !important;
    max-width: 100% !important;
    height: 50% !important;
    border-top: 2px solid var(--border-color);
  }

  /* Notes list header adjustments */
  .notes-header {
    padding: 12px 14px;
  }

  .view-mode-selector {
    display: none;
  }

  .notes-list.view-grid {
    grid-template-columns: 1fr;
  }

  .note-title {
    max-width: 220px;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .editor-header {
    padding: 8px 10px;
  }

  .editor-title-input {
    font-size: 1rem;
  }

  .btn-back-notes {
    padding: 4px 8px;
    font-size: 0.78rem;
  }
}

/* Voice Notes Styling & Recording Indicator */
.btn-voice-note {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.btn-voice-note:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.voice-recording-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
}

.rec-pulse {
  animation: pulse-red 1.2s infinite ease-in-out;
}

@keyframes pulse-red {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.btn-stop-rec {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.15s;
}

.btn-stop-rec:hover {
  background: #dc2626;
}

/* Embedded Voice Note Player Widget */
.voice-note-card {
  margin: 16px 0;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: block;
  width: 100%;
  max-width: 480px;
}

[data-theme="dark"] .voice-note-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-left: 4px solid #38bdf8;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.voice-note-card-header {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .voice-note-card-header {
  color: #38bdf8;
}

.voice-note-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-color);
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .voice-note-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.voice-note-audio {
  width: 100%;
  height: 42px;
  outline: none;
  border-radius: 8px;
}

/* CodeMirror Inline Voice Note Chip Widget */
.cm-voice-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 2px 4px;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  user-select: none;
}

[data-theme="light"] .cm-voice-chip {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.cm-voice-chip .chip-icon {
  font-size: 0.9rem;
}

.cm-voice-chip .chip-label {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.cm-voice-chip .chip-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s ease;
}

.cm-voice-chip .chip-delete-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

/* --- LIVE AUDIO NEURAL ENGINE HERO CARD --- */
.voice-hero-card {
  background: linear-gradient(135deg, #e0f2fe 0%, #e0e7ff 50%, #f0f9ff 100%);
  border: 1px solid rgba(186, 230, 253, 0.8);
  border-radius: 20px;
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.12);
}

[data-theme="dark"] .voice-hero-card {
  background: linear-gradient(135deg, #0c4a6e 0%, #1e1b4b 50%, #0369a1 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

.neural-engine-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #4338ca;
  margin-bottom: 8px;
  text-transform: uppercase;
}

[data-theme="dark"] .neural-engine-badge {
  color: #a5b4fc;
}

.neural-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e1b4b;
  margin-bottom: 10px;
}

[data-theme="dark"] .neural-hero-title {
  color: #ffffff;
}

.neural-hero-sub {
  font-size: 0.92rem;
  color: #475569;
  max-width: 540px;
  margin: 0 auto 24px auto;
  line-height: 1.5;
}

[data-theme="dark"] .neural-hero-sub {
  color: #94a3b8;
}

.neural-mic-button-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.neural-mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #4338ca;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(67, 56, 202, 0.35);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.neural-mic-btn:hover {
  transform: scale(1.06);
  background: #3730a3;
}

.neural-mic-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #475569;
  font-weight: 500;
}

/* --- VOICE PLAYER & TRANSCRIPTION CARD --- */
.voice-player-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .voice-player-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

.voice-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.voice-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-memo-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-transcribed-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 3px 10px;
  border-radius: 20px;
}

.voice-header-actions {
  display: flex;
  gap: 8px;
}

.btn-voice-action {
  background: #f1f5f9;
  border: none;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.btn-voice-action.btn-summarize {
  background: #e0e7ff;
  color: #3730a3;
}

.voice-meta-info {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 20px;
}

/* Waveform Box */
.waveform-player-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

[data-theme="dark"] .waveform-player-box {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.05);
}

.btn-play-pause {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #4338ca;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.waveform-bars {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  height: 36px;
}

.waveform-bars .bar {
  flex: 1;
  background: #818cf8;
  border-radius: 3px;
  min-height: 4px;
  transition: height 0.2s ease;
}

.waveform-bars .bar.animating {
  animation: bar-wave 0.8s infinite ease-in-out alternate;
}

@keyframes bar-wave {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.4); }
}

.waveform-timer {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

.waveform-footer-controls {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 24px;
  padding: 0 4px;
}

/* Smart AI Transcription Section */
.transcript-section {
  border-top: 1px dashed #e2e8f0;
  padding-top: 20px;
}

[data-theme="dark"] .transcript-section {
  border-color: rgba(255, 255, 255, 0.1);
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.transcript-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #4338ca;
}

[data-theme="dark"] .transcript-title {
  color: #818cf8;
}

.btn-copy-transcript {
  background: transparent;
  border: none;
  color: #4338ca;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.transcript-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transcript-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.t-timestamp {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: #818cf8;
  width: 50px;
  flex-shrink: 0;
}

.t-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-delete-audio-card {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete-audio-card:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Floating Action Button (FAB) in Right Bottom Corner */
.fab-new-note {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-color, #3b82f6);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45), 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 8000;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.fab-new-note:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 22px rgba(59, 130, 246, 0.55), 0 10px 30px rgba(0, 0, 0, 0.45);
}

.fab-new-note:active {
  transform: scale(0.94);
}

@media (max-width: 768px) {
  .fab-new-note {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    font-size: 1.8rem;
  }
}

/* Infinity Office Suite Top Header Styles */
.suite-top-header {
  position: relative;
  z-index: 1000;
  height: 48px;
  min-height: 48px;
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

[data-theme="dark"] .suite-top-header {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
}

.suite-header-left, .suite-header-center, .suite-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-switcher-wrapper {
  position: relative;
  z-index: 1001;
}

.app-switcher-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
  z-index: 2;
}

.app-switcher-btn i {
  pointer-events: none;
}

.app-switcher-btn:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.app-switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 240px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  padding: 8px;
  z-index: 10000;
}

[data-theme="dark"] .app-switcher-dropdown {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
}

.app-switcher-wrapper.open .app-switcher-dropdown {
  display: block !important;
}

.app-switcher-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 4px 8px 8px;
}

.app-suite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color 0.15s ease;
}

.app-suite-item:hover {
  background-color: var(--bg-sidebar-hover);
}

.app-suite-item.active {
  background-color: rgba(139, 92, 246, 0.15);
}

.app-suite-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #ffffff;
  flex-shrink: 0;
}

.app-suite-icon.home-icon {
  background: linear-gradient(135deg, #385aeb, #8c5ae1, #dc4e41);
}

.app-suite-icon.doc-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.app-suite-icon.sheet-icon {
  background: linear-gradient(135deg, #107c41, #059669);
}

.app-suite-icon.slide-icon {
  background: linear-gradient(135deg, #c2410c, #ea580c);
}

.app-suite-icon.notes-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.app-suite-icon.base-icon {
  background: linear-gradient(135deg, #b43635, #8a1f20);
}
.app-suite-icon.pdf-icon {
  background: linear-gradient(135deg, #e11d48, #be123c);
}



.app-suite-info {
  display: flex;
  flex-direction: column;
}

.app-suite-name {
  font-size: 0.86rem;
  font-weight: 600;
}

.app-suite-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.suite-pills {
  display: inline-flex;
  background-color: rgba(0, 0, 0, 0.04);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .suite-pills {
  background-color: rgba(255, 255, 255, 0.04);
}

.suite-pill {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.suite-pill:hover {
  color: var(--text-primary);
}

.suite-pill.active {
  background-color: var(--bg-surface);
  color: var(--accent-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.suite-pill.notes-pill.active {
  color: #d97706;
}

.notes-suite-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #d97706;
  text-decoration: none;
}

.notes-suite-logo i {
  font-size: 1.25rem;
}

/* ==========================================================================
   Menu Bar & Dropdown Navigation for Infinity Notes
   ========================================================================== */
.menu-bar {
  height: 30px;
  background-color: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 2px;
  font-size: 0.82rem;
  position: relative;
  z-index: 90;
  flex-shrink: 0;
  user-select: none;
}

[data-theme="dark"] .menu-bar {
  background-color: #111827;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.menu-item {
  position: relative;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.menu-item:hover, .menu-item.active {
  background-color: var(--bg-sidebar-hover);
}

[data-theme="dark"] .menu-item:hover, [data-theme="dark"] .menu-item.active {
  background-color: rgba(255, 255, 255, 0.08);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  min-width: 240px;
  padding: 6px 0;
  z-index: 1000;
}

[data-theme="dark"] .dropdown-menu {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.menu-item.active > .dropdown-menu {
  display: block !important;
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  gap: 10px;
  transition: background-color 0.12s ease;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
}

.dropdown-item:hover {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.dropdown-item:hover i {
  color: #d97706;
}

[data-theme="dark"] .dropdown-item:hover i {
  color: #fbbf24;
}

.dropdown-item .shortcut {
  margin-left: auto;
  padding-left: 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropdown-item .submenu-arrow {
  margin-left: auto;
  padding-left: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 5px 0;
}

/* Submenu & Flyout */
.dropdown-submenu-item {
  position: relative;
}

.dropdown-submenu-item:hover > .submenu-flyout {
  display: block !important;
}

.submenu-flyout {
  display: none;
  top: -6px;
  left: 100%;
  min-width: 230px;
}

/* Keyboard Shortcut Platform Overrides */
html[data-platform="mac"] .shortcut[data-mac] {
  font-size: 0 !important;
}
html[data-platform="mac"] .shortcut[data-mac]::before {
  content: attr(data-mac);
  font-size: 0.72rem !important;
  color: var(--text-muted);
}
html[data-platform="windows"] .shortcut[data-win] {
  font-size: 0 !important;
}
html[data-platform="windows"] .shortcut[data-win]::before {
  content: attr(data-win);
  font-size: 0.72rem !important;
  color: var(--text-muted);
}

/* Mobile Menubar Horizontal Scrolling & Header Responsive Layout */
@media (max-width: 768px) {
  .menu-bar {
    display: none !important;
  }

  .suite-top-header {
    padding: 0 8px !important;
    gap: 4px !important;
  }

  .suite-header-left {
    gap: 6px !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }

  .notes-suite-logo {
    font-size: 0.95rem !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }

  .suite-header-right {
    gap: 6px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  /* Compact button styling on mobile */
  .btn-pwa-install {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
    margin-right: 0 !important;
  }

  /* Hide verbose text inside buttons on small screens */
  .btn-pwa-install span {
    display: none !important;
  }

  .btn-lang-toggle {
    padding: 4px 6px !important;
    font-size: 0.75rem !important;
  }

  .btn-lang-toggle span {
    display: none !important;
  }

  .suite-header-right .btn-footer-action {
    padding: 5px 6px !important;
  }

  #header-btn-feedback {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .notes-suite-logo span {
    display: none !important;
  }
}

/* ==========================================================================
   PWA Installation Button
   ========================================================================== */
.btn-pwa-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid #f59e0b;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin-right: 6px;
}

.btn-pwa-install:hover {
  background-color: #f59e0b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.btn-pwa-install:active {
  transform: translateY(0);
}

[data-theme="dark"] .btn-pwa-install {
  background-color: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: #d97706;
}

[data-theme="dark"] .btn-pwa-install:hover {
  background-color: #d97706;
  color: #ffffff;
}

[data-pwa-installed="true"] .btn-pwa-install {
  display: none !important;
}

/* ==========================================================================
   Keyboard Shortcuts & Info Modal Grids
   ========================================================================== */
.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-section-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #d97706;
  padding: 4px 6px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 4px;
}

[data-theme="dark"] .shortcut-section-title {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.83rem;
  color: var(--text-primary);
}

.shortcut-row:last-child {
  border-bottom: none;
}

.kbd-pill {
  background-color: var(--bg-sidebar-hover);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}



.mobile-only-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only-btn {
    display: inline-flex !important;
  }
}


/* Voice Typing Floating Pill Widget */
@keyframes modalPop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulseRecording {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.voice-typing-pill {
  position: fixed !important;
  bottom: 30px !important;
  right: 90px !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  max-width: calc(100vw - 32px) !important;
  height: auto !important;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 28px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10050 !important;
  animation: modalPop 0.18s ease-out;
  color: var(--text-main, var(--text-primary, #1e293b));
  font-family: inherit;
  box-sizing: border-box;
}

.voice-typing-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #64748b;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.voice-typing-btn.recording {
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseRecording 1.5s infinite;
}

.voice-typing-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
}

.voice-typing-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voice-typing-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
}

.voice-typing-lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.voice-typing-lang-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-primary, #1e293b);
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 22px 3px 8px;
  cursor: pointer;
  outline: none;
  max-width: 160px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: all 0.15s ease;
}

.voice-typing-lang-select:hover {
  border-color: #2563eb;
}

.voice-typing-lang-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.voice-typing-desc {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-typing-close {
  background: none;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
  margin-left: 2px;
}

.voice-typing-close:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

/* Dark theme overrides for Voice Typing Pill */
[data-theme="dark"] .voice-typing-pill {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .voice-typing-title {
  color: #f8fafc;
}

[data-theme="dark"] .voice-typing-desc {
  color: #94a3b8;
}

[data-theme="dark"] .voice-typing-lang-select {
  background-color: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .voice-typing-lang-select:hover {
  border-color: #60a5fa;
}

[data-theme="dark"] .voice-typing-lang-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

@media (max-width: 600px) {
  .voice-typing-pill {
    bottom: 84px !important;
    right: 16px !important;
    left: 16px !important;
    width: auto !important;
    justify-content: space-between;
  }
  .voice-typing-info {
    min-width: 0;
    flex: 1;
  }
}

/* Note Sharing & Collaboration Styles */
.btn-share-note {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #3b82f6 !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-share-note:hover {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  transform: translateY(-1px);
}

.btn-copy-share-link:hover {
  background: var(--bg-hover, #f1f5f9) !important;
  border-color: #3b82f6 !important;
}
