/* ==========================================================================
   ATT-25 AI DOSKA — MODERN DESIGN SYSTEM & STYLESHEET
   Themes: Chalkboard (Maktab Doskasi), Cyber Dark (Matrix), Modern Light
   ========================================================================== */

:root {
  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Oswald', sans-serif;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   THEME PALETTES
   ========================================================================== */

/* 1. CHALKBOARD THEME (Klassik Maktab Doskasi) */
html[data-theme="chalkboard"] {
  --bg-board: #0a1b14;
  --bg-board-pattern: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  --bg-board-grid: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
                   linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  --surface-panel: rgba(13, 33, 25, 0.85);
  --surface-panel-border: rgba(52, 211, 153, 0.2);
  --surface-card: rgba(18, 44, 34, 0.9);
  --surface-hover: rgba(52, 211, 153, 0.15);
  --surface-active: rgba(52, 211, 153, 0.25);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #6EE7B7;

  --accent-primary: #10B981;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --accent-secondary: #38BDF8;

  --border-subtle: rgba(255, 255, 255, 0.1);
  --chalk-effect: drop-shadow(0 0 1px rgba(255, 255, 255, 0.4));
  --badge-bg: rgba(16, 185, 129, 0.2);
  --badge-text: #6EE7B7;
}

/* 2. CYBER DARK THEME (Matrix / ATT-25) */
html[data-theme="dark"] {
  --bg-board: #070C14;
  --bg-board-pattern: radial-gradient(circle, rgba(56, 189, 248, 0.12) 1px, transparent 1px);
  --bg-board-grid: linear-gradient(to right, rgba(56, 189, 248, 0.05) 1px, transparent 1px),
                   linear-gradient(to bottom, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  --surface-panel: rgba(15, 23, 42, 0.88);
  --surface-panel-border: rgba(56, 189, 248, 0.25);
  --surface-card: rgba(30, 41, 59, 0.9);
  --surface-hover: rgba(56, 189, 248, 0.15);
  --surface-active: rgba(56, 189, 248, 0.3);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-primary: #38BDF8;
  --accent-glow: rgba(56, 189, 248, 0.4);
  --accent-secondary: #00FF87;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --chalk-effect: none;
  --badge-bg: rgba(56, 189, 248, 0.2);
  --badge-text: #38BDF8;
}

/* 3. MODERN LIGHT THEME (Whiteboard) */
html[data-theme="light"] {
  --bg-board: #F8FAFC;
  --bg-board-pattern: radial-gradient(circle, rgba(100, 116, 139, 0.18) 1px, transparent 1px);
  --bg-board-grid: linear-gradient(to right, rgba(100, 116, 139, 0.08) 1px, transparent 1px),
                   linear-gradient(to bottom, rgba(100, 116, 139, 0.08) 1px, transparent 1px);
  --surface-panel: rgba(255, 255, 255, 0.9);
  --surface-panel-border: rgba(203, 213, 225, 0.9);
  --surface-card: #FFFFFF;
  --surface-hover: rgba(241, 245, 249, 1);
  --surface-active: rgba(226, 232, 240, 1);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --accent-primary: #0284C7;
  --accent-glow: rgba(2, 132, 199, 0.25);
  --accent-secondary: #059669;

  --border-subtle: #E2E8F0;
  --chalk-effect: none;
  --badge-bg: rgba(2, 132, 199, 0.1);
  --badge-text: #0284C7;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body.board-body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-board);
  color: var(--text-primary);
  font-family: var(--font-sans);
  user-select: none;
  touch-action: none;
  position: relative;
}

/* ==========================================================================
   1. MINIMAL TOP HEADER & YAGONA ASOSIY MENYU TUGMASI
   ========================================================================== */
.minimal-header {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none; /* Let canvas clicks through the empty center area */
  z-index: 100;
}

.header-left, .header-right-quick {
  pointer-events: auto; /* Buttons are clickable */
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 14px;
  padding: 4px 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  height: 46px;
  transition: var(--transition-normal);
}

/* Yagona Asosiy Menyu Tugmasi */
.btn-main-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-main-menu:hover {
  background: var(--surface-active);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 0 14px var(--accent-glow);
}

.btn-main-menu:active {
  transform: translateY(0);
}

.icon-hamburger {
  display: block;
}

.menu-btn-label {
  font-size: 13px;
  font-weight: 700;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
  border-left: 1px solid var(--border-subtle);
}

.header-app-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-primary);
}

.board-title-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  max-width: 170px;
  transition: var(--transition-fast);
}

.board-title-input:hover, .board-title-input:focus {
  background: var(--surface-hover);
  border-color: var(--border-subtle);
}

/* Header Right Quick: Undo/Redo & Zoom */
.quick-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-icon-btn:hover:not(:disabled) {
  background: var(--surface-active);
  color: var(--text-primary);
}

.quick-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quick-zoom-label {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 6px;
  cursor: pointer;
  min-width: 44px;
  text-align: center;
}

.quick-zoom-label:hover {
  color: var(--accent-primary);
}

.quick-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
}

/* ==========================================================================
   YAGONA ASOSIY MENYU DRAWER & OVERLAY
   ========================================================================== */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 290;
  transition: opacity 0.25s ease;
}

.menu-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.main-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 350px;
  max-width: 90vw;
  background: var(--surface-panel);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid var(--surface-panel-border);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-menu-drawer.hidden {
  transform: translateX(-100%);
  pointer-events: none;
  visibility: hidden;
}

.drawer-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.1);
}

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

.drawer-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-primary);
  color: #070C14;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-glow);
}

.drawer-brand h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.drawer-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.drawer-close-btn:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.drawer-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* Action Items */
.menu-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  width: 100%;
}

.menu-action-item:hover {
  background: var(--surface-active);
  border-color: var(--accent-primary);
  transform: translateX(3px);
}

.menu-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item-text strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-item-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.menu-action-item.portal-item {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(16, 185, 129, 0.05));
  border-color: rgba(56, 189, 248, 0.25);
}

.menu-action-item.portal-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px var(--accent-glow);
}

.menu-action-item.ai-highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(56, 189, 248, 0.15));
  border-color: rgba(56, 189, 248, 0.35);
}

.menu-action-item.ai-highlight:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px var(--accent-glow);
}

.menu-badge-neon {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: #070C14;
  background: var(--accent-primary);
  padding: 3px 6px;
  border-radius: 4px;
}

.menu-action-item.danger-item:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: #F43F5E;
  color: #F43F5E;
}

.menu-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.menu-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 12px;
  font-weight: 600;
}

.menu-card-btn:hover {
  background: var(--surface-active);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  color: var(--accent-primary);
}

/* Theme & Grid Selector in Drawer */
.theme-switch-group, .grid-switch-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-choice-btn, .grid-choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.theme-choice-btn:hover, .grid-choice-btn:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.theme-choice-btn.active, .grid-choice-btn.active {
  background: var(--surface-active);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.theme-color-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

/* Shortcuts cheat-sheet */
.shortcuts-cheat-sheet {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}

.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.sc-row kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* More tools popover in bottom toolbar */
.more-tools-popover {
  min-width: 220px;
}

.popover-header-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.sub-popover-item {
  position: relative;
}

.sub-popover-item #netNodeMenu {
  position: absolute;
  left: calc(100% + 6px);
  bottom: 0;
  display: none;
  min-width: 160px;
}

.sub-popover-item:hover #netNodeMenu,
.sub-popover-item.open #netNodeMenu {
  display: flex;
}

.ai-sparkle-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(56, 189, 248, 0.35));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.ai-badge-live {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--accent-primary);
  color: #070C14;
  padding: 2px 5px;
  border-radius: 4px;
}

/* ==========================================================================
   2. CANVAS WORKSPACE (VIEWPORT)
   ========================================================================== */
.canvas-viewport {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: crosshair;
}

.canvas-viewport.mode-select {
  cursor: default;
}

.canvas-viewport.mode-pan {
  cursor: grab;
}

.canvas-viewport.mode-panning {
  cursor: grabbing;
}

.canvas-viewport.mode-laser {
  cursor: none;
}

#whiteboardCanvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* Inline text editor overlay */
.text-editor-overlay {
  position: absolute;
  z-index: 50;
}

.text-editor-overlay.hidden {
  display: none;
}

#inlineTextInput {
  background: transparent;
  border: 1.5px dashed var(--accent-primary);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  resize: both;
  min-width: 140px;
  min-height: 40px;
  padding: 6px 10px;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Laser Pointer Effect */
.laser-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #F43F5E;
  box-shadow: 0 0 16px 4px #F43F5E, 0 0 32px 8px rgba(244, 63, 94, 0.6);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 90;
  transition: transform 0.05s ease-out;
}

.laser-dot.hidden {
  display: none;
}

/* ==========================================================================
   3. FLOATING MAIN TOOLBAR
   ========================================================================== */
.floating-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 16px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 100;
  transition: var(--transition-normal);
}

.tool-btn {
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tool-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.tool-btn.active {
  background: var(--surface-active);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.tool-btn.active-feature {
  color: var(--accent-primary);
  border-color: rgba(0, 255, 135, 0.4);
  background: rgba(0, 255, 135, 0.1);
}

.feature-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.tool-btn:not(.active-feature) .feature-dot {
  background: var(--text-muted);
  box-shadow: none;
}

.tool-shortcut {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  opacity: 0.6;
  margin-top: 1px;
}

/* Popover menus for shapes & network nodes */
.tool-popover-anchor {
  position: relative;
}

.popover-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
  z-index: 110;
}

.tool-popover-anchor.open .popover-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.popover-item {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.popover-item:hover, .popover-item.active {
  background: var(--surface-active);
  color: var(--text-primary);
}

.popover-item.active {
  color: var(--accent-primary);
}

/* ==========================================================================
   4. CONTEXTUAL STYLE BAR
   ========================================================================== */
.floating-stylebar {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  z-index: 95;
  transition: var(--transition-fast);
}

.floating-stylebar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

.style-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.color-swatch:hover {
  transform: scale(1.2);
}

.color-swatch.active {
  border-color: #FFFFFF;
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scale(1.15);
}

.size-selector {
  display: flex;
  align-items: center;
  gap: 4px;
}

.size-btn {
  width: 26px;
  height: 26px;
  background: var(--surface-hover);
  border: 1px solid transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.size-btn span {
  width: 14px;
  background: var(--text-primary);
  border-radius: 2px;
}

.size-btn:hover {
  background: var(--surface-active);
}

.size-btn.active {
  border-color: var(--accent-primary);
  background: var(--surface-active);
}

.toggle-pill-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.toggle-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.fill-preview-box {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--accent-primary);
  border-radius: 2px;
}

.toggle-pill-btn.filled .fill-preview-box {
  background: var(--accent-primary);
}

/* ==========================================================================
   5. SMART AI ASSISTANT DRAWER
   ========================================================================== */
.ai-drawer {
  position: fixed;
  top: 76px;
  right: 16px;
  bottom: 24px;
  width: 400px;
  background: var(--surface-panel);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 16px;
  box-shadow: -12px 16px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 105;
  transform: translateX(calc(100% + 24px));
  transition: transform var(--transition-bounce);
}

.ai-drawer.open {
  transform: translateX(0);
}

.ai-drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.ai-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-avatar-pulse {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10B981, #38BDF8);
  color: #070C14;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--accent-glow);
  animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 14px var(--accent-glow); }
  50% { box-shadow: 0 0 24px var(--accent-glow); }
}

.ai-header-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-status-text {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.drawer-close-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* Tabs */
.ai-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.08);
}

.ai-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.ai-tab:hover {
  color: var(--text-primary);
}

.ai-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Panes */
.ai-pane {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 14px;
}

.ai-pane.active {
  display: flex;
}

.ai-input-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ai-textarea {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
}

.ai-textarea:focus {
  border-color: var(--accent-primary);
  background: var(--surface-panel);
}

.ai-actions-row {
  display: flex;
  gap: 8px;
}

.ai-select {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  flex: 1;
}

.btn-ai-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #070C14;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-ai-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px var(--accent-glow);
}

.ai-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-chips-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-chip {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.ai-chip:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  transform: translateX(4px);
}

.ai-status-box {
  background: var(--surface-hover);
  border: 1px solid var(--accent-primary);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
}

.ai-status-box.hidden {
  display: none;
}

/* AI Analyze pane */
.ai-analyze-intro p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.ai-analyze-buttons {
  display: flex;
  gap: 8px;
}

.btn-ai-secondary {
  flex: 1;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-ai-secondary:hover {
  background: var(--surface-active);
  border-color: var(--accent-primary);
}

.ai-result-area {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  min-height: 180px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

.ai-empty-state {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 30px 10px;
}

/* AI Settings Pane */
.ai-setting-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.radio-card:hover {
  border-color: var(--accent-primary);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--accent-primary);
}

.radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-content strong {
  font-size: 12px;
  color: var(--text-primary);
}

.radio-content span {
  font-size: 11px;
  color: var(--text-muted);
}

.ai-input {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.setting-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-save-key {
  background: var(--accent-primary);
  color: #070C14;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

/* ==========================================================================
   6. MODALS (TEMPLATES & EXPORT)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--surface-panel);
  border: 1px solid var(--surface-panel-border);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.25s var(--transition-bounce);
}

.modal-card.wide {
  max-width: 840px;
}

@keyframes modal-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--badge-bg);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 26px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Templates Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.template-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.template-icon-wrap {
  font-size: 24px;
  margin-bottom: 4px;
}

.template-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.template-info {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Export Options */
.export-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.export-icon {
  font-size: 28px;
}

.export-info {
  flex: 1;
}

.export-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.export-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-export-action {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-export-action:hover {
  background: var(--accent-primary);
  color: #070C14;
  border-color: var(--accent-primary);
}

.btn-export-action.file-label {
  display: inline-block;
  cursor: pointer;
}

/* ==========================================================================
   7. MINIMAP
   ========================================================================== */
.minimap-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 140px;
  height: 90px;
  background: var(--surface-panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 90;
  cursor: pointer;
  transition: var(--transition-fast);
}

.minimap-container:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

#minimapCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.minimap-viewport {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px solid var(--accent-primary);
  background: rgba(56, 189, 248, 0.15);
  border-radius: 3px;
  pointer-events: none;
}

/* ==========================================================================
   8. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

.board-toast {
  background: var(--surface-panel);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  animation: toast-slide-in 0.25s var(--transition-bounce), toast-fade-out 0.3s forwards 3s;
  pointer-events: auto;
}

@keyframes toast-slide-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toast-fade-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .top-nav-bar {
    padding: 0 10px;
  }
  .board-title-input {
    max-width: 110px;
  }
  .ai-drawer {
    width: calc(100vw - 32px);
    right: 16px;
  }
  .minimap-container {
    display: none;
  }
}

/* ==========================================================================
   MATEMATIK FORMULA MUHARRIRI STILLARI
   ========================================================================== */
.formula-preview-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.formula-preview-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.formula-preview-box {
  background: var(--surface-card);
  border: 1.5px solid var(--accent-primary);
  border-radius: 12px;
  padding: 16px 20px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--accent-primary);
  box-shadow: 0 4px 20px var(--accent-glow);
  overflow-x: auto;
}

.formula-preview-box .katex {
  font-size: 1.15em;
}

.formula-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.formula-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.formula-textarea {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
}

.formula-textarea:focus {
  border-color: var(--accent-primary);
  background: var(--surface-panel);
}

.formula-keypad-section, .formula-presets-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.formula-keypad-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.formula-keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
}

.fkey-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.fkey-btn:hover {
  background: var(--surface-active);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.formula-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.fpreset-btn {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fpreset-btn:hover {
  background: var(--surface-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateX(2px);
}

.formula-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  gap: 12px;
}

.formula-size-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   OCR FLOATING TOOLBAR & CONFIRM MODAL STYLES
   ========================================================================== */
.ocr-floating-toolbar {
  position: fixed;
  transform: translate(-50%, -100%);
  background: var(--surface-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 30px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.25);
  z-index: 120;
  pointer-events: auto;
  transition: opacity 0.15s ease, transform 0.15s ease;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ocr-floating-toolbar.hidden {
  display: none;
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -90%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

.ocr-pill-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding-right: 4px;
}

.ocr-pill-btn {
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.ocr-pill-btn.formula-btn {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.ocr-pill-btn.formula-btn:hover {
  background: #38BDF8;
  color: #070C14;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.ocr-pill-btn.text-btn {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.ocr-pill-btn.text-btn:hover {
  background: #10B981;
  color: #070C14;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.ocr-pill-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

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

/* OCR Comparison Grid */
.ocr-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ocr-source-box, .ocr-result-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ocr-img-wrap {
  height: 140px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

.ocr-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   AI FORMULA REJIMI (ACTIVE FORMULA MODE) & JONLI LIVE BADGE
   ========================================================================== */
#btnAiFormulaMode.active,
.tool-btn.active-formula-mode {
  background: rgba(168, 85, 247, 0.22) !important;
  color: #C084FC !important;
  border-color: #A855F7 !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.45) !important;
}

#btnAiFormulaMode .mode-dot {
  background: #A855F7;
  box-shadow: 0 0 8px #A855F7;
}

/* AI Formula Rejimi Yuqori Holat Ko'rsatkichi */
.formula-mode-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 30px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 16px rgba(168, 85, 247, 0.25);
  z-index: 60;
  pointer-events: auto;
  animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.formula-mode-banner.hidden {
  display: none;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.fmode-badge-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #A855F7;
  box-shadow: 0 0 12px 3px #A855F7;
  animation: pulseNeon 1.5s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseNeon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.fmode-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.fmode-title {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #C084FC;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.fmode-hint {
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 580px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fmode-exit-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

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

/* Suzuvchi Jonli Formula Nishoni (Formula Live Badge) */
.formula-live-badge {
  position: absolute;
  transform: translate(-50%, -100%);
  margin-top: -14px;
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 20px rgba(168, 85, 247, 0.3);
  z-index: 85;
  pointer-events: auto;
  min-width: 200px;
  max-width: 480px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  animation: badgePop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.formula-live-badge.hidden {
  display: none;
}

@keyframes badgePop {
  from { opacity: 0; transform: translate(-50%, -85%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

/* Loading State */
.fbadge-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #C084FC;
  padding: 4px 6px;
}

.fbadge-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(168, 85, 247, 0.2);
  border-top-color: #A855F7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Ready State */
.fbadge-ready {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fbadge-ready.hidden {
  display: none;
}

.fbadge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fbadge-word-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #38BDF8;
  letter-spacing: 0.5px;
}

/* KaTeX Live Preview Box (MS Word Style) */
.fbadge-katex-preview {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: #F8FAFC;
  font-family: "Cambria Math", "Latin Modern Math", "STIX Two Math", "KaTeX_Main", "Times New Roman", serif;
  font-size: 22px;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Microsoft Word Equation Style Typography */
.fbadge-katex-preview .katex,
.formula-preview-box .katex,
.katex-display {
  font-family: "Cambria Math", "Latin Modern Math", "STIX Two Math", "KaTeX_Main", "Times New Roman", serif !important;
  letter-spacing: 0.02em;
}

.fbadge-katex-preview .katex .frac-line,
.formula-preview-box .katex .frac-line {
  border-bottom-width: 0.06em !important;
}

.fbadge-katex-preview .katex .sqrt,
.formula-preview-box .katex .sqrt {
  font-size: 1.05em;
}

/* Actions in Live Badge */
.fbadge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.fbadge-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.fbadge-btn.confirm {
  background: #10B981;
  color: #064E3B;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.fbadge-btn.confirm:hover {
  background: #059669;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
}

.fbadge-btn.edit {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.fbadge-btn.edit:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #7DD3FC;
  transform: translateY(-1px);
}

.fbadge-btn.close {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 8px;
  margin-left: auto;
}

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

/* ==========================================================================
   AI CO-PILOT, VOICE ASSISTANT & ADVANCED AI STYLES
   ========================================================================== */

/* 1. Voice Microphone Button */
.voice-mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38BDF8;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.voice-mic-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38BDF8;
  color: #FFFFFF;
}

.voice-mic-btn.icon-only {
  padding: 8px 10px;
  border-radius: 8px;
}

.voice-mic-btn.listening {
  background: #EF4444 !important;
  border-color: #F87171 !important;
  color: #FFFFFF !important;
  animation: micPulse 1.2s infinite alternate;
}

@keyframes micPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0.4); }
  100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
}

/* 2. AI Chat (Co-pilot) */
.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px);
  min-height: 420px;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: fadeIn 0.2s ease;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg.bot .chat-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #F1F5F9;
  border-top-left-radius: 2px;
  backdrop-filter: blur(8px);
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFFFFF;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.chat-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-chat-insert {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-chat-insert:hover {
  background: #10B981;
  color: #064E3B;
}

.ai-chat-quick-prompts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}

.chat-quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-quick-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border-color: #38BDF8;
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.ai-chat-input {
  flex: 1;
  background: var(--surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  resize: none;
  outline: none;
}

.ai-chat-input:focus {
  border-color: var(--accent-primary);
}

/* 3. Analyze Buttons Grid */
.ai-analyze-grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn-ai-secondary.action-green {
  border-color: rgba(16, 185, 129, 0.3);
  color: #10B981;
}

.btn-ai-secondary.action-green:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10B981;
}

.btn-ai-secondary.action-amber {
  border-color: rgba(245, 158, 11, 0.3);
  color: #F59E0B;
}

.btn-ai-secondary.action-amber:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
}

/* 4. Validation Cards */
.validation-card {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.validation-card.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #FDE68A;
}

.validation-card.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #A7F3D0;
}

.validation-card.info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #BAE6FD;
}

.validation-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

/* ==========================================================================
   15. KO'P SAHIFA (MULTI-PAGE) BOSHQARUV TIZIMI STILLARI
   ========================================================================== */
.board-pages-bar {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 12px;
  padding: 5px 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 90;
  max-width: calc(50vw - 320px);
  transition: var(--transition-fast);
}

.pages-tabs-container {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 320px;
  scrollbar-width: none;
}

.pages-tabs-container::-webkit-scrollbar {
  display: none;
}

.page-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: var(--transition-fast);
}

.page-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.page-tab.active {
  background: rgba(0, 255, 135, 0.12);
  color: #00FF87;
  border-color: rgba(0, 255, 135, 0.4);
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.2);
}

.page-tab-title {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
}

.page-tab-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.btn-add-page {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-add-page:hover {
  background: rgba(0, 255, 135, 0.2);
  color: #00FF87;
  border-color: rgba(0, 255, 135, 0.4);
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.2);
}

/* ==========================================================================
   16. OB'EKTLARNI QIDIRISH (SEARCH - CTRL+F) STILLARI
   ========================================================================== */
.board-search-bar {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 150;
  animation: slideInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.board-search-bar.hidden {
  display: none;
}

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

.search-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

#boardSearchInput {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  width: 180px;
}

#boardSearchInput::placeholder {
  color: var(--text-muted);
}

.search-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
  white-space: nowrap;
}

.search-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.search-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

/* ==========================================================================
   17. O'NG KLIK KONTEKST MENYUSI (RIGHT-CLICK CONTEXT MENU) STILLARI
   ========================================================================== */
.board-context-menu {
  position: fixed;
  z-index: 350;
  width: 210px;
  background: var(--surface-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-panel-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.4);
  animation: popContextMenu 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.board-context-menu.hidden {
  display: none;
}

@keyframes popContextMenu {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.context-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.context-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ctx-icon {
  font-size: 14px;
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ctx-label {
  flex: 1;
}

.ctx-shortcut {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ctx-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 5px 0;
}

.context-item.danger {
  color: #F87171;
}

.context-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* ==========================================================================
   18. INTERAKTIV DOSKA (SMARTBOARD / TOUCH) MOSLASHUV STILLARI
   ========================================================================== */

/* Faol Smartboard rejimida barcha tugmalar va elementlar kattalashadi */
body.smartboard-mode .floating-toolbar {
  padding: 8px 14px;
  gap: 8px;
  border-radius: 20px;
}

body.smartboard-mode .tool-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

body.smartboard-mode .tool-btn svg {
  width: 22px;
  height: 22px;
}

body.smartboard-mode .quick-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

body.smartboard-mode .quick-icon-btn svg {
  width: 20px;
  height: 20px;
}

body.smartboard-mode .popover-item {
  padding: 12px 16px;
  font-size: 14px;
}

body.smartboard-mode .popover-item svg {
  width: 20px;
  height: 20px;
}

/* Sarlavhadagi faol Smartboard tugmasi */
#btnSmartboardToggle.active {
  background: rgba(0, 255, 135, 0.18) !important;
  color: #00FF87 !important;
  border-color: rgba(0, 255, 135, 0.5) !important;
  box-shadow: 0 0 14px rgba(0, 255, 135, 0.3) !important;
}

#btnBoardFullscreen.active {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #38BDF8 !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

/* 19. Suzuvchi Sensorli Klaviatura Tugmasi (FAB) */
.floating-keyboard-fab {
  position: fixed;
  bottom: 126px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--surface-panel-border);
  background: var(--surface-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 95;
  transition: var(--transition-fast);
}

.floating-keyboard-fab:hover, .floating-keyboard-fab:active {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.4);
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

#btnToggleVirtualKeyboard.active {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #38BDF8 !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

/* Faqat smartboard-mode da ko'rsatish (desktopda xalaqit bermaydi) */
body:not(.smartboard-mode) .floating-keyboard-fab {
  display: none;
}

/* 20. Sensorli Ekran Virtual Klaviaturasi */
.virtual-keyboard-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 960px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.7);
  z-index: 400;
  padding: 10px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUpKeyboard 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.virtual-keyboard-container.hidden {
  display: none;
}

@keyframes slideUpKeyboard {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}

.vk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vk-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #38BDF8;
}

.vk-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vk-mode-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.vk-mode-btn.active, .vk-mode-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.4);
}

.vk-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.vk-close-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.vk-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vk-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.vk-key {
  flex: 1;
  min-width: 36px;
  max-width: 72px;
  height: 48px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #F8FAFC;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.vk-key:active {
  transform: scale(0.94);
  background: #38BDF8;
  color: #070C14;
}

.vk-key-special {
  flex: 1.4;
  background: rgba(51, 65, 85, 0.9);
  font-size: 13px;
  font-weight: 700;
}

.vk-key-shift.active {
  background: #38BDF8;
  color: #070C14;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.vk-key-space {
  flex: 4;
  max-width: 320px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.vk-key-enter {
  flex: 1.8;
  background: #10B981;
  color: #064E3B;
  font-weight: 700;
  border-color: #10B981;
}

.vk-key-enter:active {
  background: #059669;
  color: #FFFFFF;
}

.vk-key-mic {
  color: #38BDF8;
}

.vk-key-mic.listening {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  animation: micPulse 1.2s infinite alternate;
}

/* 21. Touch Long-Press Ripple Effekti */
.touch-longpress-ripple {
  position: fixed;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #00FF87;
  background: rgba(0, 255, 135, 0.15);
  box-shadow: 0 0 20px rgba(0, 255, 135, 0.5);
  transform: translate(-50%, -50%) scale(0.2);
  pointer-events: none;
  z-index: 999;
  opacity: 0;
}

.touch-longpress-ripple.animate {
  animation: longpressExpand 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.touch-longpress-ripple.hidden {
  display: none;
}

@keyframes longpressExpand {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* ==========================================================================
   22. SUBNET / VLSM CALCULATOR & COMPARISON TABLE MODAL STYLES
   ========================================================================== */
.subnet-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.subnet-ip-input {
  flex: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #F8FAFC;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.subnet-ip-input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.subnet-cidr-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subnet-cidr-slider {
  flex: 1;
  accent-color: #38BDF8;
  cursor: pointer;
}

.subnet-cidr-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #38BDF8;
  min-width: 38px;
}

.subnet-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.subnet-chip {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.subnet-chip:hover, .subnet-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38BDF8;
  color: #38BDF8;
}

.subnet-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.subnet-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
}

.subnet-card-title {
  font-size: 11px;
  color: #94A3B8;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subnet-card-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
  word-break: break-all;
}

.subnet-card.highlight .subnet-card-val {
  color: #00FF87;
}

.subnet-card.cyan .subnet-card-val {
  color: #38BDF8;
}

.subnet-card.amber .subnet-card-val {
  color: #F59E0B;
}

.subnet-card.purple .subnet-card-val {
  color: #A855F7;
}

/* Comparison Tables Grid */
.comparison-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.comparison-preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #E2E8F0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.comparison-preset-btn:hover, .comparison-preset-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10B981;
  color: #10B981;
}

.comparison-preset-btn .icon {
  font-size: 16px;
}

.comparison-preview-wrap {
  max-height: 240px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.comparison-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.comparison-preview-table th {
  text-align: left;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #38BDF8;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-preview-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #CBD5E1;
}

.comparison-preview-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   23. FLOATING SELECTION AI ACTION BAR
   ========================================================================== */
.selection-floating-bar {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 255, 135, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 135, 0.15);
  border-radius: 30px;
  padding: 6px 14px;
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.selection-floating-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.selection-ai-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #F8FAFC;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.selection-ai-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #00FF87;
}

.selection-ai-btn.primary {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(0, 255, 135, 0.35);
  color: #00FF87;
}

.selection-ai-btn.primary:hover {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.35), rgba(56, 189, 248, 0.35));
  box-shadow: 0 0 14px rgba(0, 255, 135, 0.4);
}

.selection-bar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   24. HUJJATLARNI O'QISH VA TAHLIL QILISH (DOCUMENT READER & IMPORTER)
   ========================================================================== */

/* Menyu ichidagi tugmani ajratib ko'rsatish */
.doc-import-highlight {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.12), rgba(56, 189, 248, 0.12)) !important;
  border: 1px solid rgba(0, 255, 135, 0.35) !important;
  color: #00FF87 !important;
}

.doc-import-highlight:hover {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.22), rgba(56, 189, 248, 0.22)) !important;
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.25) !important;
}

/* Drag & Drop maydoni */
.doc-drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.4);
  border-radius: 16px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  user-select: none;
}

.doc-drop-zone:hover {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(56, 189, 248, 0.06);
  transform: translateY(-2px);
}

.doc-drop-zone.drag-over {
  border-color: #00FF87;
  background: rgba(0, 255, 135, 0.1);
  box-shadow: 0 0 24px rgba(0, 255, 135, 0.25);
  transform: scale(1.01);
}

.doc-drop-icon {
  color: #38BDF8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: transform var(--transition-fast);
}

.doc-drop-zone:hover .doc-drop-icon {
  transform: scale(1.08);
}

.doc-drop-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.doc-browse-link {
  color: #38BDF8;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.doc-drop-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* Format nishonlari (Badges) */
.doc-format-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.doc-format-badges span {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-pdf {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-docx {
  background: rgba(59, 130, 246, 0.18);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-xlsx {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-pptx {
  background: rgba(249, 115, 22, 0.18);
  color: #FB923C;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.badge-csv {
  background: rgba(20, 184, 166, 0.18);
  color: #2DD4BF;
  border: 1px solid rgba(20, 184, 166, 0.35);
}

.badge-txt {
  background: rgba(168, 85, 247, 0.18);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Yuklanish animatsiyasi */
.doc-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 20px;
  text-align: center;
}

.doc-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38BDF8;
  border-right-color: #00FF87;
  border-radius: 50%;
  animation: doc-spin 0.85s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

@keyframes doc-spin {
  to { transform: rotate(360deg); }
}

#docLoadingText {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Tahlil qilingan fayl ko'rinish bo'limi */
.doc-preview-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modal-pop 0.2s ease;
}

.doc-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.doc-info-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.doc-type-icon {
  font-size: 28px;
  flex-shrink: 0;
}

#docPreviewFileName {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.doc-meta-tags {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.doc-meta-tags span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Tablar */
.doc-content-preview-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.doc-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.doc-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.doc-tab-btn.active {
  color: #00FF87;
  background: rgba(0, 255, 135, 0.12);
  border: 1px solid rgba(0, 255, 135, 0.3);
}

.doc-tab-content {
  display: none;
}

.doc-tab-content.active {
  display: block;
}

/* Miniaturalar (Thumbnail) panjarasi */
.doc-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 12px;
}

.doc-thumb-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.doc-thumb-card:hover {
  transform: translateY(-2px);
  border-color: #38BDF8;
}

.doc-thumb-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.doc-thumb-card span {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Matn snippet ko'rinishi */
.doc-text-preview-box {
  max-height: 240px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
}

/* Amallar panjarasi (Action Cards) */
.doc-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.doc-action-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.doc-action-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.doc-action-card:active {
  transform: translateY(0);
}

.doc-action-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.doc-action-details h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.doc-action-details p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* AI maxsus amallari kartochkasi */
.doc-action-card.ai-glow {
  border-color: rgba(0, 255, 135, 0.3);
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.05), rgba(56, 189, 248, 0.05));
}

.doc-action-card.ai-glow:hover {
  border-color: #00FF87;
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.12), rgba(56, 189, 248, 0.12));
  box-shadow: 0 0 24px rgba(0, 255, 135, 0.25);
}

/* ==========================================================================
   25. TO'G'RIDAN-TO'G'RI NAMOYISH REJIMI (INTERACTIVE PRESENTATION MODE)
   ========================================================================== */

/* Headerdagi Namoyish tugmasi */
.btn-present-highlight {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(56, 189, 248, 0.2)) !important;
  border: 1px solid rgba(0, 255, 135, 0.45) !important;
  color: #00FF87 !important;
}

.btn-present-highlight:hover {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.35), rgba(56, 189, 248, 0.35)) !important;
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.4) !important;
  transform: scale(1.05);
}

/* Modal ichidagi Asosiy Hero Tugma va Kartochka */
.hero-present-card {
  border-color: rgba(0, 255, 135, 0.5) !important;
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.12), rgba(56, 189, 248, 0.12)) !important;
  grid-column: 1 / -1;
  box-shadow: 0 4px 20px rgba(0, 255, 135, 0.15);
}

.hero-present-card:hover {
  border-color: #00FF87 !important;
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.22), rgba(56, 189, 248, 0.22)) !important;
  box-shadow: 0 8px 30px rgba(0, 255, 135, 0.3) !important;
}

.hero-present-btn {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-present-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.4);
}

/* --------------------------------------------------------------------------
   FULLSCREEN PRESENTATION OVERLAY
   -------------------------------------------------------------------------- */
.presentation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #06090F;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.presentation-overlay.hidden {
  display: none !important;
}

/* Yuqori nozik boshqaruv paneli */
.presenter-top-bar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  z-index: 20;
}

.presenter-doc-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.presenter-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 255, 135, 0.15);
  color: #00FF87;
  border: 1px solid rgba(0, 255, 135, 0.3);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.presenter-title {
  font-size: 14px;
  font-weight: 700;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.presenter-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.presenter-top-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.presenter-top-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38BDF8;
}

.presenter-close-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  font-size: 20px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.presenter-close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #FFF;
  transform: scale(1.05);
}

/* Asosiy Slayd Sahifasi (Stage) */
.presenter-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px 24px 80px 24px;
}

.presenter-slide-viewport {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 50px rgba(56, 189, 248, 0.08);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.presenter-slide-img {
  max-width: 88vw;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}

/* Boyitilgan Slayd Kartasi (PPTX, DOCX, Matn) */
.presenter-slide-card {
  width: 86vw;
  max-width: 1040px;
  height: 75vh;
  background: radial-gradient(circle at 10% 20%, #0d1b2a, #070b12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 22px;
  box-shadow: inset 0 0 60px rgba(56, 189, 248, 0.04);
  color: #F8FAFC;
}

.presenter-slide-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 12px;
  border-radius: 8px;
  width: fit-content;
  text-transform: uppercase;
}

.presenter-slide-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
  background: linear-gradient(135deg, #FFFFFF, #94A3B8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.presenter-slide-bullets {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.presenter-slide-bullet {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 18px;
  line-height: 1.5;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 18px;
  border-radius: 12px;
}

.presenter-slide-bullet-icon {
  color: #00FF87;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 3px;
}

/* Slayd ustiga chizish qatlami (Draw Canvas) */
.presenter-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 10;
  cursor: crosshair;
}

.presenter-draw-canvas.cursor-mode {
  cursor: default;
  pointer-events: none;
}

.presenter-draw-canvas.laser-mode {
  cursor: none;
}

/* Lazer ko'rsatkich nuqtasi */
.presenter-laser-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #F43F5E;
  box-shadow: 0 0 16px #F43F5E, 0 0 32px #F43F5E;
  pointer-events: none;
  z-index: 25;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s;
}

/* Pastki suzuvchi panel */
.presenter-bottom-bar {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 40px;
  padding: 8px 18px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.8), 0 0 24px rgba(56, 189, 248, 0.2);
  z-index: 50;
  transition: transform 0.25s, opacity 0.25s;
}

.presenter-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.presenter-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.presenter-nav-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38BDF8;
  color: #38BDF8;
  transform: scale(1.08);
}

.presenter-counter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #CBD5E1;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.presenter-counter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #00FF87;
}

.presenter-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.presenter-tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.presenter-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
}

.presenter-tool-btn.active {
  background: rgba(0, 255, 135, 0.2);
  border-color: rgba(0, 255, 135, 0.5);
  color: #00FF87;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.3);
}

.presenter-color-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.pcolor-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.pcolor-dot.active {
  transform: scale(1.3);
  border-color: #FFF;
  box-shadow: 0 0 8px currentColor;
}

.presenter-bar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

.presenter-quick-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.presenter-quick-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #38BDF8;
}

/* Slaydlar Lentasi (Thumbnail Drawer) */
.presenter-thumb-drawer {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 920px;
  max-height: 220px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: modal-pop 0.2s ease;
}

.presenter-thumb-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.presenter-thumb-drawer-header h5 {
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0;
}

.presenter-thumb-drawer-header button {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 18px;
  cursor: pointer;
}

.presenter-thumb-drawer-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px;
}

.presenter-thumb-item {
  flex-shrink: 0;
  width: 140px;
  height: 95px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: #000;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.presenter-thumb-item:hover {
  border-color: #38BDF8;
  transform: translateY(-3px);
}

.presenter-thumb-item.active {
  border-color: #00FF87;
  box-shadow: 0 0 14px rgba(0, 255, 135, 0.5);
}

.presenter-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.presenter-thumb-item .thumb-label {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.8);
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* AI Slayd Izohi Paneli */
.presenter-ai-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 360px;
  max-height: 75vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 255, 135, 0.4);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 255, 135, 0.15);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: modal-pop 0.2s ease;
}

.presenter-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.presenter-ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.presenter-ai-title h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #00FF87;
}

.presenter-ai-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 20px;
  cursor: pointer;
}

.presenter-ai-body {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #CBD5E1;
  max-height: 50vh;
}

.presenter-ai-footer {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.presenter-ai-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.presenter-ai-action-btn:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: #00FF87;
  color: #00FF87;
}

/* ==========================================================================
   25b. ODDIY DOSKA NAMOYISHI (SIMPLE WHITEBOARD PRESENTER MODE)
   ========================================================================== */

/* Asosiy toolbar AI tugmasi */
.ai-tool-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(0, 255, 135, 0.2)) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38BDF8 !important;
}

.ai-tool-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(0, 255, 135, 0.35)) !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35) !important;
}

/* Oddiy namoyish paytida interfeysni tozalash (Chalg'ituvchi barcha elementlarni yashirish) */
body.board-presentation-active .minimal-header,
body.board-presentation-active .floating-toolbar,
body.board-presentation-active .floating-stylebar,
body.board-presentation-active .floating-keyboard-fab,
body.board-presentation-active .minimap-container,
body.board-presentation-active .page-indicator-bar,
body.board-presentation-active .board-search-bar,
body.board-presentation-active .selection-floating-bar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(30px) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.board-presentation-active .minimal-header {
  transform: translateY(-30px) !important;
}

/* Oddiy Doska Namoyishi suzuvchi paneli */
.board-presenter-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 255, 135, 0.4);
  border-radius: 40px;
  padding: 8px 20px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 255, 135, 0.2);
  z-index: 100;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  animation: modal-pop 0.25s ease;
}

.board-presenter-bar.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(20px) !important;
}

.board-pres-page-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
  padding: 0 8px;
  white-space: nowrap;
}

.board-pres-exit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #F87171;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.board-pres-exit-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #FFF;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ATT-25 Animated Crest */
.crest-shield {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}
.crest-shield:hover {
  transform: translateY(-1px) scale(1.05);
  filter: drop-shadow(0 0 10px rgba(0, 255, 135, 0.6));
}
@keyframes attLogoSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes attCorePulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #00FF87); } 50% { transform: scale(1.18); filter: drop-shadow(0 0 10px #00F0FF); } }
@keyframes attPhotonFlow { 0% { stroke-dashoffset: 24; } 100% { stroke-dashoffset: 0; } }
.att-animated-logo .logo-radar-ring { transform-origin: 32px 36px; animation: attLogoSpin 12s linear infinite; }
.att-animated-logo .logo-core-pulse { transform-origin: 32px 35.5px; animation: attCorePulse 2.4s ease-in-out infinite; }
.att-animated-logo .logo-photon-track { stroke-dasharray: 4 6; animation: attPhotonFlow 1.8s linear infinite; }










