/* ============================================================
   MARKDOWN TÁBLÁZATOK — 5 színséma (modosit_97.py)
   ============================================================
   A Markdown szerkesztőben választható 5 színséma.
   A táblázat osztálya: md-table-schema-1 … md-table-schema-5.
   ============================================================ */

/* Alap (nincs séma) */
.md-table {
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 0.9em;
  max-width: 100%;
}
.md-table th,
.md-table td {
  border: 1px solid #cbd5e1;
  padding: 5px 12px;
}
.md-table th {
  background: #f1f5f9;
  font-weight: 600;
}
.md-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

/* 1. Indigo (alap) – #4f46e5 */
.markdown-preview .md-table.md-table-schema-1 th {
  background: #eef2ff !important;
  color: #3730a3 !important;
  border-color: #c7d2fe !important;
}
.markdown-preview .md-table.md-table-schema-1 td {
  border-color: #e0e7ff !important;
}
.markdown-preview .md-table.md-table-schema-1 tbody tr:nth-child(even) {
  background: #f5f3ff !important;
}

/* 2. Zöld – #059669 */
.markdown-preview .md-table.md-table-schema-2 th {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}
.markdown-preview .md-table.md-table-schema-2 td {
  border-color: #d1fae5 !important;
}
.markdown-preview .md-table.md-table-schema-2 tbody tr:nth-child(even) {
  background: #ecfdf5 !important;
}

/* 3. Borostyán – #d97706 */
.markdown-preview .md-table.md-table-schema-3 th {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}
.markdown-preview .md-table.md-table-schema-3 td {
  border-color: #fef3c7 !important;
}
.markdown-preview .md-table.md-table-schema-3 tbody tr:nth-child(even) {
  background: #fffbeb !important;
}

/* 4. Cián – #0891b2 */
.markdown-preview .md-table.md-table-schema-4 th {
  background: #cffafe !important;
  color: #155e75 !important;
  border-color: #a5f3fc !important;
}
.markdown-preview .md-table.md-table-schema-4 td {
  border-color: #cffafe !important;
}
.markdown-preview .md-table.md-table-schema-4 tbody tr:nth-child(even) {
  background: #ecfeff !important;
}

/* 5. Szürke – #64748b */
.markdown-preview .md-table.md-table-schema-5 th {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
.markdown-preview .md-table.md-table-schema-5 td {
  border-color: #e2e8f0 !important;
}
.markdown-preview .md-table.md-table-schema-5 tbody tr:nth-child(even) {
  background: #f1f5f9 !important;
}


/* ============================================================
   MARKDOWN TÁBLÁZAT SÉMA-NÉGYZETEK (modosit_98.py)
   ============================================================ */

.md-schema-swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  margin: 0 2px;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
  vertical-align: middle;
}

.md-schema-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

.md-schema-swatch.active {
  border-color: #1e293b;
  box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.3);
}


/* ============================================================
   MD-TABLE-SCHEMA-SELECT (modosit_99.py)
   ============================================================ */

#mdTableSchemaSelect {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
  min-width: 140px;
  transition: border-color 0.12s;
}

#mdTableSchemaSelect:hover {
  border-color: #94a3b8;
}

#mdTableSchemaSelect:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}


/* A #mdEditorPreview séma-szabályai (modosit_107.py) */

#mdEditorPreview .md-table.md-table-schema-1 th {
  background: #eef2ff !important;
  color: #3730a3 !important;
  border-color: #c7d2fe !important;
}
#mdEditorPreview .md-table.md-table-schema-1 td {
  border-color: #e0e7ff !important;
}
#mdEditorPreview .md-table.md-table-schema-1 tbody tr:nth-child(even) {
  background: #f5f3ff !important;
}

#mdEditorPreview .md-table.md-table-schema-2 th {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}
#mdEditorPreview .md-table.md-table-schema-2 td {
  border-color: #d1fae5 !important;
}
#mdEditorPreview .md-table.md-table-schema-2 tbody tr:nth-child(even) {
  background: #ecfdf5 !important;
}

#mdEditorPreview .md-table.md-table-schema-3 th {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}
#mdEditorPreview .md-table.md-table-schema-3 td {
  border-color: #fef3c7 !important;
}
#mdEditorPreview .md-table.md-table-schema-3 tbody tr:nth-child(even) {
  background: #fffbeb !important;
}

#mdEditorPreview .md-table.md-table-schema-4 th {
  background: #cffafe !important;
  color: #155e75 !important;
  border-color: #a5f3fc !important;
}
#mdEditorPreview .md-table.md-table-schema-4 td {
  border-color: #cffafe !important;
}
#mdEditorPreview .md-table.md-table-schema-4 tbody tr:nth-child(even) {
  background: #ecfeff !important;
}

#mdEditorPreview .md-table.md-table-schema-5 th {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
#mdEditorPreview .md-table.md-table-schema-5 td {
  border-color: #e2e8f0 !important;
}
#mdEditorPreview .md-table.md-table-schema-5 tbody tr:nth-child(even) {
  background: #f1f5f9 !important;
}


/* ============================================================
   Egyedi színséma-választó (modosit_133.py)
   ============================================================ */

.md-schema-dropdown {
  position: relative;
  display: inline-block;
}

.md-schema-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: auto;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: border-color 0.12s;
  box-sizing: border-box;
  font-size: 0.82rem;
  line-height: 1;
}

.md-schema-current:hover {
  border-color: #94a3b8;
}

.md-schema-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}

.md-schema-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 4px;
  z-index: 1000;
  min-width: 44px;
}

.md-schema-menu.show {
  display: block;
}

.md-schema-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s;
}

.md-schema-item:hover {
  background: #f1f5f9;
}

.md-schema-item.active {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.md-schema-item .md-schema-dot {
  width: 20px;
  height: 20px;
}


/* ============================================================
   A Markdown toolbar gombjai azonos magasságúak (modosit_136.py)
   ============================================================
   A .md-toolbar-btn fix magasságú (32px), hogy a szöveges
   gombok (Táblázat, Kép) és az ikonos gombok (H1, B, I, stb.)
   egyaránt 32px magasak legyenek.
   ============================================================ */

.md-toolbar-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.md-toolbar-btn.bold {
  font-weight: 700;
}

.md-toolbar-btn.italic {
  font-style: italic;
}

/* A táblázat és kép gombok szövegének betűmérete kisebb,
   hogy ne feszítsék szét a gombot. */
.md-table-picker-wrap > .md-toolbar-btn,
.md-table-picker-wrap > .md-toolbar-btn + .md-toolbar-btn {
  font-size: 0.78rem !important;
  padding: 0 6px !important;
}

/* A színséma gomb is 32px magas. */
.md-schema-current {
  height: 32px !important;
  min-height: 32px !important;
  width: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}


/* ============================================================
   A toolbar wrapper-ek és gombok igazítása (modosit_137.py)
   ============================================================
   A md-table-picker-wrap és md-link-popup-wrap 32px magas,
   display: inline-flex, align-items: center, hogy a benne
   lévő gombok ne csússzanak lefelé.
   ============================================================ */

.md-table-picker-wrap,
.md-link-popup-wrap {
  display: inline-flex !important;
  align-items: center !important;
  height: 32px !important;
  min-height: 32px !important;
  vertical-align: middle !important;
  position: relative !important;
}

/* A wrapper-en belüli gombok is 32px magasak. */
.md-table-picker-wrap > .md-toolbar-btn,
.md-link-popup-wrap > .md-toolbar-btn {
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
}

/* A táblázat és kép gombok szövegének betűmérete kisebb,
   hogy kiférjen a 32px magas gombon. */
.md-table-picker-wrap > .md-toolbar-btn {
  font-size: 0.78rem !important;
  padding: 0 8px !important;
}

/* A toolbar sorban a többi elem is középre igazítva. */
.md-editor-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
}


/* ============================================================
   KÉP BEÁLLÍTÁSOK POPUP (modosit_147.py)
   ============================================================ */

.image-settings-popup {
  display: none;
  position: fixed;
  z-index: 10002;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2);
  padding: 12px 14px;
  min-width: 340px;
  max-width: 420px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.88rem;
}

.image-settings-popup.show {
  display: block;
}

.image-settings-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 12px;
  color: #1e293b;
}

.image-settings-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.image-settings-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.image-settings-row {
  margin-bottom: 10px;
}

.image-settings-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: #475569;
  margin-bottom: 4px;
}

.image-settings-options {
  display: flex;
  gap: 4px;
}

.image-settings-options button {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: background 0.12s, border-color 0.12s;
  font-family: inherit;
}

.image-settings-options button:hover {
  background: #f8fafc;
}

.image-settings-options button.active {
  background: #eef2ff;
  border-color: #4f46e5;
  color: #4338ca;
}

.image-settings-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  line-height: 1.5;
}
