/* Fix: Dark mode for view toggle buttons */
.dark-mode .view-toggle button {
    background-color: #23272a;
    color: #e0e0e0;
    border: 1px solid #444;
}

.dark-mode .view-toggle button.active {
    background-color: #005a9e;
    color: #fff;
    border-color: #007acc;
}

/* Fix: Dark mode for lists and blockquotes */
.dark-mode .preview-content ul,
.dark-mode .preview-content ol {
    color: #e0e0e0;
}

.dark-mode .preview-content blockquote {
    border-left: 4px solid #4fc3f7;
    background: #1a2633;
    color: #4fc3f7;
}

.dark-mode .preview-content blockquote blockquote {
    border-left-color: #22d3ee;
    background: #162029;
}

/* Fix: Dark mode for preview backgrounds */
.dark-mode .preview-content h1,
.dark-mode .preview-content h2 {
    border-bottom: 1px solid #444;
}

.dark-mode .preview-content th {
    background-color: #23272a;
    color: #e0e0e0;
}

.dark-mode .preview-content td {
    background-color: #101214;
    color: #e0e0e0;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #181a1b;
    color: #e0e0e0;
}

.dark-mode .menu-bar {
    background-color: #23272a;
    color: #e0e0e0;
}

.dark-mode .toolbar {
    background-color: #23272a;
    border-bottom: 1px solid #444;
}

.dark-mode .toolbar-btn {
    background-color: #23272a;
    color: #e0e0e0;
    border-color: #444;
}

.dark-mode .toolbar-btn:hover {
    background-color: #2d3136;
    border-color: #666;
}

.dark-mode .toolbar-btn.active {
    background-color: #005a9e;
    color: #fff;
    border-color: #007acc;
}

.dark-mode .main-container {
    background-color: #181a1b;
}

.dark-mode .editor-textarea {
    background-color: #101214;
    color: #e0e0e0;
    border: none;
}

.dark-mode .preview-content {
    background-color: #101214;
    color: #e0e0e0;
    border-left: 1px solid #444;
}

.dark-mode .pane-header {
    background-color: #181b1d;
    color: #b0b0b0;
    border-bottom: 1px solid #444;
}

.dark-mode .splitter {
    background-color: #444;
}

.dark-mode .splitter:hover {
    background-color: #005a9e;
}

.dark-mode .status-bar {
    background-color: #23272a;
    color: #e0e0e0;
    border-top: 1px solid #444;
}

.dark-mode .preview-content pre {
    background-color: #101214;
    border: 1px solid #444;
    color: #e0e0e0;
}

.dark-mode .preview-content code {
    background-color: #1a1d1f;
    color: #e0e0e0;
    border: 1px solid #333;
}

.dark-mode .preview-content th,
.dark-mode .preview-content td {
    border: 1px solid #444;
}

.dark-mode .preview-content th {
    background-color: #1e2225;
    color: #e0e0e0;
}

.dark-mode .preview-content hr {
    border-top: 1px solid #444;
}

/* Dark mode custom checkbox */
.dark-mode .preview-content li.task-item input[type="checkbox"] {
    border-color: #555;
    background: #101214;
}

.dark-mode .preview-content li.task-item input[type="checkbox"]:checked {
    background: #005a9e;
    border-color: #005a9e;
}

.dark-mode .preview-content li.task-item input[type="checkbox"]:focus-visible {
    outline: 2px solid #3399ff;
}

/* Dark mode dialog and overlay styles */
.dark-mode #find-replace-bar {
    background: #181a1b;
    border-color: #444;
    color: #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.dark-mode #find-replace-bar input {
    background: #101214;
    color: #e0e0e0;
    border: 1px solid #444;
}

.dark-mode #find-replace-bar button {
    background: #23272a;
    color: #e0e0e0;
    border: 1px solid #444;
}

.dark-mode #find-replace-bar button:hover {
    background: #2d3136;
    border-color: #666;
}

.dark-mode #link-image-dialog {
    background: #181a1b;
    border-color: #444;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode #link-image-dialog input {
    background: #101214;
    color: #e0e0e0;
    border: 1px solid #444;
}

.dark-mode #link-image-dialog button {
    background: #23272a;
    color: #e0e0e0;
    border: 1px solid #444;
    transition: all 0.2s;
}

.dark-mode #link-image-dialog button:hover {
    background: #2d3136;
    border-color: #666;
}

.dark-mode #custom-alert {
    background: #181a1b;
    border-color: #444;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode #custom-alert button {
    background: #23272a;
    color: #e0e0e0;
    border: 1px solid #444;
    transition: all 0.2s;
}

.dark-mode #custom-alert button:hover {
    background: #2d3136;
    border-color: #666;
}

.dark-mode #popup-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/*
 * Styles for Markdown Editor
 * Extracted from markdown_editor.html for better maintainability
 */

@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.menu-bar {
    background-color: #2d2d2d;
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.menu-item {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #404040;
}

.toolbar {
    background-color: #e0e0e0;
    border-bottom: 1px solid #ccc;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 4px;
    padding-right: 12px;
    border-right: 1px solid #ccc;
}

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

.toolbar-btn {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn:hover {
    background-color: #e8e8e8;
    border-color: #999;
}

.toolbar-btn:active {
    background-color: #d0d0d0;
}

.toolbar-btn.active {
    background-color: #007acc;
    color: white;
    border-color: #005a9e;
}

.toolbar-btn .material-symbols-outlined {
    font-size: 18px;
}

.toolbar-btn.icon-only {
    padding: 6px;
    justify-content: center;
}

.font-select,
.font-size {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    background-color: white;
}

.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-pane,
.preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 12px;
    color: #666;
}

.editor-textarea {
    flex: 1;
    border: none;
    outline: none;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    background-color: white;
}

.preview-content {
    flex: 1;
    padding: 20px;
    background-color: white;
    overflow-y: auto;
    border-left: 1px solid #ddd;
}

.splitter {
    width: 4px;
    background-color: #ddd;
    cursor: col-resize;
    position: relative;
}

.splitter:hover {
    background-color: #007acc;
}

.status-bar {
    background-color: #007acc;
    color: white;
    padding: 4px 16px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    line-height: 1.2;
}

.preview-content h1 {
    font-size: 2em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.preview-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.preview-content h3 {
    font-size: 1.3em;
}

.preview-content h4 {
    font-size: 1.1em;
}

.preview-content h5 {
    font-size: 1em;
}

.preview-content h6 {
    font-size: 0.9em;
}

.preview-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.preview-content li {
    margin-bottom: 5px;
}

.preview-content code {
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    -webkit-text-fill-color: initial;
    color: #222;
}

.preview-content a {
    color: #005a9e;
    text-decoration: underline;
}

.preview-content a:hover {
    color: #003f6e;
}

.preview-content img {
    max-width: 100%;
    height: auto;
}

.dark-mode .preview-content code {
    color: #e0e0e0;
    -webkit-text-fill-color: initial;
}

.dark-mode .preview-content a {
    color: #4fc3f7;
}

.dark-mode .preview-content a:hover {
    color: #22d3ee;
}

.preview-content pre {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.preview-content hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 16px 0;
}

.preview-content pre code {
    background-color: transparent;
    padding: 0;
}

.preview-content blockquote {
    border-left: 4px solid #007acc;
    background: #eaf6fb;
    padding: 10px 20px;
    margin: 15px 0;
    color: #005a9e;
    font-family: inherit;
}

.preview-content blockquote blockquote {
    border-left-color: #7dd3fc;
    background: #f0f9ff;
    margin-top: 10px;
    margin-bottom: 10px;
}

.hidden-file-input {
    display: none;
}




/* Sub/Sup baseline tweaks */

.view-toggle {
    display: flex;
    gap: 2px;
}

.view-toggle button {
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
}

.view-toggle button.active {
    background-color: #007acc;
    color: white;
}

.single-pane .editor-pane,
.single-pane .preview-pane {
    flex: 1;
}

.single-pane .splitter {
    display: none;
}

.editor-only .preview-pane,
.preview-only .editor-pane {
    display: none;
}

/* ============================================
   MENU DROPDOWNS
   ============================================ */
.menu-bar {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
}

.menu-item {
    position: relative;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    font-weight: 600;
    color: #222;
}

.menu-item:focus {
    outline: 2px solid #007acc;
}

.menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.menu-item .menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    z-index: 1002;
    border-radius: 6px;
    padding: 6px 0;
}

.menu-item.open .menu-dropdown {
    display: block;
}

.menu-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #111;
}

.menu-dropdown-item:hover {
    background: #f3f6fb;
}

.menu-divider {
    height: 1px;
    background: #e6e6e6;
    margin: 6px 0;
}

body.dark-mode .menu-item {
    color: #e0e0e0;
}

body.dark-mode .menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .menu-item .menu-dropdown {
    background: #222;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .menu-dropdown-item:hover {
    background: #2a2c2d;
    color: #fff;
}

body.dark-mode .menu-dropdown-item {
    color: #e0e0e0;
}

.menu-build {
    margin-left: auto;
    font-size: 12px;
    color: #666;
    align-self: center;
    padding: 6px 8px;
    border-radius: 4px;
    background: transparent;
}

.menu-build:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .menu-build {
    color: #999;
}

/* ============================================
   FIND/REPLACE BAR - FIXED UI ISSUES
   ============================================ */
.find-replace-bar {
    position: fixed;
    left: 50%;
    right: auto;
    top: 70px;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 1003;
    min-width: 520px;
    max-width: calc(100% - 40px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    border-radius: 6px;
}

.find-replace-bar .fr-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.find-replace-bar .fr-input {
    flex: 1;
    min-width: 120px;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.find-replace-bar .fr-btn {
    padding: 7px 12px;
    min-height: 32px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
}

.find-replace-bar .fr-btn:hover {
    background: #e8e8e8;
}

.find-replace-bar .fr-close {
    padding: 6px 10px;
    min-height: 32px;
    border: none;
    background: transparent;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}

.find-replace-bar .fr-close:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.find-replace-bar .fr-count {
    font-size: 12px;
    color: #666;
    min-width: 60px;
    text-align: center;
}

.find-replace-bar .fr-checkbox {
    font-size: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 8px;
    white-space: nowrap;
}

.find-replace-bar .fr-history {
    margin-left: 8px;
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    min-height: 32px;
}

.find-replace-bar .fr-compact-toggle {
    width: 40px;
    min-width: 40px;
}

/* Flag dropdown */
.fr-flag-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 6px;
}

.fr-flag-btn {
    padding: 7px 10px !important;
}

.fr-flag-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 120px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    padding: 8px;
    border-radius: 6px;
    z-index: 1004;
}

.fr-flag-dropdown.open .fr-flag-menu {
    display: block;
}

.fr-flag-menu .fr-checkbox {
    display: block;
    padding: 4px 8px;
    margin: 0;
}

/* Compact mode - FIXED to prevent button clipping */
.find-replace-bar.compact {
    min-width: 360px;
}

.find-replace-bar.compact .fr-row:nth-child(2) {
    display: none;
}

.find-replace-bar.compact .fr-input {
    padding: 6px 8px;
}

/* Dark mode for find/replace */
body.dark-mode .find-replace-bar {
    background: #222;
    border-color: #444;
    color: #ddd;
}

body.dark-mode .find-replace-bar .fr-input {
    background: #2b2b2b;
    color: #eee;
    border-color: #444;
}

body.dark-mode .find-replace-bar .fr-btn {
    background: #333;
    color: #ddd;
    border-color: #444;
}

body.dark-mode .find-replace-bar .fr-btn:hover {
    background: #3d3d3d;
}

body.dark-mode .find-replace-bar .fr-close {
    color: #ddd;
}

body.dark-mode .find-replace-bar .fr-close:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .find-replace-bar label {
    color: #ccc;
}

body.dark-mode .find-replace-bar #match-count {
    color: #bbb;
}

body.dark-mode .find-replace-bar .fr-history {
    background: #2b2b2b;
    color: #eee;
    border-color: #444;
}

body.dark-mode .fr-flag-menu {
    background: #222;
    border-color: #444;
    color: #e0e0e0;
}

/* Match highlighting */
.md-match {
    background: #fffb91;
    color: #111;
    padding: 0 2px;
    border-radius: 2px;
}

.md-match-current {
    background: #ffcf66;
    color: #111;
    padding: 0 2px;
    border-radius: 2px;
}

body.dark-mode .md-match {
    background: #3a3a2a;
    color: #fff;
}

body.dark-mode .md-match-current {
    background: #5a4b1a;
    color: #fff;
}

.find-transition {
    transition: background-color 180ms ease;
}

/* ============================================
   DIALOGS AND POPUPS
   ============================================ */
#popup-overlay {
    transition: background-color 0.3s;
}

body.dark-mode #popup-overlay {
    background: rgba(255, 255, 255, 0.1);
}

/* Link/Image Dialog */
#link-image-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccc;
    padding: 16px;
    z-index: 1000;
    width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}

#link-image-dialog h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
}

#link-image-dialog label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

#link-image-dialog input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#link-image-dialog button {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

#link-image-dialog button:hover {
    background: #e0e0e0;
}

body.dark-mode #link-image-dialog {
    background: #222;
    border-color: #444;
    color: #ddd;
}

body.dark-mode #link-image-dialog input {
    background: #2b2b2b;
    color: #eee;
    border: 1px solid #444;
}

body.dark-mode #link-image-dialog button {
    background: #333;
    color: #ddd;
    border: 1px solid #444;
}

body.dark-mode #link-image-dialog button:hover {
    background: #3d3d3d;
}

/* Custom Alert Dialog */
#custom-alert {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    z-index: 1000;
    width: 450px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    border-radius: 6px;
}

#custom-alert-message {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

#custom-alert button {
    padding: 8px 20px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
}

body.dark-mode #custom-alert {
    background: #222;
    border-color: #444;
    color: #ddd;
}

body.dark-mode #custom-alert button {
    background: #333;
    color: #ddd;
    border: 1px solid #444;
}

body.dark-mode #custom-alert button:hover {
    background: #3d3d3d;
}

/* Help and Changelog Popups */
#help-popup,
#changelog-popup {
    display: none;
    position: fixed;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    height: 90vh;
    z-index: 2000;
    background: #fff;
    border: 2px solid #007acc;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    overflow: hidden;
}

#help-popup-close,
#changelog-popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

#help-popup iframe,
#changelog-popup iframe {
    width: 100%;
    height: calc(100% - 44px);
    border: none;
    background: #fff;
}

body.dark-mode #help-popup,
body.dark-mode #changelog-popup {
    background: #222;
    border-color: #444;
}

body.dark-mode #help-popup iframe,
body.dark-mode #changelog-popup iframe {
    background: #222;
    color: #e0e0e0;
}

/* Color Dialog */
#color-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #ccc;
    padding: 16px;
    z-index: 1000;
    width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
}

#color-dialog h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #000;
}

#color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.color-btn {
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.05);
}

/* Color button specific styles */
.color-btn[data-color="black"] {
    background-color: #000000;
    color: #aaa;
}

.color-btn[data-color="blue"] {
    background-color: #0000aa;
    color: #fff;
}

.color-btn[data-color="green"] {
    background-color: #00aa00;
    color: #fff;
}

.color-btn[data-color="cyan"] {
    background-color: #00aaaa;
    color: #000;
}

.color-btn[data-color="red"] {
    background-color: #aa0000;
    color: #fff;
}

.color-btn[data-color="magenta"] {
    background-color: #aa00aa;
    color: #fff;
}

.color-btn[data-color="brown"] {
    background-color: #aa5500;
    color: #fff;
}

.color-btn[data-color="white"] {
    background-color: #ffffff;
    color: #000;
}

#color-cancel {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #000;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

body.dark-mode #color-dialog {
    background: #222;
    border-color: #444;
    color: #ddd;
}

body.dark-mode #color-dialog h3 {
    color: #ddd;
}

body.dark-mode #color-dialog .color-btn {
    border-color: #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode #color-cancel {
    background: #333;
    color: #ddd;
    border-color: #555;
}

/* Dark mode color variants */
body.dark-mode .color-btn[data-color="black"] {
    background-color: #555555;
    color: #fff;
}

body.dark-mode .color-btn[data-color="blue"] {
    background-color: #5555ff;
    color: #fff;
}

body.dark-mode .color-btn[data-color="green"] {
    background-color: #55ff55;
    color: #000;
}

body.dark-mode .color-btn[data-color="cyan"] {
    background-color: #55ffff;
    color: #000;
}

body.dark-mode .color-btn[data-color="red"] {
    background-color: #ff5555;
    color: #000;
}

body.dark-mode .color-btn[data-color="magenta"] {
    background-color: #ff55ff;
    color: #000;
}

body.dark-mode .color-btn[data-color="brown"] {
    background-color: #ffff55;
    color: #000;
}

body.dark-mode .color-btn[data-color="white"] {
    background-color: #ffffff;
    color: #000;
}

/* Color text styles */
.color-black {
    color: #000000;
}

.color-blue {
    color: #0000aa;
}

.color-green {
    color: #00aa00;
}

.color-cyan {
    color: #00aaaa;
}

.color-red {
    color: #aa0000;
}

.color-magenta {
    color: #aa00aa;
}

.color-brown {
    color: #aa5500;
}

.color-white {
    color: #aaaaaa;
}

body.dark-mode .color-black {
    color: #555555;
}

body.dark-mode .color-blue {
    color: #5555ff;
}

body.dark-mode .color-green {
    color: #55ff55;
}

body.dark-mode .color-cyan {
    color: #55ffff;
}

body.dark-mode .color-red {
    color: #ff5555;
}

body.dark-mode .color-magenta {
    color: #ff55ff;
}

body.dark-mode .color-brown {
    color: #ffff55;
}

body.dark-mode .color-white {
    color: #ffffff;
}

/* ============================================
   IMAGE INFO BADGE
   ============================================ */
.md-img-info-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    max-width: 100%;
}

.md-img-info-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
}

.md-img-info-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: #007acc;
    color: #fff;
    font-size: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    z-index: 2;
    border: 2px solid #fff;
    transition: background 0.2s;
}

.md-img-info-badge:hover {
    background: #005a9e;
}

.dark-mode .md-img-info-badge {
    background: #23272a;
    color: #e0e0e0;
    border: 2px solid #181a1b;
}

.dark-mode .md-img-info-badge:hover {
    background: #005a9e;
    color: #fff;
}