/* ============================================
   Translation Viewer - Elegant Split Panel UI
   ============================================ */

/* Base page layout */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-y: auto;
    font-size: 15px;
}

body.viewer-body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.viewer-body .viewer-app {
    flex: 1;
    min-height: 0;
    height: auto !important;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar-link {
    display: block;
    padding: 12px 20px;
    color: #dee2e6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: #0d6efd;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

/* ============================================
   Viewer Navbar
   ============================================ */
.viewer-navbar {
    background: #212529;
    border-bottom: 1px solid #343a40;
}

.vn-row {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    gap: 6px;
    min-height: 40px;
}

.vn-row + .vn-row {
    padding-top: 0;
    border-top: 1px solid #343a40;
}

/* Buttons */
.vn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: #adb5bd;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.vn-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.vn-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.vn-btn:disabled:hover {
    background: transparent;
    color: #adb5bd;
}

.vn-btn i {
    font-size: 1rem;
}

/* Brand */
.vn-brand {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 8px;
    gap: 6px;
    white-space: nowrap;
}

.vn-brand:hover { color: #fff; }

.vn-brand i { font-size: 1.1rem; }

/* Center nav group */
.vn-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Year select – native (mobile fallback) */
.vn-select {
    background: #343a40;
    color: #e9ecef;
    border: 1px solid #495057;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    width: auto;
    min-width: 80px;
}

.vn-select:focus {
    border-color: #0d6efd;
}

/* Year picker – custom searchable dropdown */
.vn-year-picker {
    position: relative;
}

.vn-year-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #343a40;
    color: #e9ecef;
    border: 1px solid #495057;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.4;
}

.vn-year-btn:hover {
    border-color: #6c757d;
    background: #3d4349;
}

.vn-year-picker.open .vn-year-btn {
    border-color: #0d6efd;
    background: #2c3034;
}

.vn-year-chevron {
    font-size: 0.65rem;
    opacity: 0.6;
    transition: transform 0.2s;
}

.vn-year-picker.open .vn-year-chevron {
    transform: rotate(180deg);
}

.vn-year-value {
    font-weight: 500;
}

.vn-year-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: #2c3034;
    border: 1px solid #495057;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1060;
    overflow: hidden;
}

.vn-year-picker.open .vn-year-dropdown {
    display: block;
}

.vn-year-search-wrap {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #495057;
    gap: 6px;
}

.vn-year-search-wrap i {
    color: #6c757d;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.vn-year-search {
    flex: 1;
    background: transparent;
    border: none;
    color: #e9ecef;
    font-size: 0.82rem;
    outline: none;
    min-width: 0;
}

.vn-year-search::placeholder {
    color: #6c757d;
}

.vn-year-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.vn-year-list::-webkit-scrollbar { width: 6px; }
.vn-year-list::-webkit-scrollbar-track { background: transparent; }
.vn-year-list::-webkit-scrollbar-thumb { background: #495057; border-radius: 3px; }

.vn-year-option {
    display: block;
    width: 100%;
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: #adb5bd;
    font-size: 0.84rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.vn-year-option:hover {
    background: rgba(13, 110, 253, 0.15);
    color: #fff;
}

.vn-year-option.active {
    color: #0d6efd;
    font-weight: 600;
    background: rgba(13, 110, 253, 0.08);
}

.vn-year-option.d-none {
    display: none !important;
}

.vn-year-empty {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 0.82rem;
}

/* Page navigation group */
.vn-page-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.vn-page-input {
    display: flex;
    align-items: center;
    background: #343a40;
    border: 1px solid #495057;
    border-radius: 6px;
    overflow: hidden;
}

.vn-page-input input {
    width: 42px;
    background: transparent;
    border: none;
    color: #e9ecef;
    text-align: center;
    font-size: 0.82rem;
    padding: 3px 2px;
    outline: none;
    -moz-appearance: textfield;
}

.vn-page-input input::-webkit-inner-spin-button,
.vn-page-input input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vn-page-max {
    padding: 3px 8px 3px 4px;
    background: #495057;
    color: #adb5bd;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* Search group */
.vn-search-group {
    display: flex;
    align-items: center;
    background: #343a40;
    border: 1px solid #495057;
    border-radius: 6px;
    overflow: hidden;
    max-width: 280px;
}

.vn-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e9ecef;
    padding: 4px 10px;
    font-size: 0.82rem;
    outline: none;
    min-width: 0;
}

.vn-search-input::placeholder { color: #6c757d; }

.vn-search-group .vn-btn {
    border-radius: 0;
    padding: 4px 8px;
}

/* Search scope toggle */
.search-scope-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px !important;
    border-left: 1px solid #495057;
    color: #adb5bd;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.search-scope-btn:hover {
    color: #e9ecef;
    background: rgba(255, 255, 255, 0.08);
}

.search-scope-btn.scope-all {
    color: #69b3ff;
    background: rgba(13, 110, 253, 0.15);
}

/* Panel toggles */
.vn-toggles {
    display: flex;
    align-items: center;
    gap: 4px;
    border-left: 1px solid #495057;
    padding-left: 8px;
    margin-left: 4px;
}

.vn-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #6c757d;
    font-size: 0.78rem;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    margin: 0;
    user-select: none;
}

.vn-toggle:hover { color: #adb5bd; }

.vn-toggle input { display: none; }

.vn-toggle:has(input:checked) {
    color: #e9ecef;
    background: rgba(13, 110, 253, 0.2);
}

.vn-toggle:has(input:checked) span::before {
    content: '✓ ';
    font-size: 0.7rem;
}

/* Right side */
.vn-right {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

/* User button */
.vn-user-btn {
    gap: 4px;
}

/* Register button accent */
.vn-register-btn {
    color: #75b798;
}

.vn-register-btn:hover {
    background: rgba(25, 135, 84, 0.2);
    color: #a3cfbb;
}

/* ============================================
   Viewer App & Split Panels
   ============================================ */
.viewer-app {
    height: 100vh;
    overflow: hidden;
}

#panelContainer {
    display: flex;
    height: 100%;
}

.split-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 0;
    height: 100%;
    background: #ffffff;
    border-right: 1px solid #dee2e6;
    transition: flex 0.3s ease, min-width 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.split-panel:last-child { border-right: none; }

.split-panel.collapsed {
    flex: 0 0 0px !important;
    min-width: 0 !important;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    border: none;
}

.split-panel.collapsed + .panel-resizer { display: none; }

.panel-header {
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    user-select: none;
}

.panel-header h6 {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #ffffff;
}

.panel-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.panel-content p {
    margin: 0;
    line-height: 1.7;
    color: #212529;
    font-size: 0.95rem;
}

/* ---- Panel Resizer ---- */
.panel-resizer {
    flex: 0 0 6px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 10;
    transition: background-color 0.2s;
}

.panel-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: #ced4da;
    border-radius: 2px;
    transition: height 0.2s, background-color 0.2s;
}

.panel-resizer:hover { background: rgba(13, 110, 253, 0.05); }
.panel-resizer:hover::after { height: 60px; background: #0d6efd; }
.panel-resizer.active { background: rgba(13, 110, 253, 0.1); }
.panel-resizer.active::after { height: 100%; background: #0d6efd; }

body.resizing { user-select: none !important; cursor: col-resize !important; }
body.resizing * { user-select: none !important; }

/* ---- Panel Collapse Button ---- */
.panel-collapse-btn {
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.panel-header:hover .panel-collapse-btn { opacity: 1; }

/* ---- Custom Scrollbar ---- */
.panel-content::-webkit-scrollbar { width: 8px; }
.panel-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.panel-content::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
.panel-content::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ============================================
   Search Results
   ============================================ */
#searchResults {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    padding-top: 60px;
}

#searchResults:not(.d-none) { display: flex !important; }

.search-results-panel {
    width: 600px;
    max-width: 90vw;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-self: flex-start;
}

.search-results-list { overflow-y: auto; flex: 1; }

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-result-item:hover { background: #f0f4ff; }

.search-result-item .result-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 4px;
}

.search-result-item .result-snippet {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-item .result-snippet mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================================
   Mobile Tab Bar
   ============================================ */
.mobile-tab-bar {
    display: flex;
    background: #2c3034;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-bottom: 3px solid transparent;
}

.mobile-tab:hover {
    color: #adb5bd;
    background: rgba(255,255,255,0.03);
}

.mobile-tab.active {
    color: #fff;
    background: rgba(13, 110, 253, 0.1);
    border-bottom-color: #0d6efd;
}

.mobile-tab i {
    display: block;
    font-size: 1rem;
    margin-bottom: 1px;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 767.98px) {

    body.viewer-body {
        height: 100vh;
        overflow: hidden;
    }

    body.viewer-body .viewer-app {
        height: 100vh !important;
        min-height: 0;
    }

    /* Navbar compact */
    .vn-brand-text { display: none; }

    .vn-row {
        padding: 3px 6px;
        gap: 4px;
        min-height: 36px;
    }

    .vn-btn {
        padding: 4px 6px;
        font-size: 0.8rem;
    }

    .vn-mobile-row {
        border-top: 1px solid #343a40;
        padding-top: 3px;
    }

    .vn-search-row {
        border-top: 1px solid #343a40;
        padding: 4px 6px;
    }

    .vn-search-group {
        max-width: none;
    }

    .vn-page-input input { width: 36px; }

    /* Panel layout */
    #panelContainer {
        flex-direction: column;
        min-height: 0;
        flex: 1 1 0%;
    }

    .panel-resizer { display: none !important; }

    .split-panel {
        display: none;
        flex: none !important;
        width: 100%;
        height: auto;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        transition: none;
    }

    .split-panel.mobile-active {
        display: flex !important;
        flex: 1 1 0% !important;
        min-height: 0;
        height: 0;
        overflow: hidden;
    }

    .split-panel.collapsed { display: none; opacity: 1; }
    .split-panel.collapsed.mobile-active { display: flex !important; }

    .split-panel .panel-content {
        flex: 1 1 0%;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .panel-collapse-btn { display: none; }

    /* Search results full width */
    .search-results-panel {
        width: 100%;
        max-width: 100vw;
        max-height: 60vh;
        border-radius: 0 0 12px 12px;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .mobile-tab {
        padding: 7px 4px;
        font-size: 0.75rem;
    }

    .vn-page-input input { width: 30px; font-size: 0.78rem; }
    .vn-page-max { font-size: 0.72rem; padding: 3px 4px 3px 2px; }
    .vn-year-btn { font-size: 0.78rem; padding: 3px 6px; }
    .vn-btn { padding: 3px 5px; }
}

/* ============================================
   Data Table Enhancement
   ============================================ */
.dt-wrapper {
    width: 100%;
}

.dt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #495057;
}

.dt-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dt-search {
    position: relative;
    display: flex;
    align-items: center;
}

.dt-search-icon {
    position: absolute;
    left: 10px;
    color: #6c757d;
    font-size: 0.85rem;
    pointer-events: none;
}

.dt-search-input {
    background: #2c3034;
    border: 1px solid #495057;
    border-radius: 6px;
    color: #e9ecef;
    padding: 5px 10px 5px 32px;
    font-size: 0.85rem;
    width: 220px;
    outline: none;
    transition: border-color 0.15s;
}

.dt-search-input:focus {
    border-color: #0d6efd;
}

.dt-search-input::placeholder {
    color: #6c757d;
}

.dt-length {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #adb5bd;
    font-size: 0.82rem;
}

.dt-length-select {
    background: #2c3034;
    border: 1px solid #495057;
    border-radius: 6px;
    color: #e9ecef;
    padding: 4px 8px;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}

.dt-length-select:focus {
    border-color: #0d6efd;
}

.dt-info {
    color: #6c757d;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Sortable headers */
th.dt-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    white-space: nowrap;
}

th.dt-sortable:hover {
    color: #0d6efd !important;
}

.dt-sort-icon {
    font-size: 0.7rem;
    opacity: 0.4;
    margin-left: 4px;
    transition: opacity 0.15s;
}

th.dt-sortable:hover .dt-sort-icon {
    opacity: 0.8;
}

th.dt-sort-asc .dt-sort-icon,
th.dt-sort-desc .dt-sort-icon {
    opacity: 1;
    color: #0d6efd;
}

/* Pagination footer */
.dt-footer {
    display: flex;
    justify-content: center;
    padding: 10px 16px;
    border-top: 1px solid #495057;
}

.dt-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dt-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #495057;
    border-radius: 6px;
    color: #adb5bd;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dt-page-btn:hover:not(:disabled) {
    background: rgba(13, 110, 253, 0.15);
    border-color: #0d6efd;
    color: #fff;
}

.dt-page-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 600;
}

.dt-page-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.dt-ellipsis {
    color: #6c757d;
    padding: 0 4px;
    font-size: 0.85rem;
}

/* Mobile adjustments for data tables */
@media (max-width: 767.98px) {
    .dt-controls {
        padding: 8px 12px;
        gap: 8px;
    }

    .dt-search-input {
        width: 160px;
    }

    .dt-left {
        gap: 10px;
    }

    /* Responsive table scroll */
    .dt-wrapper .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .dt-search-input {
        width: 130px;
        font-size: 0.8rem;
    }

    .dt-length {
        font-size: 0.78rem;
    }
}

/* ============================================
   Toast / Alert
   ============================================ */
.viewer-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    min-width: 250px;
}

/* ============================================
   Auth Cards
   ============================================ */
.auth-shell {
    max-width: 720px;
}

.auth-card {
    max-width: 520px;
    background: linear-gradient(165deg, #1f2937 0%, #111827 100%);
    border: 1px solid #374151;
    color: #e5e7eb;
    border-radius: 14px;
}

.auth-card-header {
    border-bottom: 1px solid #374151;
    background: rgba(255, 255, 255, 0.02);
    color: #f8fafc;
}

.auth-input {
    background-color: #111827;
    color: #e5e7eb;
    border-color: #4b5563;
}

.auth-input:focus {
    background-color: #111827;
    color: #f8fafc;
    border-color: #3b82f6;
}

.auth-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #4b5563;
    background: #ffffff;
    padding: 4px;
}

/* ============================================
   Markdown rendered content
   ============================================ */
.markdown-content {
    line-height: 1.7;
    word-wrap: break-word;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.markdown-content p {
    margin-bottom: 0.75em;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5em;
    margin-bottom: 0.75em;
}

.markdown-content blockquote {
    border-left: 4px solid #6c757d;
    padding: 0.5em 1em;
    margin: 0.75em 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.markdown-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #1a1a2e;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid #495057;
    padding: 0.5em 0.75em;
}

.markdown-content table th {
    background: rgba(255, 255, 255, 0.08);
}

.markdown-content hr {
    border-color: #495057;
    margin: 1em 0;
}

.markdown-content a {
    color: #6ea8fe;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ============================================
   EasyMDE Dark Theme Overrides
   ============================================ */
.EasyMDEContainer .CodeMirror {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #495057 !important;
}

.EasyMDEContainer .CodeMirror-cursor {
    border-left-color: #e0e0e0 !important;
}

.EasyMDEContainer .CodeMirror-selected {
    background: rgba(100, 150, 255, 0.25) !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-header {
    color: #6ea8fe !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-link {
    color: #6ea8fe !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-url {
    color: #8bc34a !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-string {
    color: #ffc107 !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-comment {
    color: #6c757d !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-tag {
    color: #ff6b6b !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-attribute {
    color: #6ea8fe !important;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-strong {
    color: #fff !important;
    font-weight: bold;
}

.EasyMDEContainer .CodeMirror .CodeMirror-code .cm-em {
    color: #ddd !important;
    font-style: italic;
}

.EasyMDEContainer .editor-toolbar {
    background: #2b2b3d !important;
    border-color: #495057 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 4px 6px !important;
    gap: 0 !important;
}

.EasyMDEContainer .editor-toolbar button {
    color: #dee2e6 !important;
    width: auto !important;
    padding: 4px 7px !important;
    margin: 0 !important;
    flex-shrink: 0;
    box-sizing: border-box;
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #6c757d !important;
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left-color: #495057 !important;
    border-right-color: #495057 !important;
    margin: 0 4px !important;
    flex-shrink: 0;
}

/* Hide toolbar scrollbar but keep scrollable */
.EasyMDEContainer .editor-toolbar::-webkit-scrollbar {
    height: 0;
}

.EasyMDEContainer .editor-toolbar {
    scrollbar-width: none;
}

/* Disable EasyMDE clearfix that causes row wrapping */
.EasyMDEContainer .editor-toolbar::before,
.EasyMDEContainer .editor-toolbar::after {
    display: none !important;
}

.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
    background: #212529 !important;
    color: #e0e0e0 !important;
}

/* Inline preview: stay within the container, don't go fullscreen */
.EasyMDEContainer .editor-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1;
}

/* Inline side-by-side: contained within the editor area */
.EasyMDEContainer .editor-preview-side {
    border-color: #495057 !important;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    overflow-y: auto;
    z-index: 1;
}

/* Make sure the CodeMirror wrapper is relative so previews position inside it */
.EasyMDEContainer .CodeMirror {
    position: relative !important;
}

/* Fullscreen mode – proper dark styling and always-visible toolbar */
.EasyMDEContainer.fullscreen {
    z-index: 9999 !important;
}

.EasyMDEContainer .editor-toolbar.fullscreen {
    background: #2b2b3d !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
}

.EasyMDEContainer .CodeMirror-fullscreen {
    background: #1a1a2e !important;
    z-index: 9999 !important;
}

.EasyMDEContainer .editor-preview.editor-preview-active-side.fullscreen,
.EasyMDEContainer .editor-preview-side.editor-preview-active-side {
    background: #212529 !important;
    color: #e0e0e0 !important;
}

.EasyMDEContainer .editor-statusbar {
    color: #6c757d !important;
}

.EasyMDEContainer .CodeMirror-gutters {
    background: #1a1a2e !important;
    border-right-color: #495057 !important;
}

.EasyMDEContainer .CodeMirror-linenumber {
    color: #6c757d !important;
}

/* Editor preview markdown styles */
.EasyMDEContainer .editor-preview blockquote,
.EasyMDEContainer .editor-preview-side blockquote {
    border-left: 4px solid #6c757d;
    padding: 0.5em 1em;
    background: rgba(255, 255, 255, 0.05);
}

.EasyMDEContainer .editor-preview table th,
.EasyMDEContainer .editor-preview table td,
.EasyMDEContainer .editor-preview-side table th,
.EasyMDEContainer .editor-preview-side table td {
    border: 1px solid #495057;
    padding: 0.4em 0.6em;
}

.EasyMDEContainer .editor-preview code,
.EasyMDEContainer .editor-preview-side code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.EasyMDEContainer .editor-preview pre,
.EasyMDEContainer .editor-preview-side pre {
    background: #1a1a2e;
    padding: 1em;
    border-radius: 6px;
}

.EasyMDEContainer .editor-preview a,
.EasyMDEContainer .editor-preview-side a {
    color: #6ea8fe;
}

