:root {
    --notion-bg: rgb(251, 251, 250);
    --notion-text: rgb(44, 44, 43);
    --notion-gray: rgba(44, 44, 43, 0.65);
    --notion-light-gray: rgba(44, 44, 43, 0.16);
    --notion-border: rgba(44, 44, 43, 0.16);
    --notion-hover: rgba(44, 44, 43, 0.08);
    --notion-select: rgba(46, 170, 220, 0.2);
    --notion-callout-bg: rgba(235, 236, 237, 0.3);
    --notion-link: inherit;
    --font-family: ui-sans-serif, -apple-system, "system-ui", "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", "Noto Sans Arabic", "Noto Sans Hebrew", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --notion-bg: rgb(25, 25, 25);
        --notion-text: rgb(240, 239, 237);
        --notion-gray: rgba(255, 255, 255, 0.443);
        --notion-light-gray: rgba(255, 255, 255, 0.094);
        --notion-border: rgba(255, 255, 255, 0.094);
        --notion-hover: rgba(255, 255, 255, 0.055);
        --notion-callout-bg: rgba(255, 255, 255, 0.03);
    }
}

:root[data-theme="dark"] {
    --notion-bg: rgb(25, 25, 25);
    --notion-text: rgb(240, 239, 237);
    --notion-gray: rgba(255, 255, 255, 0.443);
    --notion-light-gray: rgba(255, 255, 255, 0.094);
    --notion-border: rgba(255, 255, 255, 0.094);
    --notion-hover: rgba(255, 255, 255, 0.055);
    --notion-callout-bg: rgba(255, 255, 255, 0.03);
}

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

body {
    font-family: var(--font-family);
    color: var(--notion-text);
    background: var(--notion-bg);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

b, strong { font-weight: 600; }

/* Canvas Background */
#blossom-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; opacity: 0.7;
}

/* Notion Scaffolding */
.notion-app { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
.notion-cover { width: 100%; height: 30vh; min-height: 200px; max-height: 30vh; position: relative; overflow: hidden; }
.notion-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 50%; }

.notion-page {
    width: 100%; max-width: 900px; margin: 0 auto; padding: 0 96px 30vh 96px; display: flex; flex-direction: column;
}

/* Header & Icon */
.notion-header { display: flex; flex-direction: column; }
.notion-icon-container {
    width: 120px; height: 120px; margin-top: -60px; margin-bottom: 12px; position: relative; z-index: 10; background: transparent;
}
.notion-page-icon { width: 100%; height: 100%; object-fit: cover; }

/* Page Title */
.notion-title {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.2;
    padding: 3px 2px;
    margin-bottom: 4px;
    color: var(--notion-text);
}

/* Typography and Blocks */

/* Large centered quote (custom) */
.notion-quote-large {
    font-size: 24px;
    font-weight: 600;
    line-height: 31.2px;
    padding: 3px 2px;
    margin: 4px 0;
    text-align: center;
}

/* H1 - Notion header block */
.notion-h1 {
    font-size: 30px;
    font-weight: 600;
    line-height: 39px;
    padding: 3px 2px;
    margin-top: 32px;
    margin-bottom: 4px;
    color: var(--notion-text);
}

/* H2 - Notion sub_header block */
.notion-h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 31.2px;
    padding: 3px 2px;
    margin-top: 22px;
    margin-bottom: 1px;
    color: var(--notion-text);
}

/* H3 - Notion sub_sub_header block */
.notion-h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
    padding: 3px 2px;
    margin-top: 16px;
    margin-bottom: 1px;
    color: var(--notion-text);
}

/* Blue background headings */
.notion-h1.bg-blue,
.notion-h2.bg-blue {
    background: rgb(214, 232, 249);
    padding: 3px 2px;
    border-radius: 2px;
    display: block;
}

:root[data-theme="dark"] .notion-h1.bg-blue,
:root[data-theme="dark"] .notion-h2.bg-blue {
    background: rgba(29, 59, 83, 0.7);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .notion-h1.bg-blue,
    :root:not([data-theme="light"]) .notion-h2.bg-blue {
        background: rgba(29, 59, 83, 0.7);
    }
}

/* Text blocks */
.notion-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    padding: 3px 2px;
    margin-top: 2px;
    margin-bottom: 1px;
    min-height: 24px;
    color: var(--notion-text);
}

.notion-text-italic {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    padding: 3px 2px;
    margin-top: 2px;
    margin-bottom: 1px;
    min-height: 24px;
    font-style: italic;
    color: var(--notion-text);
}

/* Bulleted list */
.notion-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notion-list li {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    padding: 3px 2px 3px 2px;
    margin-top: 1px;
    margin-bottom: 1px;
    color: var(--notion-text);
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.notion-list li::before {
    content: "•";
    font-size: 16px;
    line-height: 24px;
    margin-right: 8px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* Numbered list */
.notion-list-numbered {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: notion-counter;
}

.notion-list-numbered li {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    padding: 3px 2px 3px 2px;
    margin-top: 1px;
    margin-bottom: 1px;
    color: var(--notion-text);
    display: flex;
    align-items: flex-start;
    counter-increment: notion-counter;
}

.notion-list-numbered li::before {
    content: counter(notion-counter) ".";
    font-size: 16px;
    line-height: 24px;
    margin-right: 8px;
    flex-shrink: 0;
    width: 24px;
    text-align: right;
}

/* Quote block */
.notion-quote {
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    padding: 3px 2px 3px 14px;
    margin-top: 4px;
    margin-bottom: 4px;
    border-left: 3px solid var(--notion-text);
    color: var(--notion-text);
}

/* Divider */
.notion-divider {
    margin-top: 1px;
    margin-bottom: 1px;
    padding: 6px 0;
}

.notion-divider::after {
    content: "";
    display: block;
    height: 1px;
    background: var(--notion-border);
}

/* Link */
.notion-link {
    color: var(--notion-link);
    text-decoration: underline;
    text-decoration-color: var(--notion-gray);
    opacity: 0.8;
}
.notion-link:hover { opacity: 1; }

/* Image */
.notion-image {
    max-width: 100%;
    width: auto;
    border-radius: 4px;
    margin-top: 1em;
    margin-bottom: 1em;
}

/* Properties Block */
.notion-properties {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    font-size: 14px;
}
.notion-property-row {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
    min-height: 34px;
}
.notion-property-label {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--notion-gray);
    padding-right: 12px;
    line-height: 1.5;
    font-size: 14px;
}
.property-icon {
    width: 18px;
    margin-right: 6px;
    display: inline-block;
    text-align: center;
}
.notion-property-value {
    flex-grow: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.5;
    word-break: break-word;
    font-size: 14px;
    padding: 3px 0;
}
.notion-property-value.empty {
    color: var(--notion-light-gray);
    font-style: italic;
    opacity: 0.5;
}
.hidden-prop { display: none; }
.notion-properties.expanded .hidden-prop { display: flex; }
.notion-property-toggle {
    padding: 3px 0;
    font-size: 14px;
    color: var(--notion-gray);
    cursor: pointer;
    user-select: none;
}
.notion-property-toggle:hover { color: var(--notion-text); }
.prop-toggle-icon { display: inline-block; transition: transform 0.2s; font-size: 12px; }
.notion-properties.expanded .prop-toggle-icon { transform: rotate(90deg); }

/* Notion Style Tags */
.notion-tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    border-radius: 3px;
    font-size: 14px;
    line-height: 120%;
    white-space: nowrap;
}
.notion-tag.pink { background-color: rgba(225, 98, 89, 0.2); color: #e16259; }
.notion-tag.blue { background-color: rgba(0, 120, 223, 0.2); color: #0078df; }
.notion-tag.gray { background-color: rgba(145, 145, 142, 0.2); color: #91918e; }
.notion-tag.purple { background-color: rgba(144, 101, 176, 0.2); color: #9065b0; }
.notion-tag.green { background-color: rgba(15, 123, 108, 0.2); color: #0f7b6c; }
.notion-tag.yellow { background-color: rgba(203, 145, 47, 0.2); color: #cb912f; }
.notion-tag.orange { background-color: rgba(217, 115, 13, 0.2); color: #d9730d; }
.notion-tag.brown { background-color: rgba(159, 107, 83, 0.2); color: #9f6b53; }
.notion-tag.red { background-color: rgba(255, 116, 105, 0.525); color: #d44c47; }
.notion-tag.lightyellow { background-color: rgba(255, 252, 235, 0.306); color: #998200; }
.notion-tag.peach { background-color: rgba(255, 184, 132, 0.365); color: #d9730d; }

/* Cursor Selector UI */
.cursor-selector {
    position: fixed; bottom: 24px; left: 24px; display: flex; align-items: center; gap: 6px;
    background: var(--notion-bg); padding: 6px; border-radius: 12px;
    border: 1px solid var(--notion-border); box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 1000;
}
.cursor-current {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; cursor: pointer; font-size: 22px; user-select: none;
    transition: background 0.2s;
}
.cursor-current:hover { background: var(--notion-hover); }
.cursor-options {
    display: none; position: absolute; bottom: 48px; left: 0;
    background: var(--notion-bg); border: 1px solid var(--notion-border);
    border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px;
    grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.cursor-selector.open .cursor-options { display: grid; }
.cursor-option {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; cursor: pointer; font-size: 20px; transition: all 0.15s; user-select: none;
}
.cursor-option:hover { background: var(--notion-hover); transform: scale(1.2); }
.cursor-option.active { background: var(--notion-select); border-radius: 8px; }

/* Effect Button (separate from cursor) */
.effect-btn {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 20px; border: 1px solid var(--notion-border);
    background: var(--notion-bg); box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer; font-size: 14px; color: var(--notion-text);
    font-family: var(--font-family); transition: all 0.2s; user-select: none;
}
.effect-btn:hover { box-shadow: 0 4px 16px rgba(255, 143, 163, 0.3); border-color: #ff8fa3; }
.effect-btn:active { transform: translateX(-50%) scale(0.95); }

/* Toast Notifications */
.toast-container {
    position: fixed; bottom: 70px; right: 16px; z-index: 2000;
    display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
.toast {
    padding: 8px 16px; border-radius: 8px; font-size: 13px;
    background: var(--notion-bg); border: 1px solid var(--notion-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); color: var(--notion-text);
    font-family: var(--font-family); opacity: 0; transform: translateX(40px);
    animation: toast-in 0.3s forwards, toast-out 0.3s 2.7s forwards;
    white-space: nowrap;
}
@keyframes toast-in { to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* Real-time Status Indicator */
.realtime-status {
    position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 8px;
    background: var(--notion-bg); padding: 8px 14px; border-radius: 8px;
    border: 1px solid var(--notion-border); box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000; font-size: 13px; color: var(--notion-text);
}
.pulse { width: 8px; height: 8px; background: #48bb78; border-radius: 50%; flex-shrink: 0; }

/* Top Bar */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: var(--notion-bg);
    border-bottom: 1px solid var(--notion-border);
}
.notion-original-link {
    font-size: 13px; color: var(--notion-gray); text-decoration: none;
    font-family: var(--font-family); transition: color 0.2s;
}
.notion-original-link:hover { color: var(--notion-text); }

/* Theme Toggle */
.theme-toggle {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--notion-border);
    cursor: pointer; font-size: 16px; transition: background 0.2s;
    user-select: none;
}
.theme-toggle:hover { background: var(--notion-hover); }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .notion-cover { height: 20vh; min-height: 150px; }
    .notion-page { padding: 0 16px 120px 16px; }
    .notion-icon-container { width: 78px; height: 78px; margin-top: -39px; margin-bottom: 8px; }
    .notion-title { font-size: 30px; margin-bottom: 24px; }
    .notion-property-label { width: 120px; }
    .notion-property-row { flex-direction: column; padding: 8px 0; }
    .notion-text { font-size: 15px; }
    .notion-list li { font-size: 15px; }
    .cursor-selector { bottom: 16px; left: 16px; }
    .effect-btn { bottom: 16px; left: auto; right: 16px; transform: none; font-size: 13px; padding: 6px 12px; }
    .realtime-status {
        bottom: 64px; left: 50%; right: auto; transform: translateX(-50%);
        width: auto; max-width: 90%; justify-content: center; font-size: 12px; padding: 6px 12px;
    }
    .toast-container { bottom: 108px; right: 16px; left: auto; }
    .top-bar { padding: 6px 12px; }
    .notion-original-link { font-size: 12px; }
}
