[x-cloak] {
    display: none !important;
}

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
    --notion-bg: #ffffff;
    --notion-text: #37352f;
    --notion-border: rgba(55, 53, 47, 0.16);
}

.dark {
    --notion-bg: #191919;
    --notion-text: #ffffff;
    --notion-border: rgba(255, 255, 255, 0.14);
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased;
}

code,
pre,
.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

/* Notion-style minimalist scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(55, 53, 47, 0.08);
    border-radius: 20px;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(55, 53, 47, 0.16);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* HTMX Transitions */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request.htmx-indicator {
    display: inline;
}

/* Contenteditable focus rings */
[contenteditable]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.3);
    border-radius: 2px;
}

/* Custom transitions */
.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Status Pill Base */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    height: 20px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: normal;
}

/* Drag-and-drop indicator lines */
.drop-indicator-above {
    box-shadow: 0 -2px 0 0 #d97706;
}

.drop-indicator-below {
    box-shadow: 0 2px 0 0 #d97706;
}

/* Breathing animation for Save button */
@keyframes breathing {

    0%,
    100% {
        transform: scale(1);
        background-color: rgba(55, 53, 47, 0.05);
    }

    50% {
        transform: scale(1.15);
        background-color: rgba(55, 53, 47, 0.1);
    }
}

@keyframes breathing-dark {

    0%,
    100% {
        transform: scale(1);
        background-color: rgba(255, 255, 255, 0.05);
    }

    50% {
        transform: scale(1.15);
        background-color: rgba(255, 255, 255, 0.15);
    }
}

.animate-breathing {
    animation: breathing 3s ease-in-out infinite;
}

.dark .animate-breathing {
    animation: breathing-dark 3s ease-in-out infinite;
}

/* ══════════════════════════════════════════════
   Block Editor – Text Workspace Styles
   ══════════════════════════════════════════════ */

/* Prose styles for rendered Markdown inside contenteditable blocks */
.block-content {
    outline: none;
    min-height: 1.5em;
    line-height: 1.75;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.block-content:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.dark .block-content:empty::before {
    color: #4b5563;
}

/* Headings */
.block-content.block-type-heading {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Code blocks */
.block-content.block-type-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 16px;
    white-space: pre-wrap;
    line-height: 1.6;
}

.dark .block-content.block-type-code {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Blockquote blocks */
.block-content.block-type-quote {
    border-left: 3px solid #d1d5db;
    padding-left: 16px;
    color: #6b7280;
    font-style: italic;
}

.dark .block-content.block-type-quote {
    border-left-color: #4b5563;
    color: #9ca3af;
}

/* Inline formatting inside blocks */
.block-content strong,
.block-content b {
    font-weight: 600;
}

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

.block-content s,
.block-content del {
    text-decoration: line-through;
}

.block-content code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    background: rgba(55, 53, 47, 0.06);
    padding: 2px 5px;
    border-radius: 3px;
}

.dark .block-content code {
    background: rgba(255, 255, 255, 0.08);
}

.block-content a {
    color: #d97706;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.block-content a:hover {
    color: #b45309;
}

.block-content ul,
.block-content ol {
    padding-left: 1.5em;
    margin: 0.25em 0;
}

.block-content ul {
    list-style-type: disc;
}

.block-content ol {
    list-style-type: decimal;
}

.block-content li {
    margin: 0.15em 0;
}

/* Editor formatting toolbar – matches main toolbar aesthetic */
.block-toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0;
}

.block-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    flex-shrink: 0;
}

.dark .block-toolbar button {
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
}

.block-toolbar button:hover {
    background: #e5e7eb;
    color: #111827;
}

.dark .block-toolbar button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #e5e7eb;
}

.block-toolbar .separator {
    width: 1px;
    height: 18px;
    background: #e5e7eb;
    margin: 0 2px;
}

.dark .block-toolbar .separator {
    background: rgba(255, 255, 255, 0.1);
}

/* Floating add-block button – matches toolbar aesthetic */
.add-block-pill {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 3px;
    transition: all 0.15s;
}

.dark .add-block-pill {
    background: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.08);
}

.add-block-pill button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.15s;
}

.dark .add-block-pill button {
    background: rgba(255, 255, 255, 0.08);
    color: #4b5563;
}

.add-block-pill button:hover {
    background: #e5e7eb;
    color: #6b7280;
}

.dark .add-block-pill button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #6b7280;
}

/* Vertical reorder pill – matches toolbar/add-block aesthetic */
.reorder-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 3px;
    transition: all 0.15s;
}

.dark .reorder-pill {
    background: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.08);
}

.reorder-pill button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #4b5563;
    transition: all 0.15s;
}

.dark .reorder-pill button {
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
}

.reorder-pill>button:hover {
    background: #e5e7eb;
    color: #111827;
}

.dark .reorder-pill>button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #e5e7eb;
}

/* Horizontal block actions pill (Type/Delete) – matches toolbar aesthetic */
.block-actions-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 3px;
    transition: all 0.15s;
}

.dark .block-actions-pill {
    background: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Target only the primary buttons in the pill (direct children or inside relative wrapper) */
.block-actions-pill>button,
.block-actions-pill>div>button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #4b5563;
    transition: all 0.15s;
}

.dark .block-actions-pill>button,
.dark .block-actions-pill>div>button {
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
}

.block-actions-pill>button:hover,
.block-actions-pill>div>button:hover {
    background: #e5e7eb;
    color: #111827;
}

.dark .block-actions-pill>button:hover,
.dark .block-actions-pill>div>button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #e5e7eb;
}

/* Specific styling for delete button inside pill */
.block-actions-pill button.delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.dark .block-actions-pill button.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Text block drag-and-drop indicator lines */
.text-drop-indicator-above {
    box-shadow: 0 -2px 0 0 #d97706;
}

.text-drop-indicator-below {
    box-shadow: 0 2px 0 0 #d97706;
}

/* Block wrapper hover state */
.text-block-wrapper {
    position: relative;
    transition: background-color 0.15s;
}

.text-block-wrapper:hover .block-controls {
    opacity: 1;
}

.block-controls {
    opacity: 0;
    transition: opacity 0.15s;
}

/* Ensure code blocks display pre-formatted content properly */
.block-content pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: 'IBM Plex Mono', monospace;
}

/* ══════════════════════════════════════════════
   To Do Workspace – Specific Styles
   ══════════════════════════════════════════════ */

.task-text {
    min-height: 1.5em;
    cursor: text;
}

.task-text:empty::before {
    content: "Task text...";
    color: #9ca3af;
    pointer-events: none;
}

.dark .task-text:empty::before {
    color: #4b5563;
}

.task-text:focus {
    box-shadow: none !important;
    /* Managed by item hover/ring if needed */
}

.todo-drop-indicator-above {
    box-shadow: 0 -2px 0 0 #6C7156;
}

.dark .todo-drop-indicator-above {
    box-shadow: 0 -2px 0 0 #94A790;
}

.todo-drop-indicator-below {
    box-shadow: 0 2px 0 0 #6C7156;
}

.dark .todo-drop-indicator-below {
    box-shadow: 0 2px 0 0 #94A790;
}

/* Section drop zone – always at least one line tall so it's a valid drop target */
.todo-section-drop-zone {
    min-height: 4px;
}