/* ============================================================
   PLOTFY — Base Application Styles
   Uses design tokens from plotfy-tokens.css
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-quiet);
}

    a:hover {
        color: var(--accent-hover);
    }

::selection {
    background: var(--selection-bg);
    color: var(--selection-fg);
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

[contenteditable]:not(.editor-content):not(.editor-chapter-title):not(.chapter-item-subtitle):not(.stash-note-content):not(:focus) {
    border: 1px solid transparent;
    padding: 2px 4px;
}

[contenteditable]:not(.editor-content):not(.editor-chapter-title):not(.chapter-item-subtitle):not(.stash-note-content):focus {
    outline: none;
    box-shadow: none;
    border: 1px solid var(--divider) !important;
    border-radius: 2px;
    padding: 2px 4px;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-on-accent);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: background var(--dur-fast) var(--ease-quiet);
    box-shadow: var(--sheen-amber);
}
    .btn-primary svg {
        width: 16px;
        height: 16px;
    }

    .btn-primary:hover {
        background: var(--accent-hover);
        color: var(--text-on-accent);
    }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .modal-backdrop.hidden {
        display: none;
    }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-7);
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

.modal-body {
    font-family: var(--font-serif);
    font-size: var(--text-base);
    color: var(--text-muted);
}

.modal-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.modal-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text);
    transition: all var(--dur-fast) var(--ease-quiet);
}

.modal-option--warning:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.modal-option--danger:hover {
    border-color: var(--oxblood);
    color: var(--oxblood);
    background: var(--oxblood-bg);
}

.modal-option-sub {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-normal);
    color: var(--text-faint);
}

.modal-cancel {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-faint);
    cursor: pointer;
    padding: 0;
    text-align: center;
    transition: color var(--dur-fast) var(--ease-quiet);
}

    .modal-cancel:hover {
        color: var(--text);
    }

/* ── Feedback Prompt ─────────────────────────────────────── */
.feedback-prompt {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 320px;
    background: #2a2a2a;
    color: #ffffff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-quiet), transform var(--dur-base) var(--ease-quiet);
}

    .feedback-prompt.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

.feedback-question {
    font-family: var(--font-serif);
    font-size: var(--text-base);
    color: #ffffff;
    margin-bottom: 16px;
    line-height: var(--leading-reading);
}

.feedback-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.feedback-star {
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 0;
    transition: color var(--dur-fast) var(--ease-quiet);
}

    .feedback-star.filled,
    .feedback-star:hover {
        color: var(--ember-300);
    }

.feedback-response {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    padding: 8px 12px;
    resize: none;
    margin-bottom: 16px;
    box-sizing: border-box;
}

    .feedback-response::placeholder {
        color: rgba(255,255,255,0.35);
    }

    .feedback-response:focus {
        outline: none;
        border-color: rgba(255,255,255,0.25);
    }

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.feedback-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
    transition: color var(--dur-fast) var(--ease-quiet);
}

    .feedback-dismiss:hover {
        color: rgba(255,255,255,0.75);
    }

.feedback-submit {
    background: var(--ember-500);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-quiet);
}

    .feedback-submit:hover {
        background: var(--ember-600);
    }

.nav-arrow {
    font-size: 10px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
    /* ── Shared Header ──────────────────────────────────────────── */
    
.dashboard-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.dashboard-logo {
    height: 40px;
    width: auto;
}

/* ── Shared Nav Link ────────────────────────────────────────── */
.dashboard-nav-link {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-faint);
    font-weight: var(--weight-medium);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-quiet);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

    .dashboard-nav-link:hover {
        color: var(--text-muted);
    }

    .dashboard-nav-link svg {
        width: 16px !important;
        height: 16px !important;
    }

.editor-nav-link {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-faint);
    font-weight: var(--weight-medium);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--dur-fast) var(--ease-quiet);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

    .editor-nav-link:hover {
        color: var(--text-muted);
    }

    .editor-nav-link svg {
        width: 16px;
        height: 16px;
    }

[data-theme="dusk"] .editor-nav-link {
    color: var(--text-muted);
}

    [data-theme="dusk"] .editor-nav-link:hover {
        color: var(--text);
    }

.page-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

/* usage: <span class="beta-pill">Beta</span>*/
.beta-pill {
    display: inline-flex;
    align-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent);
    vertical-align: middle;
}
