/* ============================================
   KOODI NOTES - Neo-Brutalist Notion-Like Notes
   ============================================ */

/* ------------------------------------------
   1. MAIN LAYOUT
   ------------------------------------------ */

.notes-main {
    min-height: calc(100vh - var(--header-height, 140px));
    padding: 30px 0 40px;
    background: var(--bg);
    font-family: var(--font-family);
    color: var(--black);
}

.notes-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height, 140px) - 70px);
    padding: 0 40px;
    gap: 30px;
    align-items: stretch;
}

/* ------------------------------------------
   2. SIDEBAR
   ------------------------------------------ */

.notes-sidebar {
    width: 340px;
    min-width: 340px;
    position: sticky;
    top: calc(var(--header-height, 140px) + 30px);
    height: calc(100vh - var(--header-height, 140px) - 60px);
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 25px;
    box-shadow: 6px 6px 0px var(--black);
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.notes-sidebar.collapsed {
    width: 64px;
    min-width: 64px;
}

.notes-sidebar.collapsed .notes-search-wrapper,
.notes-sidebar.collapsed .notes-filters,
.notes-sidebar.collapsed .notes-list,
.notes-sidebar.collapsed .notes-sidebar-title,
.notes-sidebar.collapsed .new-note-btn span {
    display: none;
}

/* Sidebar Header */
.notes-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 3px solid var(--black);
}

.notes-sidebar-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notes-sidebar-title i {
    color: var(--lime);
    font-size: 24px;
}

.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--black);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--black);
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--lime);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0px var(--black);
}

/* Sidebar Content Area */
.notes-sidebar .new-note-btn,
.notes-sidebar .notes-search-wrapper,
.notes-sidebar .notes-filters,
.notes-sidebar .notes-list {
    margin-left: 20px;
    margin-right: 20px;
}

.notes-sidebar .new-note-btn {
    margin-top: 20px;
}

/* New Note Button */
.new-note-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--lime);
    color: var(--black);
    border: 3px solid var(--black);
    border-radius: 16px;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--black);
    transition: all 0.2s ease;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.new-note-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--black);
}

.new-note-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px var(--black);
}

.new-note-btn i {
    font-size: 18px;
}

/* Search Input */
.notes-search-wrapper {
    position: relative;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.notes-search-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 3px solid var(--black);
    border-radius: 14px;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--black);
    background: var(--white);
    outline: none;
    transition: all 0.2s ease;
}

.notes-search-wrapper input::placeholder {
    color: var(--gray);
}

.notes-search-wrapper input:focus {
    border-color: var(--blue);
    box-shadow: 3px 3px 0px var(--blue);
}

.notes-search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 16px;
    pointer-events: none;
}

/* Filter Tabs */
.notes-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.notes-filter-btn {
    flex: 1;
    padding: 9px 6px;
    border: 2px solid var(--black);
    border-radius: 12px;
    background: var(--white);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--darkgray);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.notes-filter-btn:hover {
    background: #f0f0f0;
}

.notes-filter-btn.active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.notes-filter-btn i {
    margin-right: 4px;
    font-size: 12px;
}

/* Notes List */
.notes-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
    padding-bottom: 20px;
    padding-right: 4px;
}

.notes-list::-webkit-scrollbar {
    width: 5px;
}

.notes-list::-webkit-scrollbar-track {
    background: transparent;
}

.notes-list::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 3px;
}

.notes-list::-webkit-scrollbar-thumb:hover {
    background: var(--darkgray);
}

/* Note Card */
.note-card {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 18px;
    box-shadow: 5px 5px 0px var(--black);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.note-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0px var(--black);
}

.note-card.active {
    border-color: var(--blue);
    box-shadow: 5px 5px 0px var(--blue);
}

.note-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 8px 8px 0px var(--black);
}

/* Color Stripe */
.note-card-color {
    height: 4px;
    width: 100%;
}

.note-card-color.color-lime { background: var(--lime); }
.note-card-color.color-blue { background: var(--blue); }
.note-card-color.color-pink { background: var(--pink); }
.note-card-color.color-orange { background: var(--orange); }
.note-card-color.color-default { background: var(--gray); }

/* Note Card Content */
.note-card-body {
    padding: 14px 16px;
}

.note-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-preview {
    font-size: 13px;
    color: var(--darkgray);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.note-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.note-card-date {
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
}

.note-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    overflow: hidden;
    max-height: 22px;
}

.note-card-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(198, 223, 43, 0.25);
    color: var(--black);
    white-space: nowrap;
}

.note-card-tag.tag-blue { background: rgba(0, 157, 255, 0.2); }
.note-card-tag.tag-pink { background: rgba(255, 78, 153, 0.2); }
.note-card-tag.tag-orange { background: rgba(255, 159, 0, 0.2); }

/* Note Card Icons */
.note-card-icons {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.note-card-icons i {
    font-size: 12px;
    color: var(--gray);
}

.note-card-icon { color: var(--gray); }
.note-card-icon.fav { color: var(--orange); }
.note-card-icon.reminder { color: var(--pink); }

/* Sidebar Loading */
.notes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
    flex: 1;
}

.notes-loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #eee;
    border-top-color: var(--lime);
    border-radius: 50%;
    animation: sidebarSpin 0.8s linear infinite;
}

@keyframes sidebarSpin {
    to { transform: rotate(360deg); }
}

.notes-loading-text {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

/* Sidebar Empty */
.notes-empty-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    flex: 1;
    color: var(--gray);
}

.notes-empty-sidebar i {
    font-size: 40px;
    color: var(--gray);
    margin-bottom: 12px;
}

.notes-empty-sidebar p {
    font-size: 14px;
    color: var(--darkgray);
    line-height: 1.5;
}

/* ------------------------------------------
   3. EDITOR
   ------------------------------------------ */

.notes-editor {
    flex: 1;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 25px;
    box-shadow: 8px 8px 0px var(--black);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: calc(100vh - var(--header-height, 140px) - 100px);
    transition: all 0.2s ease;
}

/* Editor Header */
.notes-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 3px solid var(--black);
    flex-wrap: wrap;
    gap: 12px;
}

.notes-editor-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notes-editor-back-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: 2px solid var(--black);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--black);
    transition: all 0.2s ease;
}

.notes-editor-back-btn:hover {
    background: var(--lime);
}

.notes-editor-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Color Picker */
.note-color-picker {
    display: flex;
    gap: 6px;
    align-items: center;
}

.note-color-picker label {
    font-size: 13px;
    font-weight: 600;
    color: var(--darkgray);
    margin-right: 4px;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.2);
}

.color-option.active {
    border-color: var(--black);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black);
}

.color-option.dot-lime { background: var(--lime); }
.color-option.dot-blue { background: var(--blue); }
.color-option.dot-pink { background: var(--pink); }
.color-option.dot-orange { background: var(--orange); }
.color-option.dot-default { background: var(--gray); }

/* Save Status */
.save-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray);
    padding: 6px 12px;
    border-radius: 10px;
    background: #f5f5f5;
}

.save-status.saved {
    color: #2ecc71;
}

.save-status.saving {
    color: var(--orange);
}

.save-status.error {
    color: var(--pink);
}

.save-status i {
    font-size: 14px;
}

.save-status .saving-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #eee;
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: saveSpin 0.6s linear infinite;
}

@keyframes saveSpin {
    to { transform: rotate(360deg); }
}

/* Action Buttons */
.notes-editor-action-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--black);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--black);
    transition: all 0.2s ease;
}

.notes-editor-action-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0px var(--black);
}

.notes-editor-action-btn.active-pin {
    background: var(--orange);
    color: var(--white);
    border-color: var(--black);
}

.notes-editor-action-btn.active-star {
    background: var(--pink);
    color: var(--white);
    border-color: var(--black);
}

.notes-editor-action-btn.active-bell {
    background: var(--blue);
    color: var(--white);
    border-color: var(--black);
}

.notes-editor-action-btn.btn-delete {
    color: var(--pink);
}

.notes-editor-action-btn.btn-delete:hover {
    background: var(--pink);
    color: var(--white);
    box-shadow: 3px 3px 0px #cc3d7a;
}

/* Note Title Wrapper */
.notes-editor-title-wrapper {
    width: 100%;
}

/* Note Title Input */
.notes-editor-title {
    width: 100%;
    padding: 24px 28px 8px;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 32px;
    font-weight: 800;
    color: var(--black);
    background: transparent;
    resize: none;
}

.notes-editor-title::placeholder {
    color: var(--gray);
}

/* Tags Row */
.notes-editor-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 28px;
}

.tags-list {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 28px 16px;
    flex-wrap: wrap;
}

.tags-list i.tags-icon {
    font-size: 14px;
    color: var(--gray);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(198, 223, 43, 0.2);
    border: 2px solid rgba(198, 223, 43, 0.4);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    transition: all 0.2s ease;
}

.tag-pill .tag-remove {
    cursor: pointer;
    font-size: 11px;
    color: var(--darkgray);
    transition: color 0.2s ease;
    line-height: 1;
}

.tag-pill .tag-remove:hover {
    color: var(--pink);
}

.tag-input {
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--black);
    background: transparent;
    min-width: 80px;
    padding: 5px 4px;
}

.tag-input::placeholder {
    color: var(--gray);
}

/* ------------------------------------------
   TOOLBAR
   ------------------------------------------ */

.notes-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    border-top: 2px solid #eee;
    border-bottom: 2px solid #eee;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
    overflow-x: auto;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-divider {
    width: 2px;
    height: 28px;
    background: #e0e0e0;
    margin: 0 8px;
    border-radius: 1px;
    flex-shrink: 0;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--black);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toolbar-btn:hover {
    border-color: var(--black);
    background: #f5f5f5;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--black);
}

.toolbar-btn.active {
    background: var(--lime);
    border-color: var(--black);
    box-shadow: 2px 2px 0px var(--black);
}

.toolbar-btn i {
    pointer-events: none;
}

.toolbar-btn .btn-label {
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-family);
    pointer-events: none;
}

/* ---- Text Color & Highlight Picker ---- */

.toolbar-color-picker {
    position: relative;
}

.toolbar-color-btn,
.toolbar-highlight-btn {
    position: relative;
    overflow: visible;
}

.color-indicator,
.highlight-indicator {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 2.5px;
    border-radius: 2px;
    pointer-events: none;
    display: none;
}

.color-indicator {
    background: #131010;
}

.highlight-indicator {
    background: transparent;
}

/* Show indicators only when a color is actively selected */
.color-indicator.has-color,
.highlight-indicator.has-color {
    display: block;
}

.color-dropdown {
    position: fixed;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 16px;
    box-shadow: 5px 5px 0px var(--black);
    padding: 14px 16px;
    z-index: 9999;
    min-width: 200px;
    display: none;
}

.color-dropdown.show {
    display: block;
    animation: colorDropUp 0.15s ease;
}

@keyframes colorDropUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.color-dropdown-label {
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    margin-bottom: 10px;
}

.color-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.color-swatch,
.highlight-swatch {
    width: 32px;
    height: 32px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.color-swatch:hover,
.highlight-swatch:hover {
    transform: scale(1.15);
    border-color: var(--black);
    box-shadow: 2px 2px 0px var(--black);
}

.color-swatch.active,
.highlight-swatch.active {
    border-color: var(--black);
    box-shadow: 2px 2px 0px var(--black);
    transform: scale(1.1);
}

.color-dropdown-divider {
    height: 2px;
    background: #eee;
    margin: 12px 0;
    border-radius: 1px;
}

.color-reset-btn,
.highlight-reset-btn {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: var(--white);
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    color: var(--darkgray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.color-reset-btn:hover,
.highlight-reset-btn:hover {
    background: #f5f5f5;
    border-color: var(--black);
    box-shadow: 2px 2px 0px var(--black);
    transform: translate(-1px, -1px);
}

/* Toolbar dropdown (e.g., heading size selector) */
.toolbar-dropdown {
    position: relative;
}

.toolbar-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 14px;
    box-shadow: 5px 5px 0px var(--black);
    padding: 8px;
    display: none;
    z-index: 20;
    min-width: 160px;
}

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

.toolbar-dropdown-item {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--black);
    transition: background 0.15s ease;
}

.toolbar-dropdown-item:hover {
    background: rgba(198, 223, 43, 0.25);
}

/* ------------------------------------------
   BLOCKS CONTAINER
   ------------------------------------------ */

.notes-editor-blocks {
    flex: 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

/* ------------------------------------------
   4. BLOCK TYPES
   ------------------------------------------ */

/* Base Block */
.note-block {
    position: relative;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    group: block;
}

.note-block:hover {
    border-color: #eee;
    background: rgba(0, 0, 0, 0.01);
}

.note-block:focus-within {
    border-color: var(--blue);
    background: rgba(0, 157, 255, 0.03);
}

.block-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: all 0.2s ease;
}

.note-block:hover .block-delete-btn {
    opacity: 1;
}

.block-delete-btn:hover {
    background: var(--pink);
    color: var(--white);
    border-color: var(--black);
}

.block-drag-handle {
    position: absolute;
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
    width: 20px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 12px;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 4px;
}

.note-block:hover .block-drag-handle {
    opacity: 1;
}

.block-drag-handle:hover {
    color: var(--black);
    background: #f0f0f0;
}

.block-drag-handle:active {
    cursor: grabbing;
}

/* Text Block */
.text-block .text-content {
    outline: none;
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.7;
    color: var(--black);
    min-height: 24px;
    word-break: break-word;
}

.text-block .text-content:empty::before {
    content: attr(data-placeholder);
    color: var(--gray);
    pointer-events: none;
}

.text-block .text-content b,
.text-block .text-content strong {
    font-weight: 700;
}

.text-block .text-content i,
.text-block .text-content em {
    font-style: italic;
}

.text-block .text-content u {
    text-decoration: underline;
}

.text-block .text-content a {
    color: var(--blue);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.text-block .text-content a:hover {
    color: var(--pink);
}

/* Heading Block */
.heading-block .heading-content {
    outline: none;
    font-family: var(--font-family);
    color: var(--black);
    font-weight: 800;
    word-break: break-word;
}

.heading-block .heading-content:empty::before {
    content: attr(data-placeholder);
    color: var(--gray);
    pointer-events: none;
}

.heading-block.h1 .heading-content {
    font-size: 32px;
    line-height: 1.3;
}

.heading-block.h2 .heading-content {
    font-size: 26px;
    line-height: 1.35;
}

.heading-block.h3 .heading-content {
    font-size: 21px;
    line-height: 1.4;
}

/* Todo Block */
.todo-block {
    padding: 14px 18px;
}

.todo-block-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 12px;
}

.todo-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.todo-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Custom Checkbox */
.todo-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 3px solid var(--black);
    border-radius: 7px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: var(--white);
}

.todo-checkbox:hover {
    border-color: var(--lime);
    box-shadow: 2px 2px 0px var(--lime);
}

.todo-checkbox:checked {
    background: var(--lime);
    border-color: var(--black);
}

.todo-checkbox:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 800;
    color: var(--black);
    line-height: 1;
}

.todo-text {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--black);
    background: transparent;
    padding: 4px 0;
}

.todo-text.completed {
    text-decoration: line-through;
    color: var(--gray);
}

.todo-remove-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: all 0.2s ease;
}

.todo-item:hover .todo-remove-btn {
    opacity: 1;
}

.todo-remove-btn:hover {
    background: var(--pink);
    color: var(--white);
}

.todo-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px dashed var(--gray);
    border-radius: 10px;
    background: transparent;
    color: var(--gray);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.todo-add-btn:hover {
    border-color: var(--lime);
    color: var(--black);
    background: rgba(198, 223, 43, 0.1);
}

/* Table Block */
.table-block {
    padding: 14px 18px;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.table-add-row,
.table-add-col {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--white);
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    color: var(--darkgray);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-add-row:hover,
.table-add-col:hover {
    border-color: var(--black);
    color: var(--black);
}

.table-wrapper {
    overflow-x: auto;
    border: 3px solid var(--black);
    border-radius: 14px;
    box-shadow: 4px 4px 0px var(--black);
}

.note-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-family);
    font-size: 14px;
}

.note-table th,
.note-table td {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    text-align: left;
    min-width: 100px;
}

.note-table th {
    background: #f5f5f5;
    font-weight: 700;
    color: var(--black);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid var(--black);
}

.note-table td {
    color: var(--black);
    background: var(--white);
}

.note-table td[contenteditable="true"]:focus {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
    background: rgba(0, 157, 255, 0.04);
}

.note-table tr:hover td {
    background: rgba(198, 223, 43, 0.06);
}

/* Drawing Block */
.drawing-block {
    padding: 14px 18px;
    border-radius: 16px;
}

.drawing-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 14px 14px 0 0;
    flex-wrap: wrap;
}

.draw-tool {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--black);
    transition: all 0.2s ease;
}

.draw-tool:hover {
    border-color: var(--black);
}

.draw-tool.active {
    background: var(--lime);
    border-color: var(--black);
    box-shadow: 2px 2px 0px var(--black);
}

.draw-color {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
    background: var(--white);
}

.draw-color::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.draw-color::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.draw-size {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.draw-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--black);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.draw-size::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.draw-size::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--black);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.drawing-size-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--darkgray);
}

.draw-clear {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    color: var(--darkgray);
    transition: all 0.2s ease;
}

.draw-clear:hover {
    background: var(--pink);
    color: var(--white);
    border-color: var(--black);
    box-shadow: 2px 2px 0px var(--black);
}

.draw-clear i {
    font-size: 12px;
}

.drawing-canvas {
    display: block;
    width: 100%;
    min-height: 300px;
    background: #ffffff;
    cursor: crosshair;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 14px 14px;
}

/* Code Block */
.code-block {
    border-radius: 18px;
    overflow: hidden;
    border: 3px solid var(--black);
    box-shadow: 4px 4px 0px var(--black);
    margin: 4px 0;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #2a2a3e;
    border-bottom: 2px solid #3d3d54;
}

.code-header span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 700;
    color: var(--lime);
    letter-spacing: 0.5px;
}

.code-header span i {
    font-size: 14px;
}

.code-block .block-delete-btn {
    position: static;
    opacity: 1;
    color: #888;
    border: 1px solid #555;
    background: transparent;
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.code-block .block-delete-btn:hover {
    background: var(--pink);
    color: var(--white);
    border-color: var(--pink);
}

.code-block-lang {
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    font-family: var(--font-family);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-block-copy {
    padding: 4px 10px;
    border: 1px solid #555;
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

.code-block-copy:hover {
    background: #3a3a3a;
    color: var(--lime);
    border-color: var(--lime);
}

.code-block pre,
.code-block .code-content {
    margin: 0;
    padding: 20px;
    background: #1a1a2e;
    overflow-x: auto;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #e0e0e0;
    tab-size: 4;
    min-height: 100px;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    border: none;
}

.code-block .code-content:empty::before {
    content: '// Напиши код тут...';
    color: #555;
    pointer-events: none;
}

.code-block .code-content:focus {
    background: #1d1d33;
}

.code-block code {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #e0e0e0;
    tab-size: 4;
}

.code-block textarea {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    background: #1a1a2e;
    color: #e0e0e0;
    border: none;
    outline: none;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    tab-size: 4;
}

/* Divider Block */
.divider-block {
    padding: 16px 0;
}

.divider-block hr {
    border: none;
    height: 3px;
    background: var(--black);
    border-radius: 2px;
}

.divider-block hr.dashed {
    background: none;
    border-top: 3px dashed var(--black);
}

.divider-block hr.dotted {
    background: none;
    border-top: 3px dotted var(--gray);
}

/* Quote Block */
.quote-block {
    padding: 14px 18px;
}

.quote-block .quote-content {
    padding: 16px 20px;
    border-left: 5px solid var(--lime);
    background: rgba(198, 223, 43, 0.08);
    border-radius: 0 12px 12px 0;
    font-family: var(--font-family);
    font-size: 16px;
    font-style: italic;
    color: var(--black);
    line-height: 1.6;
    outline: none;
}

.quote-block .quote-content:empty::before {
    content: attr(data-placeholder);
    color: var(--gray);
    pointer-events: none;
}

/* Callout Block */
.callout-block {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 2px solid #e0e0e0;
    background: rgba(0, 157, 255, 0.05);
}

.callout-block.callout-warning {
    background: rgba(255, 159, 0, 0.08);
    border-color: rgba(255, 159, 0, 0.3);
}

.callout-block.callout-danger {
    background: rgba(255, 78, 153, 0.08);
    border-color: rgba(255, 78, 153, 0.3);
}

.callout-block.callout-success {
    background: rgba(198, 223, 43, 0.1);
    border-color: rgba(198, 223, 43, 0.4);
}

.callout-icon {
    font-size: 22px;
    flex-shrink: 0;
    padding-top: 2px;
}

.callout-text {
    flex: 1;
    outline: none;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--black);
}

/* ------------------------------------------
   ATTACHMENTS
   ------------------------------------------ */

.notes-editor-attachments {
    padding: 20px 28px;
    border-top: 2px solid #eee;
}

.attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.attachments-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachments-title i {
    color: var(--gray);
}

.attachment-upload-btn {
    padding: 8px 16px;
    border: 2px solid var(--black);
    border-radius: 10px;
    background: var(--white);
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attachment-upload-btn:hover {
    background: var(--lime);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--black);
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    background: var(--white);
    transition: all 0.2s ease;
}

.attachment-item:hover {
    border-color: var(--black);
    box-shadow: 3px 3px 0px var(--black);
    transform: translate(-1px, -1px);
}

.attachment-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: #f5f5f5;
    color: var(--darkgray);
}

.attachment-icon.file-image {
    background: rgba(0, 157, 255, 0.15);
    color: var(--blue);
}

.attachment-icon.file-pdf {
    background: rgba(255, 78, 153, 0.15);
    color: var(--pink);
}

.attachment-icon.file-code {
    background: rgba(198, 223, 43, 0.2);
    color: var(--black);
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 12px;
    color: var(--gray);
    margin-top: 2px;
}

.attachment-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e8e8e8;
}

.attachment-delete {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.attachment-delete:hover {
    background: var(--pink);
    color: var(--white);
}

/* ------------------------------------------
   5. MODALS
   ------------------------------------------ */

.notes-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(19, 16, 16, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.notes-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.notes-modal {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 24px;
    box-shadow: 8px 8px 0px var(--black);
    max-width: 460px;
    width: 100%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.notes-modal-overlay.active .notes-modal {
    transform: scale(1) translateY(0);
}

.notes-modal-header {
    padding: 24px 28px 0;
    text-align: center;
}

.notes-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.notes-modal-title {
    font-family: var(--font-family);
    font-size: 22px;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 8px;
}

.notes-modal-text {
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--darkgray);
    line-height: 1.5;
    margin-bottom: 20px;
}

.notes-modal-body {
    padding: 0 28px;
}

.notes-modal-body label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 8px;
}

.notes-modal-body input[type="text"],
.notes-modal-body input[type="date"],
.notes-modal-body input[type="time"],
.notes-modal-body input[type="datetime-local"],
.notes-modal-body textarea,
.notes-modal-body select {
    width: 100%;
    padding: 12px 16px;
    border: 3px solid var(--black);
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--black);
    background: var(--white);
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.notes-modal-body input:focus,
.notes-modal-body textarea:focus,
.notes-modal-body select:focus {
    border-color: var(--blue);
    box-shadow: 3px 3px 0px var(--blue);
}

.notes-modal-footer {
    padding: 20px 28px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: 3px solid var(--black);
    border-radius: 14px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px var(--black);
}

.modal-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px var(--black);
}

.modal-btn-primary {
    background: var(--lime);
    color: var(--black);
}

.modal-btn-danger {
    background: var(--pink);
    color: var(--white);
}

.modal-btn-danger:hover {
    box-shadow: 4px 4px 0px #cc3d7a;
}

.modal-btn-cancel {
    background: var(--white);
    color: var(--black);
}

/* ------------------------------------------
   6. REMINDER NOTIFICATION TOAST
   ------------------------------------------ */

.reminder-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 20px;
    box-shadow: 6px 6px 0px var(--black);
    padding: 20px 24px;
    max-width: 360px;
    width: calc(100% - 40px);
    z-index: 10000;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reminder-toast.show {
    transform: translateX(0);
}

.reminder-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reminder-toast-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--blue);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.reminder-toast-close {
    width: 28px;
    height: 28px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--darkgray);
    transition: all 0.2s ease;
}

.reminder-toast-close:hover {
    background: var(--pink);
    color: var(--white);
    border-color: var(--pink);
}

.reminder-toast-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 4px;
}

.reminder-toast-text {
    font-size: 14px;
    color: var(--darkgray);
    line-height: 1.5;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(calc(100% + 40px));
    }
    to {
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(100% + 40px));
    }
}

/* ------------------------------------------
   7. MOBILE SIDEBAR TOGGLE
   ------------------------------------------ */

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border: 3px solid var(--black);
    border-radius: 50%;
    background: var(--lime);
    color: var(--black);
    cursor: pointer;
    z-index: 999;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 4px 4px 0px var(--black);
    transition: all 0.2s ease;
}

.mobile-sidebar-toggle:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--black);
}

.mobile-sidebar-toggle:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px var(--black);
}

/* ------------------------------------------
   8. SAVE STATUS (extended)
   ------------------------------------------ */

.save-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.save-status-dot.saved {
    background: #2ecc71;
}

.save-status-dot.saving {
    background: var(--orange);
    animation: savePulse 1s ease-in-out infinite;
}

.save-status-dot.error {
    background: var(--pink);
}

@keyframes savePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ------------------------------------------
   10. DRAG & DROP
   ------------------------------------------ */

.note-block.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.note-block.drag-over {
    border-color: var(--blue);
    border-style: dashed;
    background: rgba(0, 157, 255, 0.06);
}

.note-block.drag-over::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--blue);
    border-radius: 2px;
}

.note-card.drag-over {
    border-color: var(--blue);
    border-style: dashed;
    background: rgba(0, 157, 255, 0.05);
}

/* ------------------------------------------
   11. EMPTY STATES
   ------------------------------------------ */

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    flex: 1;
    min-height: calc(100vh - var(--header-height, 140px) - 100px);
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: 25px;
    box-shadow: 8px 8px 0px var(--black);
}

.notes-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.notes-empty .notes-empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
    color: var(--gray);
}

.notes-empty h2,
.notes-empty h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 12px;
}

.notes-empty p {
    font-size: 16px;
    color: var(--darkgray);
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.notes-empty .new-note-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: var(--lime);
    color: var(--black);
    border: 3px solid var(--black);
    border-radius: 16px;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 5px 5px 0px var(--black);
    transition: all 0.2s ease;
    text-decoration: none;
}

.notes-empty .new-note-empty-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0px var(--black);
}

.notes-empty .new-note-empty-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--black);
}

/* Editor Empty State (no note selected) */
.notes-editor-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 60px 30px;
    color: var(--gray);
}

.notes-editor-empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--gray);
}

.notes-editor-empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 10px;
}

.notes-editor-empty-state p {
    font-size: 15px;
    color: var(--darkgray);
    line-height: 1.6;
    max-width: 340px;
}

/* ------------------------------------------
   12. ATTACHMENTS - Image Grid Layout
   ------------------------------------------ */

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.attachment-image-card {
    position: relative;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s ease;
    aspect-ratio: 1;
}

.attachment-image-card:hover {
    border-color: var(--black);
    box-shadow: 3px 3px 0px var(--black);
    transform: translate(-1px, -1px);
}

.attachment-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-image-card .attachment-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
}

.attachment-image-card:hover .attachment-delete {
    opacity: 1;
}

/* ------------------------------------------
   9. RESPONSIVE BREAKPOINTS
   ------------------------------------------ */

/* Tablet - Sidebar becomes slide-over */
@media (max-width: 992px) {
    .notes-container {
        padding: 0 16px 30px;
    }

    .notes-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        min-width: 320px;
        height: 100vh;
        border-radius: 0 25px 25px 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .notes-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.2);
    }

    .notes-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(19, 16, 16, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .notes-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-sidebar-toggle {
        display: flex;
    }

    .notes-editor-back-btn {
        display: flex;
    }

    .notes-editor {
        width: 100%;
    }

    .notes-toolbar {
        padding: 10px 18px;
    }

    .notes-editor-blocks {
        padding: 20px 18px;
    }

    .notes-editor-title {
        padding: 20px 18px 8px;
        font-size: 28px;
    }

    .tags-list {
        padding: 8px 18px 14px;
    }

    .notes-editor-header {
        padding: 14px 18px;
    }

    .notes-editor-attachments {
        padding: 16px 18px;
    }
}

/* Small Tablet / Large Phone */
@media (max-width: 768px) {
    .notes-main {
        padding: 16px 0 30px;
    }

    .notes-container {
        padding: 0 16px;
        gap: 16px;
    }

    .notes-editor {
        border-radius: 20px;
        box-shadow: 6px 6px 0px var(--black);
        min-height: 500px;
    }

    .notes-editor-header {
        padding: 12px 16px;
        gap: 8px;
    }

    .notes-editor-action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 10px;
    }

    .notes-editor-title {
        font-size: 24px;
        padding: 16px 16px 6px;
    }

    .tags-list {
        padding: 6px 16px 12px;
    }

    .notes-toolbar {
        padding: 8px 12px;
        gap: 4px;
    }

    .toolbar-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
        border-radius: 8px;
    }

    .toolbar-divider {
        margin: 0 4px;
        height: 24px;
    }

    .color-swatch,
    .highlight-swatch {
        width: 28px;
        height: 28px;
    }

    .color-dropdown {
        min-width: 180px;
        padding: 12px 14px;
    }

    .notes-editor-blocks {
        padding: 16px 16px;
        gap: 12px;
    }

    .note-block {
        padding: 10px 14px;
    }

    .text-block .text-content {
        font-size: 15px;
    }

    .heading-block.h1 .heading-content {
        font-size: 26px;
    }

    .heading-block.h2 .heading-content {
        font-size: 22px;
    }

    .heading-block.h3 .heading-content {
        font-size: 18px;
    }

    .code-block pre,
    .code-block .code-content,
    .code-block textarea {
        padding: 14px;
    }

    .code-block code,
    .code-block .code-content,
    .code-block textarea {
        font-size: 13px;
    }

    .draw-clear {
        padding: 6px 10px;
        font-size: 11px;
    }

    .notes-modal {
        max-width: 400px;
        border-radius: 20px;
        box-shadow: 6px 6px 0px var(--black);
    }

    .notes-modal-header {
        padding: 20px 22px 0;
    }

    .notes-modal-body {
        padding: 0 22px;
    }

    .notes-modal-footer {
        padding: 16px 22px 20px;
    }

    .notes-empty {
        padding: 50px 24px;
    }

    .notes-empty .notes-empty-icon {
        font-size: 56px;
    }

    .notes-empty h2 {
        font-size: 24px;
    }

    .notes-empty p {
        font-size: 15px;
    }

    .reminder-toast {
        bottom: 20px;
        right: 16px;
        left: 16px;
        max-width: none;
        width: auto;
        border-radius: 16px;
    }

    .drawing-canvas {
        min-height: 220px;
    }

    .notes-editor-attachments {
        padding: 14px 16px;
    }

    .attachments-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

/* Phone */
@media (max-width: 576px) {
    .notes-main {
        padding: 10px 0 20px;
    }

    .notes-container {
        padding: 0 10px;
    }

    .notes-editor {
        border-radius: 16px;
        box-shadow: 4px 4px 0px var(--black);
        border-width: 2px;
    }

    .notes-editor-header {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .notes-editor-header-left {
        width: 100%;
        flex-wrap: wrap;
    }

    .notes-editor-header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .note-color-picker label {
        display: none;
    }

    .color-option {
        width: 20px;
        height: 20px;
    }

    .notes-editor-title {
        font-size: 22px;
        padding: 12px 12px 6px;
    }

    .tags-list {
        padding: 4px 12px 10px;
    }

    .tag-pill {
        padding: 4px 10px;
        font-size: 12px;
    }

    .notes-toolbar {
        padding: 6px 10px;
        gap: 3px;
    }

    .toolbar-btn {
        width: 34px;
        height: 34px;
        font-size: 12px;
        border-width: 1px;
        border-radius: 7px;
    }

    .toolbar-divider {
        margin: 0 3px;
        height: 20px;
    }

    .color-dropdown {
        min-width: 160px;
        padding: 10px 12px;
        border-width: 2px;
        box-shadow: 3px 3px 0px var(--black);
        border-radius: 12px;
    }

    .color-swatch,
    .highlight-swatch {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }

    .color-dropdown-grid {
        gap: 6px;
    }

    .color-indicator,
    .highlight-indicator {
        width: 14px;
        height: 2px;
        bottom: 3px;
    }

    .notes-editor-blocks {
        padding: 12px 12px;
        gap: 10px;
    }

    .note-block {
        padding: 8px 10px;
        border-radius: 10px;
    }

    .text-block .text-content {
        font-size: 14px;
        line-height: 1.6;
    }

    .heading-block.h1 .heading-content {
        font-size: 22px;
    }

    .heading-block.h2 .heading-content {
        font-size: 19px;
    }

    .heading-block.h3 .heading-content {
        font-size: 16px;
    }

    .todo-item {
        padding: 6px 8px;
        gap: 10px;
    }

    .todo-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
        border-width: 2px;
    }

    .todo-text {
        font-size: 14px;
    }

    .table-wrapper {
        border-width: 2px;
        box-shadow: 3px 3px 0px var(--black);
    }

    .note-table th,
    .note-table td {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 80px;
    }

    .code-block {
        border-width: 2px;
        border-radius: 14px;
        box-shadow: 3px 3px 0px var(--black);
    }

    .code-block pre,
    .code-block .code-content,
    .code-block textarea {
        padding: 12px;
        min-height: 80px;
    }

    .code-block code,
    .code-block .code-content,
    .code-block textarea {
        font-size: 12px;
    }

    .code-header {
        padding: 10px 14px;
    }

    .draw-clear {
        padding: 5px 8px;
        font-size: 10px;
    }

    .drawing-toolbar {
        padding: 8px 10px;
        gap: 6px;
    }

    .draw-tool {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .drawing-canvas {
        min-height: 180px;
    }

    .notes-modal {
        max-width: 100%;
        border-radius: 16px;
        box-shadow: 4px 4px 0px var(--black);
        border-width: 2px;
        margin: 10px;
    }

    .notes-modal-icon {
        font-size: 40px;
    }

    .notes-modal-title {
        font-size: 20px;
    }

    .notes-modal-text {
        font-size: 14px;
    }

    .notes-modal-body input[type="text"],
    .notes-modal-body input[type="date"],
    .notes-modal-body input[type="time"],
    .notes-modal-body input[type="datetime-local"],
    .notes-modal-body textarea,
    .notes-modal-body select {
        border-width: 2px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .modal-btn {
        padding: 10px 18px;
        font-size: 14px;
        border-width: 2px;
        border-radius: 12px;
    }

    .notes-modal-footer {
        flex-direction: column;
    }

    .notes-modal-footer .modal-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .notes-empty {
        padding: 40px 16px;
    }

    .notes-empty .notes-empty-icon {
        font-size: 48px;
    }

    .notes-empty h2 {
        font-size: 20px;
    }

    .notes-empty p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .notes-empty .new-note-empty-btn {
        padding: 12px 24px;
        font-size: 14px;
        border-width: 2px;
        box-shadow: 4px 4px 0px var(--black);
    }

    .reminder-toast {
        bottom: 16px;
        right: 12px;
        left: 12px;
        padding: 16px 18px;
        border-width: 2px;
        border-radius: 14px;
        box-shadow: 4px 4px 0px var(--black);
    }

    .mobile-sidebar-toggle {
        bottom: 18px;
        left: 18px;
        width: 50px;
        height: 50px;
        font-size: 20px;
        border-width: 2px;
        box-shadow: 3px 3px 0px var(--black);
    }

    .notes-sidebar {
        width: 280px;
        min-width: 280px;
    }

    .notes-sidebar-header {
        padding: 16px 16px;
    }

    .notes-sidebar-title {
        font-size: 18px;
    }

    .notes-sidebar .new-note-btn,
    .notes-sidebar .notes-search-wrapper,
    .notes-sidebar .notes-filters,
    .notes-sidebar .notes-list {
        margin-left: 14px;
        margin-right: 14px;
    }

    .new-note-btn {
        padding: 12px 16px;
        font-size: 14px;
        border-width: 2px;
        box-shadow: 3px 3px 0px var(--black);
        margin-bottom: 14px;
    }

    .notes-search-wrapper input {
        padding: 10px 14px 10px 38px;
        font-size: 13px;
        border-width: 2px;
        border-radius: 12px;
    }

    .notes-filter-btn {
        padding: 7px 4px;
        font-size: 12px;
        border-width: 1px;
    }

    .note-card {
        border-width: 2px;
        box-shadow: 3px 3px 0px var(--black);
        border-radius: 14px;
    }

    .note-card-body {
        padding: 10px 12px;
    }

    .note-card-title {
        font-size: 14px;
    }

    .note-card-preview {
        font-size: 12px;
    }

    .attachment-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .attachment-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .attachment-name {
        font-size: 13px;
    }

    .attachment-size {
        font-size: 11px;
    }
}

/* ------------------------------------------
   UTILITY: Scrollbar Styling
   ------------------------------------------ */

.notes-editor-blocks::-webkit-scrollbar {
    width: 6px;
}

.notes-editor-blocks::-webkit-scrollbar-track {
    background: transparent;
}

.notes-editor-blocks::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.notes-editor-blocks::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* ------------------------------------------
   UTILITY: Focus visible for keyboard nav
   ------------------------------------------ */

.toolbar-btn:focus-visible,
.notes-editor-action-btn:focus-visible,
.new-note-btn:focus-visible,
.modal-btn:focus-visible,
.notes-filter-btn:focus-visible,
.note-card:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* ------------------------------------------
   UTILITY: Print styles
   ------------------------------------------ */

@media print {
    .notes-sidebar,
    .notes-toolbar,
    .notes-editor-header,
    .mobile-sidebar-toggle,
    .block-delete-btn,
    .block-drag-handle,
    .notes-editor-attachments,
    .reminder-toast {
        display: none !important;
    }

    .notes-editor {
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .notes-editor-title {
        padding: 0;
    }

    .notes-editor-blocks {
        padding: 0;
    }

    .note-block {
        break-inside: avoid;
    }

    .code-block pre {
        white-space: pre-wrap;
    }
}

/* ------------------------------------------
   TUTORIAL MODAL
   ------------------------------------------ */

.notes-tutorial-modal {
    max-width: 500px;
}

.tutorial-slides {
    position: relative;
    min-height: 240px;
}

.tutorial-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 28px 16px;
    animation: tutorialFadeIn 0.3s ease;
}

.tutorial-slide.active {
    display: flex;
}

@keyframes tutorialFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tutorial-slide-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--lime);
    border: 3px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--black);
    margin-bottom: 20px;
    box-shadow: 4px 4px 0px var(--black);
}

.tutorial-slide h3 {
    font-family: var(--font-family);
    font-size: 22px;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 12px;
}

.tutorial-slide p {
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--darkgray);
    line-height: 1.6;
    max-width: 380px;
}

.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 28px 8px;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-dot.active {
    background: var(--lime);
    border: 2px solid var(--black);
    width: 12px;
    height: 12px;
}

.tutorial-dot:hover {
    background: var(--blue);
}

.tutorial-footer {
    justify-content: space-between;
}

/* ------------------------------------------
   SHARE MODAL
   ------------------------------------------ */

.share-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-link-row input {
    flex: 1;
    padding: 12px 16px;
    border: 3px solid var(--black);
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--black);
    background: #f5f5f5;
    outline: none;
}

.share-copy-btn {
    width: 48px;
    height: 48px;
    border: 3px solid var(--black);
    border-radius: 12px;
    background: var(--lime);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--black);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.share-copy-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0px var(--black);
}

.share-socials {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-bottom: 8px;
}

.share-social-btn {
    width: 48px;
    height: 48px;
    border: 3px solid var(--black);
    border-radius: 14px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--black);
    transition: all 0.2s ease;
}

.share-social-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0px var(--black);
}

.share-social-btn:nth-child(1):hover { background: #0088cc; color: var(--white); }
.share-social-btn:nth-child(2):hover { background: #25D366; color: var(--white); }
.share-social-btn:nth-child(3):hover { background: #1DA1F2; color: var(--white); }
.share-social-btn:nth-child(4):hover { background: var(--pink); color: var(--white); }

/* ------------------------------------------
   DAYS LEFT BADGE (Free users)
   ------------------------------------------ */

.note-card-days {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.note-card-days i {
    font-size: 10px;
}

.note-card-days.days-ok {
    background: rgba(198, 223, 43, 0.2);
    color: #5a7a00;
}

.note-card-days.days-warn {
    background: rgba(255, 159, 0, 0.2);
    color: #b36d00;
}

.note-card-days.days-danger {
    background: rgba(255, 78, 153, 0.2);
    color: #cc3d7a;
}
