/* ===========================

# ----------------------------------------------
# Main dot shape and color is styled below.
# 0.5px dot
# 1px dot
# 2px dot

/* =====================================
   Border Weight Dot Sizes in Main Popup
   Border Weight Circle Styles in Main Popup
   ===================================== */
#border-weight-controls .weight-circle > .dot-weight-05 {
  width: 2px;
  height: 2px;
}

#border-weight-controls .weight-circle > .dot-weight-1 {
  width: 3px;
  height: 3px;
}

#border-weight-controls .weight-circle > .dot-weight-2 {
  width: 4px;
  height: 4px;
}

#border-weight-controls .weight-circle > div {
  border-radius: 50%;
  background: #bbb; /* default dot color */
}

/* Border weight circle: size, shape, and center flex */
#border-weight-controls .weight-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Light theme weight circle appearance: background and border */
body.light #border-weight-controls .weight-circle {
  background-color: #f6f7fa !important;
  border: 1px solid #cfcfd8 !important;
}

/* Selected weight circle in light theme: blue background and border */
body.light #border-weight-controls .weight-circle.selected {
  background-color: #2976ff !important;
  border-color: #2976ff !important;
}

/* Dark theme weight circle appearance: background and border */
body.dark #border-weight-controls .weight-circle {
  background-color: #232429 !important;
  border: 1px solid #393943 !important;
}

/* Selected weight circle in dark theme: blue background and border */
body.dark #border-weight-controls .weight-circle.selected {
  background-color: #2976ff !important;
  border-color: #2976ff !important;
}

/* Selected weight circle border override (all themes) */
#border-weight-controls .weight-circle.selected {
  border-color: #2976ff !important;
}

/* Dot inside weight circle: default and selected colors */
#border-weight-controls .weight-circle > div {
  background-color: #bbb; /* default dot color */
}

#border-weight-controls .weight-circle.selected > div {
  background-color: #ffffff !important; /* white dot for selected */
}
/* ==== END Border Weight Dot Sizes ==== */
/* ==== END Border Weight Circle Styles ==== */
/* ===== CLEO Table Tool Styles ===== */










/* ===============================================
   Table Tool Popup Controls Layout in Main Popup
   =============================================== */
#custom-table-popup .popup-controls-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

#custom-table-popup .popup-bottom-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
}
/* ==== END Table Tool Popup Controls Layout Styles ==== */











/* ===============================================
   Table Tool Popup Styles - Main Table Creator
   Transferred to ui-theme-v2.css
   =============================================== */

/* ==== END Table Tool Popup Styles ==== */




/* ===========================
   Grid Cell Styles in Main Popup
   =========================== */
   
/* Base grid cell styling: size, shape, layout, and interaction */
#grid-container .grid-cell {
  min-width: 18px;
  min-height: 18px;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: normal;
  user-select: none;
}

/* Light theme cell appearance: background, border, text color */
body.light #grid-container .grid-cell {
  background-color: #f6f7fa;
  border: 1px solid #cfcfd8;
  color: #7c7c7c;
}

/* Dark theme cell appearance: background, border, text color */
body.dark #grid-container .grid-cell {
  background-color: #232429;
  border: 1px solid #393943;
  color: #bbbbbb;
}

/* Hover state for grid cells: highlight with blue background and white text */
#grid-container .grid-cell:hover {
  background-color: #4165b8;
  border-color: #5a87e0;
  color: #fff;
}

/* Hovered and selected states in light theme: subtle blue background and dark text */
#grid-container .grid-cell.hovered,
#grid-container .grid-cell.selected {
  background-color: #d0e4ff !important; /* subtle light blue */
  border-color: #a0c4ff !important;    /* slightly darker blue border */
  color: #000 !important;               /* dark text for contrast */
}

/* Hovered and selected states in dark theme: subtle dark blue background and white text */
body.dark #grid-container .grid-cell.hovered,
body.dark #grid-container .grid-cell.selected {
  background-color: #1e2a55 !important; /* subtle dark blue */
  border-color: #3350a1 !important;
  color: #fff !important;
}
/* ==== END Grid Cell Styles ==== */









/* ========================================
   Grid Container Styles in Main Popup
   Table Tool Grid Container Layout in Main Popup
   ======================================== */

/* Grid container layout and scrolling behavior */
#grid-container {
  display: grid;
  grid-template-columns: repeat(20, 1fr); /* Default, will be overridden by JS */
  grid-template-rows: repeat(20, 1fr);    /* Default, will be overridden by JS */
  gap: 4px !important; /* spacing between grid cells */
  max-height: calc(100% - 0px) !important; /* constrain max height */
  min-height: 0 !important;
  height: auto !important;
  width: 100%;
  justify-content: center;
  margin: 0 auto;
  user-select: none;
  overflow: visible;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  /* Prevent grid from overflowing above the count/info area */
  overflow: auto !important; /* enable scrolling if content overflows */
}
/* ==== END Grid Container Styles ==== */
/* ==== END Table Tool Grid Container Layout ==== */












/* =============================================
   Context Menu Styles For Added Table
   ============================================= */
/* --- Redesigned Context menu styles --- */
/* Base context menu container styling */
.tt-context-menu {
  position: absolute;
  z-index: 10000000;
  border-radius: 12px;
  min-width: 220px;
  font-size: 14px;
  overflow: visible;
  user-select: none;
  animation: tt-context-fadein 0.1s;
  padding: 5px 0;
}

/* Light Mode Context Menu: semi-transparent background, border, and text color */
body.light .tt-context-menu {
  background: rgba(246, 247, 250, 0.8);
  color: #000000;
  border: 1px solid rgba(207, 207, 216, 0.8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}
/* Light Mode context menu items text color */
body.light .tt-context-menu .tt-context-item {
  color: #000000;
}

/* Dark Mode Context Menu: semi-transparent dark background, border, and white text */
body.dark .tt-context-menu {
  background: rgba(25, 26, 29, 0.8);
  color: #ffffff;
  border: 1px solid rgba(38, 38, 49, 0.8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* Dark Mode context menu items text color */
body.dark .tt-context-menu .tt-context-item {
  color: #ffffff;
}


/* Fade-in animation for context menu */
@keyframes tt-context-fadein { 
  from { opacity: 0; transform: scale(0.97); } 
  to { opacity: 1; transform: 1; } 
}

/* Context menu actions area: vertical layout, no max-height to allow full display */
.tt-context-menu .tt-actions-area {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  /* max-height and overflow-y removed to allow full menu display */
  overscroll-behavior: contain;
  min-width: 0;
  background: transparent;
}

/* Cleo-style context menu item: layout, font, padding, and interaction */
.tt-context-menu .tt-context-item {
  display: block;
  font-size: 13px;
  margin: 3px auto;
  font-weight: normal;
  background: none;
  padding: 4px 8px 4px 8px;
  border: none;
  outline: none;
  cursor: pointer;
  max-width: 100%;
  width: calc(100% - 16px);
  text-align: left;
  line-height: 20px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Disabled context menu items: muted color and no pointer interaction */
.tt-context-menu .tt-context-item:disabled,
.tt-context-menu .tt-context-item[disabled],
.tt-context-menu .tt-context-item.disabled {
  color: #b0b3bb;
  cursor: not-allowed;
  background: none;
}

/* Remove bottom border from the last context menu item */
.tt-context-menu .tt-context-item:last-child {
  border-bottom: none;
}

/* Hide span elements inside context menu items (likely for icons or extra info) */
.tt-context-menu .tt-context-item span {
  display: none;
}

/* Margin for SVG icons inside context menu items */
.tt-context-menu .tt-context-item svg {
  margin-right: 8px;
}

/* Hover state: blue background and white text for interactive context menu items */
.tt-context-menu .tt-context-item:hover:not(:disabled) {
  background-color: #2976ff;
  color: white;
}

/* Active or selected context menu items: highlight text in blue */
.tt-context-menu .tt-context-item.active,
.tt-context-menu .tt-context-item.selected {
  color: #2976ff;
}
/* ==== END Context Menu Styles ==== */












/* =========================================================
   Tooltip Styles For Table Cell Notes For Added Table
   ========================================================= */

/* Tooltip popup styling: similar to notifier-tooltips.js */
.tt-comment-tooltip {
  position: absolute;
  z-index: 10000001;
  background: #1c1c1e; /* light mode default */
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 6px 32px rgba(0,0,0,0.13), 0 1.5px 6px rgba(0,0,0,0.06);
  pointer-events: none;
  white-space: pre-line;
  max-width: 260px;
  min-width: 80px;
  opacity: 0;
  transition: opacity 0.13s;
  left: 0; top: 0;
}

.tt-comment-tooltip.tt-visible {
  opacity: 1;
  pointer-events: none;
}

/* Tooltip arrow */
.tt-comment-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.08));
  display: block;
  width: 0; height: 0;
}

/* Light theme: dark tooltip */
body.light .tt-comment-tooltip {
  background: #1c1c1e;
  color: #fff;
}

body.light .tt-comment-tooltip::after {
  border-color: #1c1c1e transparent transparent transparent;
}

/* Dark theme: light tooltip, shadow */
body.dark .tt-comment-tooltip {
  background: #f0f0f0;
  color: #333;
  box-shadow: 0 0 6px rgba(0,0,0,0.12), 0 6px 32px rgba(0,0,0,0.13);
}

body.dark .tt-comment-tooltip::after {
  border-color: #f0f0f0 transparent transparent transparent;
}
/* ==== END Tooltip Styles ==== */













/* ===========================
   Comment Modal Styles Popup of Table Cell Notes For Added Table
   =========================== */

/* Comment modal container: size, layout, padding, and positioning */
.tt-comment-modal.accessibility-popup {
  min-width: 260px;
  max-width: 340px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 16px 16px 16px;
  box-sizing: border-box;
  position: absolute;
  z-index: 10000001;
}

/* Modal action buttons container: layout and spacing */
.tt-comment-modal .popup-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Reset default styles on modal labels, buttons, and textarea for custom styling */
.tt-comment-modal label,
.tt-comment-modal .tt-modal-actions,
.tt-comment-modal textarea {
  all: unset;
}

/* Textarea input styling inside modal: size, font, colors, and transitions */
.tt-comment-modal .data-input {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  font-size: 15px;
  font-family: inherit;
  border-radius: 7px;
  border: 1px solid var(--input-border, #d9d9e3);
  background: var(--input-bg, #fff);
  color: var(--input-color, #222);
  padding: 8px 11px;
  outline: none;
  box-sizing: border-box;
  margin-top: 0;
  margin-bottom: 0;
  transition: border 0.16s, background 0.16s;
  flex: 1 1 auto;
  height: 100%;
}

/* Dark mode styling for textarea input */
@media (prefers-color-scheme: dark) {
  .tt-comment-modal .data-input {
    background: var(--input-bg, #232429);
    color: #ffe066;
    border: 1px solid var(--input-border, #393943);
  }
}
/* ==== END Comment Modal Styles ==== */










/* ===============================================
   Custom Table Theme Styles - Actual Table
   =============================================== */

/* Light theme custom table: background, border, shadow, and text color */
body.light .custom-theme-table {
  background: #f6f7fa;
  color: #000000;
  border: 1px solid #cfcfd8;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.03);
  overflow: hidden;
  min-width: max-content;
  width: auto;
}

/* Light theme table cells: background, border, and text color */
body.light .custom-theme-table td {
  background: #f6f7fa;
  color: #000000;
  border: 1px solid #cfcfd8;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Light theme table rows background */
body.light .custom-theme-table tr {
  background: #f6f7fa;
}

/* Focus state for table cells in light theme: highlight with blue background and border */
body.light .custom-theme-table td:focus {
  background: #f2f8ff;
  border-color: #2976ff;
}

/* Dark theme custom table: background, border, shadow, and text color */
body.dark .custom-theme-table {
  background:  #090909;
  color: #ffffff;
  border: 1px solid #262631;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.03);
  overflow: hidden;
  min-width: max-content;
  width: auto;
}

/* Dark theme table cells: background, border, and text color */
body.dark .custom-theme-table td {
  background:  #090909;
  color: #ffffff;
  border: 1px solid #262631;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Dark theme table rows background */
body.dark .custom-theme-table tr {
  background:  #090909;
}

/* Focus state for table cells in dark theme: darker blue background and blue border */
body.dark .custom-theme-table td:focus {
  background: #223875;
  border-color: #2976ff;
}
/* ==== END Custom Table Theme Styles ==== */





