/* ============================================================================
   NOTE ANALYZER — AI panel for project + task extraction from notes
   ============================================================================ */

.note-analyzer-panel {
    /* Fixed (not absolute) so it anchors to the viewport regardless of any
       transformed ancestor. top:80px clears the note modal's header
       (which sits at top:16-72px and contains the toolbar buttons we
       trigger from). z-index above the note modal's 1002 so it always
       paints on top — without this the modal swallows the panel. */
    position: fixed;
    top: 80px;
    right: 16px;
    width: 360px;
    max-height: calc(100vh - 120px);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    overflow-y: auto;
    z-index: var(--z-layer-sheet);
    font-family: var(--font-family);
    animation: note-analyzer-slide-in var(--duration-normal) var(--ease-in-out);
}

@keyframes note-analyzer-slide-in {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.note-analyzer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.note-analyzer-icon { font-size: var(--font-size-14); }

.note-analyzer-title {
    font-weight: 600;
    font-size: var(--font-size-14);
    flex: 1;
}

.note-analyzer-badge {
    background: rgba(74, 144, 217, 0.1);
    color: var(--accent-blue);
    font-size: var(--font-size-2xs);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.note-analyzer-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-18);
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
}

.note-analyzer-close:hover { color: var(--text-primary); }

.note-analyzer-section-heading {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    padding: 12px 16px 8px;
}

/* Project section */
.note-analyzer-project { padding: 0 0 8px; }

.note-analyzer-project-card {
    margin: 0 16px;
    padding: 12px;
    background: rgba(74, 144, 217, 0.05);
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: var(--radius-md);
}

.note-analyzer-project-name,
.note-analyzer-project-desc {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    padding: 8px;
    font-size: var(--font-size-14);
    font-family: inherit;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.note-analyzer-project-name { font-weight: 600; }
.note-analyzer-project-desc { resize: vertical; min-height: 40px; }

.note-analyzer-project-sections {
    font-size: var(--font-size-12);
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.note-analyzer-project-create {
    width: 100%;
    background: var(--accent-fill);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-in-out);
}

.note-analyzer-project-create:hover { background: var(--accent-blue-dark, #357ABD); }
.note-analyzer-project-create:disabled { opacity: 0.6; cursor: not-allowed; }

/* Tasks section */
.note-analyzer-tasks { padding: 0 16px 16px; }

.note-analyzer-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.note-analyzer-task-row:last-child { border-bottom: none; }

.note-analyzer-task-title {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.note-analyzer-task-create {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: var(--radius-md);
    padding: 4px 12px;
    font-size: var(--font-size-12);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-in-out), color var(--duration-fast) var(--ease-in-out);
}

.note-analyzer-task-create:hover { background: var(--accent-fill); color: #fff; }
.note-analyzer-task-create:disabled { opacity: 0.6; cursor: not-allowed; }

/* States */
.note-analyzer-panel.is-loading .note-analyzer-header { color: var(--text-secondary); }
.note-analyzer-panel.is-error .note-analyzer-header { color: var(--color-red-text); }

.note-analyzer-upgrade-btn {
    background: var(--accent-fill);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
}

.note-analyzer-body { padding: 16px; }
.note-analyzer-body p { margin: 0 0 8px; font-size: var(--font-size-sm); color: var(--text-secondary); }

/* Toolbar AI button */
.note-analyze-btn svg { width: 18px; height: 18px; }
.note-analyze-btn:hover svg { color: var(--accent-blue); }

/* ============================================================================
   END NOTE ANALYZER
   ============================================================================ */
