/* ========================================= */
/* EDITOR PAGE STYLES (DASHBOARD)            */
/* ========================================= */
.editor-app.dashboard-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f4f6f8;
    color: #1e293b;
}

[data-theme="dark"],
[data-theme="dark"] .editor-app {
    background: #121212;
    color: #f1f5f9;
}

[data-theme="dark"] .logo-text {
    color: #c9c9c9 !important;
}

/* Dashboard Header */
.dashboard-header {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 60;
    flex-shrink: 0;
}

[data-theme="dark"] .dashboard-header {
    background: #1e1e1e;
    border-bottom-color: #2d2d2d;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
}

.header-left {
    gap: 16px;
    flex: 1;
}

.header-center {
    flex: 2;
    justify-content: center;
}

.header-right {
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

.header-right .login-btn {
    display: none;
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    overflow: hidden;
}

.lang-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .lang-dropdown-menu {
    background: #1e1e1e;
    border-color: #2d2d2d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.lang-dropdown-header {
    padding: 10px 14px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 5px;
}

.lang-dropdown-header span {
    margin-top: 1px;
}

[data-theme="dark"] .lang-dropdown-header {
    color: #64748b;
    border-bottom-color: #2d2d2d;
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 0.85rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.lang-dropdown-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="dark"] .lang-dropdown-item {
    color: #cbd5e1;
}

[data-theme="dark"] .lang-dropdown-item:hover {
    background: #2d2d2d;
    color: #f8fafc;
}

.lang-dropdown-item.active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

[data-theme="dark"] .lang-dropdown-item.active {
    background: rgba(79, 70, 229, 0.15);
    color: #818cf8;
}

.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.lang-name {
    flex: 1;
}

.lang-check {
    color: #4f46e5;
    flex-shrink: 0;
}

[data-theme="dark"] .lang-check {
    color: #818cf8;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .btn-icon:hover {
    background: #2d2d2d;
    color: #f8fafc;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text span:first-child {
    font-size: 0.75rem;
    color: #64748b;
}

.brand-text span:last-child {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
}

[data-theme="dark"] .brand-text span:last-child {
    color: #fff;
}

.search-bar {
    width: 100%;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.875rem;
}

[data-theme="dark"] .search-bar input {
    background: #121212;
    border-color: #2d2d2d;
    color: #fff;
}

.btn-shortcut {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.875rem;
}

[data-theme="dark"] .btn-shortcut {
    background: #1e1e1e;
    border-color: #2d2d2d;
    color: #94a3b8;
}

.kbd-wrap {
    display: flex;
    gap: 4px;
}

.kbd-wrap kbd {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: monospace;
}

[data-theme="dark"] .kbd-wrap kbd {
    background: #121212;
}



/* Dashboard Body */
.dashboard-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}



/* Sidebar */
.dashboard-sidebar {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transform: translateX(0%);
}

@media(max-width: 767.99px) {

    .dashboard-sidebar {
        transform: translateX(-100%);
    }

    .dashboard-sidebar.open {
        transform: translateX(0%);
    }
}

[data-theme="dark"] .dashboard-sidebar {
    background: #1e1e1e;
    border-color: #2d2d2d;
}

.sidebar-top {
    padding: 16px;
    border-bottom: 1px solid transparent;
}

.btn-new-note {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #eef2ff;
    color: #4f46e5;
    padding: 8px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-new-note:hover {
    background: #e0e7ff;
}

[data-theme="dark"] .btn-new-note {
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
}

[data-theme="dark"] .btn-new-note:hover {
    background: rgba(79, 70, 229, 0.3);
}

.sidebar-scrollable {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* overflow-y: auto; */
    padding: 16px 0;
}

/* .sidebar-section {
    margin-bottom: 24px;
} */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
}

.section-header a {
    color: #4f46e5;
}

[data-theme="dark"] .section-header a {
    color: #818cf8;
}

.section-header a:hover {
    text-decoration: underline;
}

.tool-list,
.notes-list {
    list-style: none;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.notes-list {
    max-height: 325px;
    overflow-y: auto;
}

.tool-list li a,
.notes-list .note-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    color: #475569;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.note-item {
    justify-content: space-between;
    padding: 0px !important;
}

.note-item-content {
    width: 75%;
    display: flex;
    align-items: center;
    gap: 5px;
}

.note-item-content,
.deleteNote {
    padding: 8px 8px 8px 12px;
}

.tool-list li a:hover,
.notes-list .note-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .tool-list li a,
[data-theme="dark"] .notes-list .note-item {
    color: #cbd5e1;
}

[data-theme="dark"] .tool-list li a:hover,
[data-theme="dark"] .notes-list .note-item:hover {
    background: #2d2d2d;
    color: #f8fafc;
}

.notes-list .note-item {
    position: relative;
}

.notes-list .note-item.active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 500;
    border-radius: 4px;
}

/* Use a positioned pseudo-element for the active indicator so it doesn't affect layout width */
.notes-list .note-item.active::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: #4f46e5;
    border-radius: 2px;
}

[data-theme="dark"] .notes-list .note-item.active {
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
}

[data-theme="dark"] .notes-list .note-item.active::before {
    background: #818cf8;
}

.notes-empty {
    padding: 16px;
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
}

/* Main Editor Container */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
}



.editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .editor-container {
    background: #1e1e1e;
    border-color: #2d2d2d;
}

.editor-app .editor-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #e2e8f0;
    gap: 4px;
    flex-wrap: wrap;
}

[data-theme="dark"] .editor-toolbar {
    border-bottom-color: #2d2d2d;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #475569;
}

.toolbar-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .toolbar-btn {
    color: #cbd5e1;
}

[data-theme="dark"] .toolbar-btn:hover {
    background: #2d2d2d;
    color: #f8fafc;
}

.toolbar-divider {
    width: 1px;
    height: 16px;
    background: #e2e8f0;
    margin: 0 4px;
}

[data-theme="dark"] .toolbar-divider {
    background: #475569;
}

.text-select span {
    font-family: serif;
    font-weight: bold;
    font-size: 1.1rem;
}

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

.font-size-control span {
    font-size: 0.875rem;
    padding: 0 4px;
}

.text-color {
    border-bottom: 2px solid #000;
}

.text-color.highlight {
    border-bottom-color: #facc15;
}

[data-theme="dark"] .text-color {
    border-bottom-color: #fff;
}

.editor-area-wrapper {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#note-title {
    font-size: 2rem;
    font-weight: 700;
    border: none;
    outline: none;
    background: transparent;
    margin-bottom: 16px;
    color: #0f172a;
}

#note-content {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: #334155;
    resize: none;
    line-height: 1.6;
}

[data-theme="dark"] #note-title {
    color: #f1f5f9;
}

[data-theme="dark"] #note-content {
    color: #cbd5e1;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
}

[data-theme="dark"] .editor-footer {
    border-top-color: #2d2d2d;
}

.stats {
    font-size: 0.75rem;
    color: #64748b;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-action-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.btn-action-small:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="dark"] .btn-action-small {
    background: #2d2d2d;
    color: #cbd5e1;
}

[data-theme="dark"] .btn-action-small:hover {
    background: #475569;
    color: #fff;
}

/* Fancy Tooltip */
.fancy-tooltip {
    position: relative;
}

.fancy-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 100;
}

.fancy-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(125% - 9px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
}

.fancy-tooltip:hover::after,
.fancy-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .fancy-tooltip::after {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .fancy-tooltip::before {
    border-color: #f1f5f9 transparent transparent transparent;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
}

.empty-state svg {
    opacity: 0.5;

    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 16px;
}

/* Quill editor custom overrides */
#quill-toolbar.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 16px !important;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

[data-theme="dark"] #quill-toolbar.ql-toolbar.ql-snow {
    border-bottom-color: #2d2d2d !important;
    background: #1e1e1e;
}

/* #quill-toolbar{
    display: none;
} */
.notepad-toolbar {
    padding: 10px 12px !important;
}

#quill-toolbar .notepad-toolbar-group {
    display: inline-flex;
    align-items: center;
    /* gap: 4px; */
    margin: 0 !important;
    padding: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-height: 34px;
}

[data-theme="dark"] #quill-toolbar .notepad-toolbar-group {
    background: #121212;
    border-color: #2d2d2d;
}

#quill-toolbar .heading-group {
    min-width: 132px;
    background: #eef2ff;
    border-color: #c7d2fe;
}

[data-theme="dark"] #quill-toolbar .heading-group {
    background: rgba(79, 70, 229, 0.18);
    border-color: rgba(129, 140, 248, 0.35);
}

#quill-toolbar .ql-picker.ql-header {
    width: 126px;
    height: 28px;
}

#quill-toolbar .ql-picker.ql-header .ql-picker-label {
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 24px 0 10px;
    border: none !important;
    border-radius: 6px;
    color: #3730a3;
    font-weight: 700;
    font-size: 0.82rem;
}

[data-theme="dark"] #quill-toolbar .ql-picker.ql-header .ql-picker-label {
    color: #c7d2fe !important;
}

#quill-toolbar .ql-picker.ql-header .ql-picker-label:hover {
    background: rgba(79, 70, 229, 0.1);
}

#quill-toolbar .ql-picker.ql-header .ql-picker-options {
    min-width: 170px;
    padding: 8px;
    border: 1px solid #c7d2fe !important;
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16) !important;
}

#quill-toolbar .ql-picker.ql-header .ql-picker-item {
    border-radius: 6px;
    padding: 7px 10px;
}

#quill-toolbar.ql-snow button,
#quill-toolbar.ql-snow .ql-picker-label {
    border-radius: 6px;
}

#quill-toolbar.ql-snow button {
    width: 28px;
    height: 28px;
    padding: 5px;
    color: #475569;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#quill-toolbar.ql-snow button:hover,
#quill-toolbar.ql-snow button:focus,
#quill-toolbar.ql-snow button.ql-active {
    background: #eef2ff;
    color: #4f46e5;
    transform: translateY(-1px);
}

[data-theme="dark"] #quill-toolbar.ql-snow button {
    color: #cbd5e1;
}

[data-theme="dark"] #quill-toolbar.ql-snow button:hover,
[data-theme="dark"] #quill-toolbar.ql-snow button:focus,
[data-theme="dark"] #quill-toolbar.ql-snow button.ql-active {
    background: #2d2d2d;
    color: #f8fafc;
}

#quill-toolbar .toolbar-icon-btn svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#quill-toolbar .toolbar-danger-btn {
    color: #dc2626 !important;
}

#quill-toolbar .toolbar-danger-btn:hover,
#quill-toolbar .toolbar-danger-btn:focus {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

[data-theme="dark"] #quill-toolbar .toolbar-danger-btn {
    color: #f87171 !important;
}

[data-theme="dark"] #quill-toolbar .toolbar-danger-btn:hover,
[data-theme="dark"] #quill-toolbar .toolbar-danger-btn:focus {
    background: rgba(220, 38, 38, 0.2) !important;
    color: #fecaca !important;
}

#quill-toolbar .ql-color,
#quill-toolbar .ql-background,
#quill-toolbar .ql-align {
    width: 30px;
    height: 28px;
}

#quill-toolbar .ql-color .ql-picker-label,
#quill-toolbar .ql-background .ql-picker-label,
#quill-toolbar .ql-align .ql-picker-label {
    height: 28px;
}

.ql-container.ql-snow {
    border: none !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#quill-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ql-editor {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 0 0 !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: #334155;
    line-height: 2 !important;
}

.ql-snow .ql-active .ql-stroke {
    stroke: #4f46e5 !important;
}

/* Quill icons and dropdown alignment in dark mode */
[data-theme="dark"] .ql-editor {
    color: #cbd5e1;
}

[data-theme="dark"] .ql-snow .ql-stroke {
    stroke: #cbd5e1 !important;
}

[data-theme="dark"] .ql-snow .ql-fill {
    fill: #cbd5e1 !important;
}

[data-theme="dark"] .ql-snow .ql-picker {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ql-snow .ql-picker-options {
    background-color: #1e1e1e !important;
    border-color: #2d2d2d !important;
}

[data-theme="dark"] .ql-snow .ql-picker-item {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ql-snow .ql-picker-item:hover,
[data-theme="dark"] .ql-snow .ql-picker-item.ql-selected {
    color: #3b82f6 !important;
}

.login-btn {
    background: #F0F0F0;
    border-radius: 6px;
    color: #585E6D;
    border: 0;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    height: 36px;
}

.login-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.logout-action {
    background: #ff232321;
    border-radius: 8px;
}

.logout-action a {
    color: #ff5656 !important;
}

.logout-action:hover {
    background: #ff232321 !important;
    color: #0f172a !important;
}

.clear-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: rgb(221 36 36);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========================================= */
/* MODALS STYLES                             */
/* ========================================= */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.show {
    display: block;
    opacity: 1;
}

.custom-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 101;
    display: none;
    opacity: 0;
    transition: all 0.2s ease;
    flex-direction: column;
    max-height: 85vh;
}

#all-notes-modal {
    max-width: 800px;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%);
}

.custom-modal h1,
.custom-modal p {
    text-align: center;
}

[data-theme="dark"] .custom-modal {
    background: #1e1e1e;
    border: 1px solid #2d2d2d;
    color: #f1f5f9;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #2d2d2d;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.modal-search {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    width: 300px;
    gap: 8px;
}

[data-theme="dark"] .modal-search {
    background: #121212;
    border-color: #2d2d2d;
}

.modal-search svg {
    color: #94a3b8;
}

.modal-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
    width: 100%;
    color: #334155;
}

[data-theme="dark"] .modal-search input {
    color: #f1f5f9;
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .modal-close:hover {
    background: #2d2d2d;
    color: #f1f5f9;
}

/* Modal Table */
.modal-table {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-table-header {
    display: flex;
    padding: 12px 24px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

[data-theme="dark"] .modal-table-header {
    border-bottom-color: #2d2d2d;
}

.modal-table-header>div,
.modal-table-row>div {
    display: flex;
    align-items: center;
}

.col-title {
    flex: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 16px;
}

.col-date {
    flex: 1;
}

.col-sort {
    width: 100px;
    justify-content: flex-end;
    gap: 4px;
    cursor: pointer;
}

.modal-table-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.modal-table-row {
    display: flex;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #334155;
    transition: background 0.2s;
}

[data-theme="dark"] .modal-table-row {
    color: #cbd5e1;
}

.modal-table-row:hover {
    background: #f8fafc;
}

[data-theme="dark"] .modal-table-row:hover {
    background: #2d2d2d;
}

.modal-table-row .col-date {
    color: #64748b;
    font-size: 0.8rem;
}

.col-actions {
    width: 32px;
    justify-content: flex-end;
    color: #94a3b8;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #2d2d2d;
}

.modal-footer .shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Auth Modal Specifics */
.auth-modal {
    max-width: 400px;
    text-align: center;
}

.auth-modal-content {
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.auth-icon {
    background: #eff6ff;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

[data-theme="dark"] .auth-icon {
    background: rgba(59, 130, 246, 0.1);
}

.auth-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #0f172a;
}

[data-theme="dark"] .auth-modal h2 {
    color: #f1f5f9;
}

.auth-modal p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 32px 0;
}

.auth-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.auth-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.abs-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* ========================================= */
/* DOWNLOAD DROPDOWN STYLES                  */
/* ========================================= */
.download-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 8px;
    z-index: 50;
    min-width: 160px;
}

.download-dropdown .dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.download-dropdown .dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="dark"] .download-dropdown {
    background: #1e1e1e;
    border-color: #2d2d2d;
}

[data-theme="dark"] .download-dropdown .dropdown-item {
    color: #cbd5e1;
}

[data-theme="dark"] .download-dropdown .dropdown-item:hover {
    background: #2d2d2d;
    color: #f8fafc;
}

/* ========================================= */
/* FEEDBACK MODAL & TRIGGER STYLES           */
/* ========================================= */
.feedback-modal {
    max-width: 500px;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 8px;
}

.feedback-body {
    padding: 0 24px 24px;
}

.feedback-desc {
    text-align: start !important;
    color: #475569;
    font-size: 0.95rem;
    margin: 0 0 16px 0;
}

.feedback-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0 -24px 20px;
}

.feedback-options {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.feedback-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    border: 2px solid transparent;
}

.feedback-option svg {
    margin-bottom: 8px;
}

.feedback-option span {
    font-size: 0.75rem;
    font-weight: 500;
}

.feedback-option:hover {
    background: #e2e8f0;
    color: #334155;
}

.feedback-option.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}

.feedback-actions button {
    padding: 15px 0px;
    border-radius: 8px;
}

[data-theme="dark"] .feedback-desc,
[data-theme="dark"] .feedback-header h2 {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .feedback-divider {
    background: #2d2d2d;
}

[data-theme="dark"] .feedback-option {
    background: #2d2d2d;
    color: #94a3b8;
}

[data-theme="dark"] .feedback-option:hover {
    background: #3d3d3d;
    color: #cbd5e1;
}

[data-theme="dark"] .feedback-option.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #60a5fa;
}

#feedback-text {
    width: 100%;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    background: transparent;
    color: #0f172a;
}

#feedback-text:focus {
    border-color: #3b82f6;
}

[data-theme="dark"] #feedback-text {
    border-color: #2d2d2d;
    color: #f8fafc;
}

[data-theme="dark"] #feedback-text:focus {
    border-color: #3b82f6;
}

.feedback-float-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4), 0 2px 4px -1px rgba(59, 130, 246, 0.2);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    z-index: 90;
}

.feedback-float-btn:hover {
    transform: translateY(-2px);
    background: #2563eb;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4), 0 4px 6px -2px rgba(59, 130, 246, 0.2);
}

.saved-status {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.6;
}

@media(max-width: 768px) {
    .header-center {
        display: none;
    }

    .search-text,
    .kbd-wrap {
        display: none;
    }

    .btn-shortcut {
        padding: 8px;
    }

    .header-right .login-btn {
        display: block;
    }

    /* #quill-toolbar.ql-toolbar.ql-snow{
        flex-wrap: nowrap !important;
        overflow-x: auto;
    } */
}

@media(min-width: 768px) {
    .dashboard-sidebar {
        position: static;
        transform: none;
    }

    .dashboard-sidebar.closed {
        display: none;
    }

    .sidebar-overlay.active {
        display: none;
    }
}

@media(max-width: 640px) {
    .dashboard-main {
        padding: 8px;
    }
}

@media(max-width: 576px) {
    .header-right {
        flex: 0;
    }

    .header-right .btn-shortcut {
        display: none;
    }

    .sync-text {
        display: none;
    }

    .editor-footer .stats .character {
        display: none;
    }

    .feedback-options {
        gap: 5px;
    }

    .feedback-option {
        padding: 5px;
    }

    .feedback-option svg {
        margin-bottom: 0px;
    }

    .feedback-option span {
        display: none;
    }
}

/* ========================================= */
/* TRASH VIEW STYLES                         */
/* ========================================= */
.trash-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .trash-container {
    background: #1e1e1e;
    border-color: #2d2d2d;
}

.trash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
}

[data-theme="dark"] .trash-header {
    border-bottom-color: #2d2d2d;
}

.trash-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-theme="dark"] .trash-header h2 {
    color: #f1f5f9;
}

.trash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.trash-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.trash-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

[data-theme="dark"] .trash-card {
    background: #121212;
    border-color: #2d2d2d;
    box-shadow: none;
}

[data-theme="dark"] .trash-card:hover {
    border-color: #555555;
}

.trash-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .trash-card-title {
    color: #f1f5f9;
}

.trash-card-content {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 12px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

[data-theme="dark"] .trash-card-content {
    color: #94a3b8;
}

.trash-card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

[data-theme="dark"] .trash-card-footer {
    border-top-color: #2d2d2d;
}

.trash-card-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.trash-card-actions {
    display: flex;
    gap: 8px;
}

.btn-restore,
.btn-delete-perm {
    flex: 1;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}

.btn-restore {
    background: #eff6ff;
    color: #2563eb;
}

.btn-restore:hover {
    background: #dbeafe;
}

[data-theme="dark"] .btn-restore {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .btn-restore:hover {
    background: rgba(37, 99, 235, 0.25);
}

.btn-delete-perm {
    background: #fef2f2;
    color: #dc2626;
}

.btn-delete-perm:hover {
    background: #fee2e2;
}

[data-theme="dark"] .btn-delete-perm {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

[data-theme="dark"] .btn-delete-perm:hover {
    background: rgba(220, 38, 38, 0.25);
}

.trash-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 0;
    color: #94a3b8;
}

.trash-empty svg {
    opacity: 0.4;
    margin-bottom: 16px;
}

.trash-empty p {
    font-size: 1rem;
    margin: 0;
}

/* Confirm Modal Styles */
.confirm-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.btn-danger {
    background-color: #ef4444 !important;
    color: white !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
}

/* Quill Toolbar Loader */
#toolbar-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    padding-left: 12px;
    gap: 10px;
    z-index: 10;
    border-radius: 8px 8px 0 0;
}

[data-theme="dark"] #toolbar-loader {
    background: #1e1e1e;
}

.skeleton-btn {
    background: #e2e8f0;
    border-radius: 4px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

[data-theme="dark"] .skeleton-btn {
    background: #2d2d2d;
}

[data-theme="dark"] .ql-editor[data-placeholder]::before {
    color: #94a3b8 !important;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}


.customize-scrollbar::-webkit-scrollbar,
.ql-editor::-webkit-scrollbar {
    width: 5px;
}

.customize-scrollbar::-webkit-scrollbar-track,
.ql-editor::-webkit-scrollbar-track {
    background: rgb(227, 227, 227);
    border-radius: 4px;
}

.customize-scrollbar::-webkit-scrollbar-thumb,
.ql-editor::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 4px;
}

.customize-scrollbar::-webkit-scrollbar-thumb:hover,
.ql-editor::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Login CTA Design */
.login-cta {
    padding: 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #d4d9ff;
    font-family: Calibri;
    box-shadow: -1px 2px 12px 1px rgba(212, 217, 255, 0.75);

}

[data-theme="dark"] .login-cta {
    background: #1e1e1e;
    border: 1px solid #4f46e5;
    box-shadow: -1px 2px 13px -1px rgba(212, 217, 255, 0.75);
}

.login-cta .cta-content .heading {
    font-size: 18px;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.2;
}

[data-theme="dark"] .login-cta .cta-content .heading {
    color: #d1d1d1;
}

.login-cta .cta-content .heading span {
    color: #755DF5;

}

.login-cta .description {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.2;
    margin: 0;
}

.login-cta-button {
    margin-top: 10px;
    border-radius: 8px;
    width: 100%;
    text-align: center;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.3;
    }
}

.skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Horizontal Scroll Toolbar and dropdown visibility on tablet/mobile screens */
@media (max-width: 991.98px) {
    #quill-toolbar.ql-toolbar.ql-snow {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important;
        /* Firefox */
        padding: 8px 12px !important;
        margin-right: 12px;
    }

    #quill-toolbar.ql-toolbar.ql-snow::-webkit-scrollbar {
        display: none !important;
        /* Chrome/Safari */
    }

    #quill-toolbar .notepad-toolbar-group {
        flex-shrink: 0 !important;
    }

    /* Override position and styling of picker options to support position: fixed positioning without clipping */
    #quill-toolbar .ql-picker.ql-expanded .ql-picker-options {
        margin-top: 4px !important;
        transform: none !important;
        position: fixed !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
    }

    [data-theme="dark"] #quill-toolbar .ql-picker.ql-expanded .ql-picker-options {
        border-color: #2d2d2d !important;
        background-color: #1e1e1e !important;
    }

    .ql-snow .ql-picker-options {
        min-width: unset !important;
    }
}