{"id":969,"date":"2026-08-10T16:22:54","date_gmt":"2026-08-10T16:22:54","guid":{"rendered":"https:\/\/freewebtools.co.in\/?page_id=969"},"modified":"2026-08-10T16:29:12","modified_gmt":"2026-08-10T16:29:12","slug":"ai-notes-smart-copy","status":"publish","type":"page","link":"https:\/\/freewebtools.co.in\/index.php\/ai-notes-smart-copy\/","title":{"rendered":"AI Notes Smart Copy"},"content":{"rendered":"\n<!-- ============================================================ -->\n# AI NOTES SMART COPY &#8211; PRODUCTION TOOL (100% FUNCTIONAL)\n<!-- ============================================================ -->\n<div id=\"ai-notes-smart-copy-app\">\n    <!-- Header -->\n    <header class=\"ansc-header\">\n        <div class=\"ansc-title-area\">\n            <h1>AI Notes Smart Copy<\/h1>\n            <p>Paste &bull; Detect &bull; Format &bull; Edit &bull; Preview &bull; Copy &bull; Download &bull; Save<\/p>\n        <\/div>\n        <div class=\"ansc-header-actions\">\n            <span id=\"ansc-autosave-status\" class=\"ansc-autosave-indicator\">Saved \u2713<\/span>\n            <button class=\"ansc-btn\" id=\"ansc-theme-toggle\" title=\"Toggle Light\/Dark Theme\">\ud83c\udf19 Theme<\/button>\n            <button class=\"ansc-btn ansc-btn-primary\" id=\"ansc-save-btn\" title=\"Save Note (Ctrl+S)\">\ud83d\udcbe Save Notes<\/button>\n        <\/div>\n    <\/header>\n\n    <!-- Empty State -->\n    <div id=\"ansc-empty-state-view\" class=\"ansc-empty-state\">\n        <h2>Transform Your Messy Notes<\/h2>\n        <p>Paste your class notes, web excerpts, or study material to automatically format them into clean, structured study notes.<\/p>\n        <button class=\"ansc-btn ansc-btn-primary\" id=\"ansc-empty-paste-btn\">\ud83d\udccb Paste Notes<\/button>\n    <\/div>\n\n    <!-- Main App Container -->\n    <div id=\"ansc-main-container\" class=\"ansc-hidden\">\n        \n        <!-- Note Title & Format Options -->\n        <div class=\"ansc-options-section\">\n            <div class=\"ansc-option-group\">\n                <label for=\"ansc-note-title\">Note Title<\/label>\n                <input type=\"text\" id=\"ansc-note-title\" class=\"ansc-input\" placeholder=\"Untitled Note\">\n            <\/div>\n            <div class=\"ansc-option-group\">\n                <label for=\"ansc-format-style\">Format Style<\/label>\n                <select id=\"ansc-format-style\" class=\"ansc-select\">\n                    <option value=\"clean\">Clean Notes<\/option>\n                    <option value=\"study\">Study Notes<\/option>\n                    <option value=\"school\">School Notes<\/option>\n                    <option value=\"college\">College Notes<\/option>\n                    <option value=\"exam\">Exam Revision<\/option>\n                    <option value=\"quick\">Quick Revision<\/option>\n                    <option value=\"detailed\">Detailed Notes<\/option>\n                    <option value=\"cornell\">Cornell-style Notes<\/option>\n                    <option value=\"outline\">Outline Notes<\/option>\n                    <option value=\"bullet\">Bullet Notes<\/option>\n                    <option value=\"qa\">Q&amp;A Notes<\/option>\n                    <option value=\"flashcard\">Flashcard Ready<\/option>\n                <\/select>\n            <\/div>\n            <div class=\"ansc-option-group\" style=\"justify-content: flex-end;\">\n                <label>&nbsp;<\/label>\n                <div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n                    <button class=\"ansc-btn ansc-btn-primary\" id=\"ansc-format-notes-btn\" title=\"Format Notes (Ctrl+Enter)\">\u2728 Format Notes<\/button>\n                    <button class=\"ansc-btn\" id=\"ansc-detect-btn\">\ud83d\udd0d Detect Structure<\/button>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Advanced Controls & Formatting Toggles -->\n        <div class=\"ansc-options-section\" style=\"grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\">\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-headings\" checked> Auto Headings<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-bullets\" checked> Format Lists<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-highlight\" checked> Bold Key Terms<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-definitions\" checked> Detect Definitions<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-examples\" checked> Detect Examples<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-important\" checked> Important Callouts<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-qa\" checked> Detect Q&amp;A<\/label>\n            <label class=\"ansc-checkbox-group\"><input type=\"checkbox\" id=\"ansc-chk-spaces\" checked> Clean Extra Spaces<\/label>\n        <\/div>\n\n        <!-- Two Panel Workspace -->\n        <div class=\"ansc-workspace\">\n            <!-- LEFT PANEL: INPUT -->\n            <div class=\"ansc-panel\">\n                <div class=\"ansc-panel-header\">\n                    <span class=\"ansc-panel-title\">Input Notes<\/span>\n                    <div class=\"ansc-toolbar\">\n                        <button class=\"ansc-btn\" id=\"ansc-paste-btn\" title=\"Paste from Clipboard\">\ud83d\udccb Paste<\/button>\n                        <button class=\"ansc-btn\" id=\"ansc-clear-btn\" title=\"Clear Input\">\ud83d\uddd1\ufe0f Clear<\/button>\n                    <\/div>\n                <\/div>\n\n                <div class=\"ansc-search-bar\">\n                    <input type=\"text\" id=\"ansc-input-search\" class=\"ansc-input\" placeholder=\"Search in input...\">\n                    <button class=\"ansc-btn\" id=\"ansc-input-search-btn\">Find<\/button>\n                <\/div>\n\n                <textarea id=\"ansc-textarea\" class=\"ansc-textarea\" placeholder=\"Paste your messy notes here...\"><\/textarea>\n\n                <div class=\"ansc-stats-bar\">\n                    <div class=\"ansc-stat-item\">Words: <span id=\"ansc-stat-words\">0<\/span><\/div>\n                    <div class=\"ansc-stat-item\">Chars: <span id=\"ansc-stat-chars\">0<\/span><\/div>\n                    <div class=\"ansc-stat-item\">Lines: <span id=\"ansc-stat-lines\">0<\/span><\/div>\n                    <div class=\"ansc-stat-item\">Paragraphs: <span id=\"ansc-stat-paras\">0<\/span><\/div>\n                    <div class=\"ansc-stat-item\">Reading Time: <span id=\"ansc-stat-time\">0m<\/span><\/div>\n                <\/div>\n            <\/div>\n\n            <!-- RIGHT PANEL: FORMATTED OUTPUT \/ PREVIEW \/ FLASHCARD \/ SEARCH & REPLACE -->\n            <div class=\"ansc-panel\">\n                <div class=\"ansc-panel-header\">\n                    <span class=\"ansc-panel-title\" id=\"ansc-output-title\">Formatted Notes<\/span>\n                    <div class=\"ansc-toolbar\">\n                        <button class=\"ansc-btn ansc-view-mode-btn\" data-mode=\"edit\" style=\"background-color: var(--ansc-surface-alt);\">\u270f\ufe0f Edit<\/button>\n                        <button class=\"ansc-btn ansc-view-mode-btn\" data-mode=\"preview\">\ud83d\udc41\ufe0f Preview<\/button>\n                        <button class=\"ansc-btn ansc-view-mode-btn\" data-mode=\"compare\">\ud83d\udcca Before\/After<\/button>\n                        <button class=\"ansc-btn ansc-view-mode-btn\" data-mode=\"searchreplace\">\ud83d\udd0d Find\/Replace<\/button>\n                    <\/div>\n                <\/div>\n\n                <!-- Editable Output Mode -->\n                <div id=\"ansc-editor-view\" class=\"ansc-subview\" style=\"display: flex; flex-direction: column; flex-grow: 1; gap: 8px;\">\n                    <textarea id=\"ansc-output-editor\" class=\"ansc-output-editor\" placeholder=\"Formatted output will appear here...\"><\/textarea>\n                    <div class=\"ansc-toolbar\">\n                        <button class=\"ansc-btn\" id=\"ansc-undo-btn\" title=\"Undo (Ctrl+Z)\">\u21a9\ufe0f Undo<\/button>\n                        <button class=\"ansc-btn\" id=\"ansc-redo-btn\" title=\"Redo (Ctrl+Y)\">\u21aa\ufe0f Redo<\/button>\n                        <button class=\"ansc-btn\" id=\"ansc-clean-formatting-btn\">\u2728 Clean Formatting<\/button>\n                    <\/div>\n                <\/div>\n\n                <!-- Clean Preview Mode -->\n                <div id=\"ansc-preview-view\" class=\"ansc-preview-container ansc-hidden\"><\/div>\n\n                <!-- Before \/ After Mode -->\n                <div id=\"ansc-compare-view\" class=\"ansc-preview-container ansc-hidden\" style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 12px;\">\n                    <div>\n                        <strong>Original:<\/strong>\n                        <div id=\"ansc-compare-original\" style=\"font-size: 0.85rem; white-space: pre-wrap; margin-top: 6px; color: var(--ansc-text-muted);\"><\/div>\n                    <\/div>\n                    <div>\n                        <strong>Formatted:<\/strong>\n                        <div id=\"ansc-compare-formatted\" style=\"font-size: 0.85rem; white-space: pre-wrap; margin-top: 6px;\"><\/div>\n                    <\/div>\n                <\/div>\n\n                <!-- Search & Replace Mode -->\n                <div id=\"ansc-searchreplace-view\" class=\"ansc-preview-container ansc-hidden\" style=\"display: flex; flex-direction: column; gap: 12px;\">\n                    <div style=\"display: flex; gap: 8px; flex-wrap: wrap;\">\n                        <input type=\"text\" id=\"ansc-sr-find\" class=\"ansc-input\" placeholder=\"Find text...\" style=\"flex:1; min-width:140px;\">\n                        <input type=\"text\" id=\"ansc-sr-replace\" class=\"ansc-input\" placeholder=\"Replace with...\" style=\"flex:1; min-width:140px;\">\n                    <\/div>\n                    <div class=\"ansc-toolbar\">\n                        <button class=\"ansc-btn\" id=\"ansc-sr-find-btn\">Find Next<\/button>\n                        <button class=\"ansc-btn\" id=\"ansc-sr-replace-btn\">Replace<\/button>\n                        <button class=\"ansc-btn\" id=\"ansc-sr-replaceall-btn\">Replace All<\/button>\n                        <span id=\"ansc-sr-status\" style=\"font-size: 0.85rem; color: var(--ansc-text-muted);\">Matches: 0<\/span>\n                    <\/div>\n                <\/div>\n\n                <!-- Flashcard Mode View -->\n                <div id=\"ansc-flashcard-view\" class=\"ansc-preview-container ansc-hidden\" style=\"display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px;\">\n                    <div id=\"ansc-fc-card\" style=\"background: var(--ansc-surface); border: 1px solid var(--ansc-border); border-radius: 12px; padding: 24px; width: 100%; max-width: 450px; min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: var(--ansc-shadow); cursor: pointer;\">\n                        <div id=\"ansc-fc-type\" style=\"font-size: 0.75rem; text-transform: uppercase; color: var(--ansc-primary); font-weight: 700; margin-bottom: 8px;\">Question \/ Term<\/div>\n                        <div id=\"ansc-fc-content\" style=\"font-size: 1.1rem; font-weight: 600;\">Click format to generate flashcards from your notes.<\/div>\n                    <\/div>\n                    <div class=\"ansc-toolbar\" style=\"justify-content: center;\">\n                        <button class=\"ansc-btn\" id=\"ansc-fc-prev\">\u25c0 Previous<\/button>\n                        <span id=\"ansc-fc-counter\" style=\"font-size: 0.85rem;\">0 \/ 0<\/span>\n                        <button class=\"ansc-btn\" id=\"ansc-fc-next\">Next \u25b6<\/button>\n                    <\/div>\n                <\/div>\n\n                <!-- Format Summary Bar & Copy Toolbar -->\n                <div class=\"ansc-stats-bar\" style=\"justify-content: space-between; align-items: center;\">\n                    <div id=\"ansc-format-summary\">Ready<\/div>\n                    <div class=\"ansc-toolbar\" style=\"margin: 0;\">\n                        <select id=\"ansc-copy-dropdown\" class=\"ansc-select\" style=\"width: auto; padding: 6px; background-color: var(--ansc-primary); color: var(--ansc-primary-text); font-weight: 600;\">\n                            <option value=\"\" disabled selected>\ud83d\udccb Copy Formats&#8230;<\/option>\n                            <option value=\"formatted\">Copy Formatted Notes<\/option>\n                            <option value=\"plain\">Copy Plain Text<\/option>\n                            <option value=\"markdown\">Copy Markdown<\/option>\n                            <option value=\"html\">Copy HTML<\/option>\n                        <\/select>\n                        <select id=\"ansc-download-select\" class=\"ansc-select\" style=\"width: auto; padding: 6px;\">\n                            <option value=\"\" disabled selected>Download&#8230;<\/option>\n                            <option value=\"txt\">Download .txt<\/option>\n                            <option value=\"md\">Download .md<\/option>\n                            <option value=\"html\">Download .html<\/option>\n                        <\/select>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Recent Notes Section -->\n        <div class=\"ansc-recent-container\">\n            <div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;\">\n                <strong>Recent Notes<\/strong>\n                <button class=\"ansc-btn\" id=\"ansc-new-note-btn\" style=\"padding: 4px 10px; font-size: 0.75rem;\">\u2795 New Note<\/button>\n            <\/div>\n            <ul id=\"ansc-recent-list\" class=\"ansc-recent-list\"><\/ul>\n        <\/div>\n\n    <\/div>\n\n    <!-- Toast Notification -->\n    <div id=\"ansc-toast\" class=\"ansc-toast\">Action completed successfully<\/div>\n<\/div>\n\n<style>\n\/* Scoped Application Wrapper & Prefixed Classes *\/\n#ai-notes-smart-copy-app {\n    --ansc-bg: #f8fafc;\n    --ansc-surface: #ffffff;\n    --ansc-surface-alt: #f1f5f9;\n    --ansc-text: #0f172a;\n    --ansc-text-muted: #64748b;\n    --ansc-border: #e2e8f0;\n    --ansc-primary: #3b82f6;\n    --ansc-primary-hover: #2563eb;\n    --ansc-primary-text: #ffffff;\n    --ansc-accent: #10b981;\n    --ansc-danger: #ef4444;\n    --ansc-radius: 8px;\n    --ansc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n    font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n    background-color: var(--ansc-bg);\n    color: var(--ansc-text);\n    line-height: 1.5;\n    padding: 16px;\n    box-sizing: border-box;\n    width: 100%;\n    max-width: 1400px;\n    margin: 0 auto;\n    position: relative;\n}\n\n#ai-notes-smart-copy-app.dark-theme {\n    --ansc-bg: #0f172a;\n    --ansc-surface: #1e293b;\n    --ansc-surface-alt: #0f172a;\n    --ansc-text: #f8fafc;\n    --ansc-text-muted: #94a3b8;\n    --ansc-border: #334155;\n    --ansc-primary: #3b82f6;\n    --ansc-primary-hover: #60a5fa;\n    --ansc-primary-text: #ffffff;\n}\n\n#ai-notes-smart-copy-app * {\n    box-sizing: border-box;\n}\n\n.ansc-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 20px;\n    flex-wrap: wrap;\n    gap: 12px;\n    border-bottom: 1px solid var(--ansc-border);\n    padding-bottom: 16px;\n}\n\n.ansc-title-area h1 {\n    font-size: 1.5rem;\n    font-weight: 700;\n    margin: 0 0 4px 0;\n    color: var(--ansc-text);\n}\n\n.ansc-title-area p {\n    font-size: 0.875rem;\n    color: var(--ansc-text-muted);\n    margin: 0;\n}\n\n.ansc-header-actions {\n    display: flex;\n    gap: 8px;\n    flex-wrap: wrap;\n    align-items: center;\n}\n\n.ansc-autosave-indicator {\n    font-size: 0.75rem;\n    color: var(--ansc-accent);\n    font-weight: 600;\n    margin-right: 8px;\n}\n\n.ansc-btn {\n    background-color: var(--ansc-surface);\n    color: var(--ansc-text);\n    border: 1px solid var(--ansc-border);\n    padding: 8px 14px;\n    border-radius: var(--ansc-radius);\n    font-size: 0.875rem;\n    font-weight: 500;\n    cursor: pointer;\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    transition: background-color 0.2s, border-color 0.2s;\n}\n\n.ansc-btn:hover {\n    background-color: var(--ansc-surface-alt);\n    border-color: var(--ansc-text-muted);\n}\n\n.ansc-btn-primary {\n    background-color: var(--ansc-primary);\n    color: var(--ansc-primary-text);\n    border-color: var(--ansc-primary);\n}\n\n.ansc-btn-primary:hover {\n    background-color: var(--ansc-primary-hover);\n    border-color: var(--ansc-primary-hover);\n}\n\n.ansc-btn:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n}\n\n.ansc-workspace {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 20px;\n    margin-bottom: 20px;\n}\n\n@media (max-width: 1024px) {\n    .ansc-workspace {\n        grid-template-columns: 1fr;\n    }\n}\n\n.ansc-panel {\n    background-color: var(--ansc-surface);\n    border: 1px solid var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    padding: 16px;\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n    box-shadow: var(--ansc-shadow);\n    min-height: 500px;\n}\n\n.ansc-panel-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    border-bottom: 1px solid var(--ansc-border);\n    padding-bottom: 8px;\n    flex-wrap: wrap;\n    gap: 8px;\n}\n\n.ansc-panel-title {\n    font-weight: 600;\n    font-size: 1rem;\n}\n\n.ansc-textarea, .ansc-output-editor {\n    width: 100%;\n    flex-grow: 1;\n    background-color: var(--ansc-surface-alt);\n    color: var(--ansc-text);\n    border: 1px solid var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    padding: 12px;\n    font-family: inherit;\n    font-size: 0.95rem;\n    resize: vertical;\n    min-height: 350px;\n    outline: none;\n}\n\n.ansc-textarea:focus, .ansc-output-editor:focus {\n    border-color: var(--ansc-primary);\n}\n\n.ansc-toolbar {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 8px;\n    align-items: center;\n}\n\n.ansc-stats-bar {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 14px;\n    font-size: 0.8rem;\n    color: var(--ansc-text-muted);\n    border-top: 1px solid var(--ansc-border);\n    padding-top: 8px;\n}\n\n.ansc-stat-item span {\n    font-weight: 600;\n    color: var(--ansc-text);\n}\n\n.ansc-options-section {\n    background-color: var(--ansc-surface);\n    border: 1px solid var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    padding: 16px;\n    margin-bottom: 20px;\n    display: grid;\n    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n    gap: 16px;\n}\n\n.ansc-option-group {\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n}\n\n.ansc-option-group label {\n    font-size: 0.8rem;\n    font-weight: 600;\n    color: var(--ansc-text-muted);\n}\n\n.ansc-select, .ansc-input {\n    background-color: var(--ansc-surface-alt);\n    color: var(--ansc-text);\n    border: 1px solid var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    padding: 6px 10px;\n    font-size: 0.875rem;\n    outline: none;\n    width: 100%;\n}\n\n.ansc-checkbox-group {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-size: 0.875rem;\n    cursor: pointer;\n}\n\n.ansc-preview-container {\n    background-color: var(--ansc-surface-alt);\n    border: 1px solid var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    padding: 16px;\n    flex-grow: 1;\n    overflow-y: auto;\n    min-height: 350px;\n}\n\n.ansc-empty-state {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    text-align: center;\n    padding: 40px;\n    gap: 12px;\n    flex-grow: 1;\n    border: 2px dashed var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    margin-bottom: 20px;\n}\n\n.ansc-empty-state h2 {\n    margin: 0;\n    font-size: 1.25rem;\n}\n\n.ansc-empty-state p {\n    margin: 0;\n    color: var(--ansc-text-muted);\n    font-size: 0.9rem;\n    max-width: 400px;\n}\n\n.ansc-toast {\n    position: fixed;\n    bottom: 24px;\n    right: 24px;\n    background-color: var(--ansc-text);\n    color: var(--ansc-bg);\n    padding: 10px 18px;\n    border-radius: var(--ansc-radius);\n    font-size: 0.875rem;\n    box-shadow: var(--ansc-shadow);\n    z-index: 1000;\n    opacity: 0;\n    transition: opacity 0.3s ease;\n    pointer-events: none;\n}\n.ansc-toast.show {\n    opacity: 1;\n}\n\n.ansc-search-bar {\n    display: flex;\n    gap: 6px;\n    margin-bottom: 8px;\n}\n\n.ansc-recent-container {\n    background-color: var(--ansc-surface);\n    border: 1px solid var(--ansc-border);\n    border-radius: var(--ansc-radius);\n    padding: 16px;\n    margin-top: 20px;\n}\n\n.ansc-recent-list {\n    list-style: none;\n    padding: 0;\n    margin: 8px 0 0 0;\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n    max-height: 200px;\n    overflow-y: auto;\n}\n\n.ansc-recent-item {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    padding: 8px 12px;\n    background-color: var(--ansc-surface-alt);\n    border-radius: var(--ansc-radius);\n    border: 1px solid var(--ansc-border);\n    font-size: 0.875rem;\n}\n\n.ansc-recent-info {\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n    cursor: pointer;\n    flex-grow: 1;\n}\n\n.ansc-recent-title {\n    font-weight: 600;\n}\n\n.ansc-recent-meta {\n    font-size: 0.75rem;\n    color: var(--ansc-text-muted);\n}\n\n.ansc-hidden {\n    display: none !important;\n}\n\n.ansc-highlight-term {\n    background-color: rgba(59, 130, 246, 0.15);\n    padding: 2px 4px;\n    border-radius: 4px;\n    font-weight: 600;\n}\n<\/style>\n\n<script>\n(function() {\n    let state = {\n        currentId: null,\n        inputContent: \"\",\n        formattedContent: \"\",\n        history: [],\n        historyIndex: -1,\n        title: \"\",\n        formatStyle: \"clean\",\n        theme: \"light\",\n        recentNotes: [],\n        flashcards: [],\n        currentFlashcardIndex: 0,\n        flashcardShowAnswer: false\n    };\n\n    const appEl = document.getElementById('ai-notes-smart-copy-app');\n    const emptyStateView = document.getElementById('ansc-empty-state-view');\n    const mainContainer = document.getElementById('ansc-main-container');\n    const textarea = document.getElementById('ansc-textarea');\n    const outputEditor = document.getElementById('ansc-output-editor');\n    const previewView = document.getElementById('ansc-preview-view');\n    const compareView = document.getElementById('ansc-compare-view');\n    const searchReplaceView = document.getElementById('ansc-searchreplace-view');\n    const flashcardView = document.getElementById('ansc-flashcard-view');\n    const noteTitleInput = document.getElementById('ansc-note-title');\n    const formatStyleSelect = document.getElementById('ansc-format-style');\n    const toast = document.getElementById('ansc-toast');\n    const autoSaveStatus = document.getElementById('ansc-autosave-status');\n\n    const statWords = document.getElementById('ansc-stat-words');\n    const statChars = document.getElementById('ansc-stat-chars');\n    const statLines = document.getElementById('ansc-stat-lines');\n    const statParas = document.getElementById('ansc-stat-paras');\n    const statTime = document.getElementById('ansc-stat-time');\n    const formatSummary = document.getElementById('ansc-format-summary');\n\n    let autoSaveTimer = null;\n\n    function init() {\n        const savedTheme = localStorage.getItem('ansc_theme') || 'light';\n        setTheme(savedTheme);\n\n        const savedNotes = localStorage.getItem('ansc_recent_notes');\n        if (savedNotes) {\n            try { state.recentNotes = JSON.parse(savedNotes); } catch(e) {}\n        }\n        renderRecentNotes();\n        bindEvents();\n    }\n\n    function setTheme(theme) {\n        state.theme = theme;\n        if (theme === 'dark') {\n            appEl.classList.add('dark-theme');\n            document.getElementById('ansc-theme-toggle').textContent = '\u2600\ufe0f Theme';\n        } else {\n            appEl.classList.remove('dark-theme');\n            document.getElementById('ansc-theme-toggle').textContent = '\ud83c\udf19 Theme';\n        }\n        localStorage.setItem('ansc_theme', theme);\n    }\n\n    function bindEvents() {\n        document.getElementById('ansc-theme-toggle').addEventListener('click', () => {\n            setTheme(state.theme === 'light' ? 'dark' : 'light');\n        });\n\n        document.getElementById('ansc-empty-paste-btn').addEventListener('click', handlePaste);\n        document.getElementById('ansc-paste-btn').addEventListener('click', handlePaste);\n        document.getElementById('ansc-clear-btn').addEventListener('click', handleClear);\n        document.getElementById('ansc-new-note-btn').addEventListener('click', handleNewNote);\n\n        textarea.addEventListener('input', () => {\n            state.inputContent = textarea.value;\n            updateStats();\n            checkEmptyState();\n            autoSuggestTitle();\n            triggerAutoSave();\n        });\n\n        outputEditor.addEventListener('input', () => {\n            state.formattedContent = outputEditor.value;\n            pushHistory(state.formattedContent);\n            triggerAutoSave();\n        });\n\n        noteTitleInput.addEventListener('input', () => {\n            state.title = noteTitleInput.value;\n            triggerAutoSave();\n        });\n\n        formatStyleSelect.addEventListener('change', () => {\n            state.formatStyle = formatStyleSelect.value;\n            formatNotes();\n        });\n\n        document.getElementById('ansc-format-notes-btn').addEventListener('click', formatNotes);\n        document.getElementById('ansc-detect-btn').addEventListener('click', detectStructure);\n        document.getElementById('ansc-clean-formatting-btn').addEventListener('click', cleanFormatting);\n\n        \/\/ View Mode Toggles\n        document.querySelectorAll('.ansc-view-mode-btn').forEach(btn => {\n            btn.addEventListener('click', (e) => {\n                switchView(e.currentTarget.getAttribute('data-mode'));\n            });\n        });\n\n        \/\/ Copy dropdown\n        document.getElementById('ansc-copy-dropdown').addEventListener('change', (e) => {\n            copyFormattedNotes(e.target.value);\n            e.target.value = \"\";\n        });\n\n        \/\/ Download dropdown\n        document.getElementById('ansc-download-select').addEventListener('change', (e) => {\n            downloadFile(e.target.value);\n            e.target.value = \"\";\n        });\n\n        document.getElementById('ansc-save-btn').addEventListener('click', saveCurrentNote);\n        document.getElementById('ansc-undo-btn').addEventListener('click', undo);\n        document.getElementById('ansc-redo-btn').addEventListener('click', redo);\n\n        \/\/ Search & Replace inside panel\n        document.getElementById('ansc-input-search-btn').addEventListener('click', searchInputNotes);\n        document.getElementById('ansc-input-search').addEventListener('keydown', (e) => {\n            if (e.key === 'Enter') searchInputNotes();\n        });\n\n        document.getElementById('ansc-sr-find-btn').addEventListener('click', performFind);\n        document.getElementById('ansc-sr-replace-btn').addEventListener('click', performReplace);\n        document.getElementById('ansc-sr-replaceall-btn').addEventListener('click', performReplaceAll);\n\n        \/\/ Flashcard navigation\n        document.getElementById('ansc-fc-card').addEventListener('click', toggleFlashcardAnswer);\n        document.getElementById('ansc-fc-prev').addEventListener('click', prevFlashcard);\n        document.getElementById('ansc-fc-next').addEventListener('click', nextFlashcard);\n\n        \/\/ Keyboard Shortcuts\n        document.addEventListener('keydown', (e) => {\n            if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {\n                e.preventDefault();\n                formatNotes();\n            } else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 's') {\n                e.preventDefault();\n                saveCurrentNote();\n            } else if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key.toLowerCase() === 'c') {\n                e.preventDefault();\n                copyFormattedNotes('formatted');\n            } else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'z') {\n                e.preventDefault();\n                undo();\n            } else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'y') {\n                e.preventDefault();\n                redo();\n            } else if ((e.key === 'Escape')) {\n                switchView('edit');\n            }\n        });\n    }\n\n    async function handlePaste() {\n        try {\n            const text = await navigator.clipboard.readText();\n            textarea.value += (textarea.value ? \"\\n\" : \"\") + text;\n            state.inputContent = textarea.value;\n            updateStats();\n            checkEmptyState();\n            autoSuggestTitle();\n            detectStructure();\n            showToast(\"Pasted from clipboard\");\n            triggerAutoSave();\n        } catch (err) {\n            showToast(\"Clipboard access unavailable. Please paste using Ctrl + V.\");\n        }\n    }\n\n    function handleClear() {\n        if (state.inputContent.trim().length > 0 && !confirm(\"Are you sure you want to clear your notes?\")) {\n            return;\n        }\n        textarea.value = \"\";\n        state.inputContent = \"\";\n        outputEditor.value = \"\";\n        state.formattedContent = \"\";\n        noteTitleInput.value = \"\";\n        state.title = \"\";\n        state.currentId = null;\n        updateStats();\n        checkEmptyState();\n        showToast(\"Cleared notes successfully\");\n    }\n\n    function handleNewNote() {\n        handleClear();\n    }\n\n    function checkEmptyState() {\n        if (state.inputContent.trim().length > 0) {\n            emptyStateView.classList.add('ansc-hidden');\n            mainContainer.classList.remove('ansc-hidden');\n        } else {\n            emptyStateView.classList.remove('ansc-hidden');\n            mainContainer.classList.add('ansc-hidden');\n        }\n    }\n\n    function updateStats() {\n        const text = state.inputContent;\n        const chars = text.length;\n        const words = text.trim() ? text.trim().split(\/\\s+\/).length : 0;\n        const lines = text ? text.split(\/\\r*\\n\/).length : 0;\n        const paragraphs = text ? text.split(\/\\r*\\n\\s*\\r*\\n\/).filter(p => p.trim().length > 0).length : 0;\n        const readingTime = Math.ceil(words \/ 200);\n\n        statChars.textContent = chars;\n        statWords.textContent = words;\n        statLines.textContent = lines;\n        statParas.textContent = paragraphs;\n        statTime.textContent = `${readingTime}m`;\n    }\n\n    function autoSuggestTitle() {\n        if (noteTitleInput.value.trim() !== \"\") return;\n        const lines = state.inputContent.split(\/\\r*\\n\/).filter(l => l.trim().length > 0);\n        if (lines.length > 0) {\n            let candidate = lines[0].replace(\/^[#\\-*\u20220-9.\\s]+\/, '').trim();\n            if (candidate.length > 40) candidate = candidate.substring(0, 40) + \"...\";\n            noteTitleInput.value = candidate;\n            state.title = candidate;\n        }\n    }\n\n    function parseStructure(raw) {\n        const lines = raw.split(\/\\r*\\n\/);\n        let structure = [];\n        let headingsCount = 0;\n        let sectionsCount = 0;\n        let listsCount = 0;\n        let importantCount = 0;\n        let flashcardsList = [];\n\n        const useHeadings = document.getElementById('ansc-chk-headings').checked;\n        const useBullets = document.getElementById('ansc-chk-bullets').checked;\n        const useDefinitions = document.getElementById('ansc-chk-definitions').checked;\n        const useExamples = document.getElementById('ansc-chk-examples').checked;\n        const useImportant = document.getElementById('ansc-chk-important').checked;\n        const useQa = document.getElementById('ansc-chk-qa').checked;\n        const useSpaces = document.getElementById('ansc-chk-spaces').checked;\n\n        let currentList = null;\n\n        lines.forEach(line => {\n            let trimmed = line.trim();\n            if (!trimmed) {\n                if (currentList) {\n                    structure.push(currentList);\n                    currentList = null;\n                }\n                if (useSpaces) return;\n                structure.push({ type: 'empty', text: '' });\n                return;\n            }\n\n            if (useHeadings && ((trimmed.toUpperCase() === trimmed && trimmed.length < 50 &#038;&#038; !trimmed.endsWith('.')) || \n                (trimmed.length < 40 &#038;&#038; \/^(chapter|unit|section|module|topic)\\s*\\d*[:\\-]\/i.test(trimmed)))) {\n                if (currentList) { structure.push(currentList); currentList = null; }\n                structure.push({ type: 'heading', text: trimmed });\n                headingsCount++;\n                sectionsCount++;\n                return;\n            }\n\n            if (useBullets &#038;&#038; \/^[\\*\\-\\\u2022]\\s+\/.test(trimmed)) {\n                let itemText = trimmed.replace(\/^[\\*\\-\\\u2022]\\s+\/, '');\n                if (!currentList || currentList.type !== 'bullet_list') {\n                    if (currentList) structure.push(currentList);\n                    currentList = { type: 'bullet_list', items: [] };\n                }\n                currentList.items.push(itemText);\n                listsCount++;\n                return;\n            }\n\n            if (useBullets &#038;&#038; \/^\\d+[\\.\\)]\\s+\/.test(trimmed)) {\n                let itemText = trimmed.replace(\/^\\d+[\\.\\)]\\s+\/, '');\n                if (!currentList || currentList.type !== 'numbered_list') {\n                    if (currentList) structure.push(currentList);\n                    currentList = { type: 'numbered_list', items: [] };\n                }\n                currentList.items.push(itemText);\n                listsCount++;\n                return;\n            }\n\n            if (currentList) {\n                structure.push(currentList);\n                currentList = null;\n            }\n\n            if (useDefinitions &#038;&#038; \/^(definition|meaning|what is):?\/i.test(trimmed)) {\n                let defText = trimmed.replace(\/^(definition|meaning|what is):?\/i, '').trim();\n                structure.push({ type: 'definition', text: defText });\n                importantCount++;\n                flashcardsList.push({ q: \"Definition \/ Term\", a: defText });\n                return;\n            }\n\n            if (useExamples &#038;&#038; \/^(example|eg|for example):?\/i.test(trimmed)) {\n                let exText = trimmed.replace(\/^(example|eg|for example):?\/i, '').trim();\n                structure.push({ type: 'example', text: exText });\n                return;\n            }\n\n            if (useImportant &#038;&#038; \/^(important|note|remember|warning|key point):?\/i.test(trimmed)) {\n                let impText = trimmed.replace(\/^(important|note|remember|warning|key point):?\/i, '').trim();\n                structure.push({ type: 'important', text: impText });\n                importantCount++;\n                return;\n            }\n\n            if (useQa &#038;&#038; \/^(q|question):?\/i.test(trimmed)) {\n                let qText = trimmed.replace(\/^(q|question):?\/i, '').trim();\n                structure.push({ type: 'question', text: qText });\n                flashcardsList.push({ q: qText, a: \"See notes for detailed answer.\" });\n                return;\n            }\n            if (useQa &#038;&#038; \/^(a|answer):?\/i.test(trimmed)) {\n                let aText = trimmed.replace(\/^(a|answer):?\/i, '').trim();\n                structure.push({ type: 'answer', text: aText });\n                if (flashcardsList.length > 0) flashcardsList[flashcardsList.length - 1].a = aText;\n                return;\n            }\n\n            structure.push({ type: 'paragraph', text: trimmed });\n        });\n\n        if (currentList) structure.push(currentList);\n\n        state.flashcards = flashcardsList;\n        return { structure, stats: { headingsCount, sectionsCount, listsCount, importantCount } };\n    }\n\n    function formatNotes() {\n        const raw = state.inputContent;\n        if (!raw.trim()) {\n            showToast(\"No content to format.\");\n            return;\n        }\n\n        const parsed = parseStructure(raw);\n        const style = state.formatStyle;\n        const useHighlight = document.getElementById('ansc-chk-highlight').checked;\n        let formattedLines = [];\n\n        if (style === 'outline') {\n            let outlineCounter = 1;\n            parsed.structure.forEach(node => {\n                if (node.type === 'heading') {\n                    formattedLines.push(`\\n${outlineCounter}. ${node.text}`);\n                    outlineCounter++;\n                } else if (node.type === 'paragraph') {\n                    formattedLines.push(`    - ${node.text}`);\n                } else if (node.type === 'bullet_list') {\n                    node.items.forEach(i => formattedLines.push(`    - ${i}`));\n                }\n            });\n        } else if (style === 'cornell') {\n            formattedLines.push(`=== CORNELL-STYLE NOTES ===\\n`);\n            parsed.structure.forEach(node => {\n                if (node.type === 'heading') {\n                    formattedLines.push(`[Cues \/ Keywords]\\n-> ${node.text}\\n`);\n                } else if (node.type === 'paragraph') {\n                    formattedLines.push(`[Notes Summary]: ${node.text}\\n`);\n                }\n            });\n        } else {\n            parsed.structure.forEach(node => {\n                if (node.type === 'heading') {\n                    formattedLines.push(`\\n## ${escapeHTML(node.text)}`);\n                } else if (node.type === 'bullet_list') {\n                    node.items.forEach(i => formattedLines.push(`- ${escapeHTML(i)}`));\n                } else if (node.type === 'numbered_list') {\n                    node.items.forEach((i, idx) => formattedLines.push(`${idx + 1}. ${escapeHTML(i)}`));\n                } else if (node.type === 'definition') {\n                    formattedLines.push(`> **Definition:** ${escapeHTML(node.text)}`);\n                } else if (node.type === 'example') {\n                    formattedLines.push(`> *Example:* ${escapeHTML(node.text)}`);\n                } else if (node.type === 'important') {\n                    formattedLines.push(`> \u26a0\ufe0f **Important:** ${escapeHTML(node.text)}`);\n                } else if (node.type === 'question') {\n                    formattedLines.push(`\\n**Q: ${escapeHTML(node.text)}**`);\n                } else if (node.type === 'answer') {\n                    formattedLines.push(`A: ${escapeHTML(node.text)}`);\n                } else if (node.type === 'paragraph') {\n                    let pText = escapeHTML(node.text);\n                    if (useHighlight) {\n                        pText = pText.replace(\/^([A-Za-z\\s]{3,25}):\\s\/, '<span class=\"ansc-highlight-term\">$1<\/span>: ');\n                    }\n                    formattedLines.push(pText);\n                } else if (node.type === 'empty') {\n                    formattedLines.push('');\n                }\n            });\n        }\n\n        const result = formattedLines.join('\\n');\n        outputEditor.value = result;\n        state.formattedContent = result;\n        pushHistory(result);\n\n        formatSummary.textContent = `Headings: ${parsed.stats.headingsCount} | Lists: ${parsed.stats.listsCount} | Important: ${parsed.stats.importantCount} | Style: ${style.toUpperCase()}`;\n        showToast(\"Notes formatted successfully!\");\n        updatePreview();\n\n        if (style === 'flashcard') {\n            switchView('flashcard');\n            initFlashcards();\n        }\n    }\n\n    function detectStructure() {\n        formatNotes();\n        showToast(\"Structure successfully detected and organized!\");\n    }\n\n    function cleanFormatting() {\n        let content = outputEditor.value;\n        content = content.replace(\/[ \\t]+\/g, ' ');\n        content = content.replace(\/\\n{3,}\/g, '\\n\\n');\n        outputEditor.value = content;\n        state.formattedContent = content;\n        pushHistory(content);\n        showToast(\"Formatting cleaned.\");\n        updatePreview();\n    }\n\n    function pushHistory(text) {\n        if (state.historyIndex < state.history.length - 1) {\n            state.history = state.history.slice(0, state.historyIndex + 1);\n        }\n        state.history.push(text);\n        state.historyIndex = state.history.length - 1;\n    }\n\n    function undo() {\n        if (state.historyIndex > 0) {\n            state.historyIndex--;\n            outputEditor.value = state.history[state.historyIndex];\n            state.formattedContent = outputEditor.value;\n            showToast(\"Undo\");\n            updatePreview();\n        }\n    }\n\n    function redo() {\n        if (state.historyIndex < state.history.length - 1) {\n            state.historyIndex++;\n            outputEditor.value = state.history[state.historyIndex];\n            state.formattedContent = outputEditor.value;\n            showToast(\"Redo\");\n            updatePreview();\n        }\n    }\n\n    function switchView(mode) {\n        document.querySelectorAll('.ansc-view-mode-btn').forEach(btn => {\n            btn.style.backgroundColor = 'var(--ansc-surface)';\n        });\n\n        document.getElementById('ansc-editor-view').classList.add('ansc-hidden');\n        previewView.classList.add('ansc-hidden');\n        compareView.classList.add('ansc-hidden');\n        searchReplaceView.classList.add('ansc-hidden');\n        flashcardView.classList.add('ansc-hidden');\n\n        const activeBtn = document.querySelector(`.ansc-view-mode-btn[data-mode=\"${mode}\"]`);\n        if (activeBtn) activeBtn.style.backgroundColor = 'var(--ansc-surface-alt)';\n\n        if (mode === 'edit') {\n            document.getElementById('ansc-editor-view').classList.remove('ansc-hidden');\n        } else if (mode === 'preview') {\n            previewView.classList.remove('ansc-hidden');\n            updatePreview();\n        } else if (mode === 'compare') {\n            compareView.classList.remove('ansc-hidden');\n            updateCompare();\n        } else if (mode === 'searchreplace') {\n            searchReplaceView.classList.remove('ansc-hidden');\n        } else if (mode === 'flashcard') {\n            flashcardView.classList.remove('ansc-hidden');\n            initFlashcards();\n        }\n    }\n\n    function updatePreview() {\n        let content = state.formattedContent || outputEditor.value;\n        let html = content\n            .replace(\/^## (.*$)\/gm, '<h3 style=\"margin: 16px 0 8px 0; color: var(--ansc-primary);\">$1<\/h3>')\n            .replace(\/^- (.*$)\/gm, '<li style=\"margin-left: 20px;\">$1<\/li>')\n            .replace(\/^> (.*$)\/gm, '<blockquote style=\"border-left: 4px solid var(--ansc-primary); margin: 8px 0; padding-left: 10px; color: var(--ansc-text-muted);\">$1<\/blockquote>')\n            .replace(\/\\n\/g, '<br>');\n        \n        previewView.innerHTML = `<h2>${escapeHTML(noteTitleInput.value || 'Untitled Note')}<\/h2><hr style=\"border:0; border-top:1px solid var(--ansc-border); margin:12px 0;\">${html}`;\n    }\n\n    function updateCompare() {\n        document.getElementById('ansc-compare-original').textContent = state.inputContent;\n        document.getElementById('ansc-compare-formatted').innerHTML = previewView.innerHTML;\n    }\n\n    function searchInputNotes() {\n        const query = document.getElementById('ansc-input-search').value.trim();\n        if (!query) return;\n        const text = textarea.value;\n        const idx = text.toLowerCase().indexOf(query.toLowerCase());\n        if (idx !== -1) {\n            textarea.focus();\n            textarea.setSelectionRange(idx, idx + query.length);\n            showToast(`Found \"${query}\"`);\n        } else {\n            showToast(`Text not found`);\n        }\n    }\n\n    function performFind() {\n        const query = document.getElementById('ansc-sr-find').value;\n        if (!query) return;\n        const text = outputEditor.value;\n        const matches = text.match(new RegExp(query, 'gi')) || [];\n        document.getElementById('ansc-sr-status').textContent = `Matches found: ${matches.length}`;\n        const idx = text.toLowerCase().indexOf(query.toLowerCase());\n        if (idx !== -1) {\n            outputEditor.focus();\n            outputEditor.setSelectionRange(idx, idx + query.length);\n        }\n    }\n\n    function performReplace() {\n        const query = document.getElementById('ansc-sr-find').value;\n        const replacement = document.getElementById('ansc-sr-replace').value;\n        if (!query) return;\n        let text = outputEditor.value;\n        outputEditor.value = text.replace(query, replacement);\n        state.formattedContent = outputEditor.value;\n        pushHistory(outputEditor.value);\n        showToast(\"Replaced successfully\");\n    }\n\n    function performReplaceAll() {\n        const query = document.getElementById('ansc-sr-find').value;\n        const replacement = document.getElementById('ansc-sr-replace').value;\n        if (!query) return;\n        let text = outputEditor.value;\n        outputEditor.value = text.replaceAll(query, replacement);\n        state.formattedContent = outputEditor.value;\n        pushHistory(outputEditor.value);\n        showToast(\"Replaced All successfully\");\n    }\n\n    function initFlashcards() {\n        if (state.flashcards.length === 0) {\n            const lines = state.inputContent.split(\/\\r*\\n\/).filter(l => l.trim().length > 3);\n            state.flashcards = lines.slice(0, 10).map(l => ({ q: \"Study Topic \/ Key Sentence\", a: l }));\n        }\n        state.currentFlashcardIndex = 0;\n        state.flashcardShowAnswer = false;\n        renderFlashcard();\n    }\n\n    function renderFlashcard() {\n        if (state.flashcards.length === 0) return;\n        const card = state.flashcards[state.currentFlashcardIndex];\n        document.getElementById('ansc-fc-type').textContent = state.flashcardShowAnswer ? \"Answer \/ Definition\" : \"Question \/ Term\";\n        document.getElementById('ansc-fc-content').textContent = state.flashcardShowAnswer ? card.a : card.q;\n        document.getElementById('ansc-fc-counter').textContent = `${state.currentFlashcardIndex + 1} \/ ${state.flashcards.length}`;\n    }\n\n    function toggleFlashcardAnswer() {\n        state.flashcardShowAnswer = !state.flashcardShowAnswer;\n        renderFlashcard();\n    }\n\n    function nextFlashcard() {\n        if (state.currentFlashcardIndex < state.flashcards.length - 1) {\n            state.currentFlashcardIndex++;\n            state.flashcardShowAnswer = false;\n            renderFlashcard();\n        }\n    }\n\n    function prevFlashcard() {\n        if (state.currentFlashcardIndex > 0) {\n            state.currentFlashcardIndex--;\n            state.flashcardShowAnswer = false;\n            renderFlashcard();\n        }\n    }\n\n    function copyFormattedNotes(formatType) {\n        let content = state.formattedContent || outputEditor.value;\n        if (!content) {\n            showToast(\"No formatted content to copy.\");\n            return;\n        }\n\n        let textToCopy = content;\n        if (formatType === 'plain') {\n            textToCopy = content.replace(\/[#*\\-_>]\/g, '').replace(\/<[^>]*>?\/gm, '');\n        } else if (formatType === 'markdown') {\n            textToCopy = content;\n        } else if (formatType === 'html') {\n            textToCopy = `<!DOCTYPE html><html><body>${previewView.innerHTML}<\/body><\/html>`;\n        }\n\n        navigator.clipboard.writeText(textToCopy).then(() => {\n            showToast(\"\u2713 Copied successfully\");\n        }).catch(() => {\n            const textareaFallback = document.createElement('textarea');\n            textareaFallback.value = textToCopy;\n            document.body.appendChild(textareaFallback);\n            textareaFallback.select();\n            try {\n                document.execCommand('copy');\n                showToast(\"\u2713 Copied successfully\");\n            } catch (e) {\n                showToast(\"Clipboard access denied. Please copy manually.\");\n            }\n            document.body.removeChild(textareaFallback);\n        });\n    }\n\n    function downloadFile(type) {\n        const text = state.formattedContent || outputEditor.value;\n        let filename = (noteTitleInput.value.trim() || 'notes') + '.' + type;\n        let mime = 'text\/plain';\n        if (type === 'md') mime = 'text\/markdown';\n        if (type === 'html') mime = 'text\/html';\n\n        let content = text;\n        if (type === 'html') {\n            content = `<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><title>${escapeHTML(noteTitleInput.value)}<\/title><\/head><body>${previewView.innerHTML}<\/body><\/html>`;\n        }\n\n        const blob = new Blob([content], { type: mime });\n        const url = URL.createObjectURL(blob);\n        const a = document.createElement('a');\n        a.href = url;\n        a.download = filename;\n        document.body.appendChild(a);\n        a.click();\n        document.body.removeChild(a);\n        URL.revokeObjectURL(url);\n        showToast(`Downloaded ${filename}`);\n    }\n\n    function saveCurrentNote() {\n        const title = noteTitleInput.value.trim() || 'Untitled Note';\n        const noteObj = {\n            id: state.currentId || Date.now(),\n            title: title,\n            input: state.inputContent,\n            formatted: state.formattedContent || outputEditor.value,\n            formatStyle: state.formatStyle,\n            createdAt: state.currentId ? (state.recentNotes.find(n => n.id === state.currentId)?.createdAt || new Date().toLocaleString()) : new Date().toLocaleString(),\n            updatedAt: new Date().toLocaleString(),\n            words: state.inputContent.trim().split(\/\\s+\/).length\n        };\n\n        if (state.currentId) {\n            state.recentNotes = state.recentNotes.map(n => n.id === state.currentId ? noteObj : n);\n        } else {\n            state.currentId = noteObj.id;\n            state.recentNotes.unshift(noteObj);\n        }\n\n        if (state.recentNotes.length > 15) state.recentNotes.pop();\n        localStorage.setItem('ansc_recent_notes', JSON.stringify(state.recentNotes));\n        renderRecentNotes();\n        showToast(\"Note saved successfully!\");\n        autoSaveStatus.textContent = \"Saved \u2713\";\n    }\n\n    function triggerAutoSave() {\n        autoSaveStatus.textContent = \"Saving...\";\n        clearTimeout(autoSaveTimer);\n        autoSaveTimer = setTimeout(() => {\n            if (state.inputContent.trim().length > 0) {\n                saveCurrentNote();\n            }\n        }, 800);\n    }\n\n    function renderRecentNotes() {\n        const listEl = document.getElementById('ansc-recent-list');\n        listEl.innerHTML = '';\n        if (state.recentNotes.length === 0) {\n            listEl.innerHTML = '<li style=\"font-size:0.85rem; color:var(--ansc-text-muted);\">No saved notes yet.<\/li>';\n            return;\n        }\n\n        state.recentNotes.forEach(note => {\n            const li = document.createElement('li');\n            li.className = 'ansc-recent-item';\n            li.innerHTML = `\n                <div class=\"ansc-recent-info\" onclick=\"window.anscLoadNote(${note.id})\">\n                    <span class=\"ansc-recent-title\">${escapeHTML(note.title)}<\/span>\n                    <span class=\"ansc-recent-meta\">Updated: ${note.updatedAt} &bull; ${note.words} words<\/span>\n                <\/div>\n                <div style=\"display: flex; gap: 4px;\">\n                    <button class=\"ansc-btn\" style=\"padding: 4px 8px; font-size:0.75rem;\" onclick=\"window.anscLoadNote(${note.id})\">Open<\/button>\n                    <button class=\"ansc-btn\" style=\"padding: 4px 8px; font-size:0.75rem;\" onclick=\"window.anscDuplicateNote(${note.id})\">Duplicate<\/button>\n                    <button class=\"ansc-btn\" style=\"padding: 4px 8px; font-size:0.75rem; color:var(--ansc-danger);\" onclick=\"window.anscDeleteNote(${note.id})\">Delete<\/button>\n                <\/div>\n            `;\n            listEl.appendChild(li);\n        });\n    }\n\n    window.anscLoadNote = function(id) {\n        const note = state.recentNotes.find(n => n.id === id);\n        if (note) {\n            state.currentId = note.id;\n            noteTitleInput.value = note.title;\n            textarea.value = note.input;\n            state.inputContent = note.input;\n            outputEditor.value = note.formatted;\n            state.formattedContent = note.formatted;\n            formatStyleSelect.value = note.formatStyle || 'clean';\n            state.formatStyle = formatStyleSelect.value;\n            updateStats();\n            checkEmptyState();\n            showToast(`Loaded \"${note.title}\"`);\n        }\n    };\n\n    window.anscDuplicateNote = function(id) {\n        const note = state.recentNotes.find(n => n.id === id);\n        if (note) {\n            const dup = {\n                ...note,\n                id: Date.now(),\n                title: note.title + \" (Copy)\",\n                updatedAt: new Date().toLocaleString()\n            };\n            state.recentNotes.unshift(dup);\n            localStorage.setItem('ansc_recent_notes', JSON.stringify(state.recentNotes));\n            renderRecentNotes();\n            showToast(\"Note duplicated\");\n        }\n    };\n\n    window.anscDeleteNote = function(id) {\n        if (!confirm(\"Are you sure you want to delete this saved note?\")) return;\n        state.recentNotes = state.recentNotes.filter(n => n.id !== id);\n        localStorage.setItem('ansc_recent_notes', JSON.stringify(state.recentNotes));\n        renderRecentNotes();\n        showToast(\"Note deleted\");\n    };\n\n    function showToast(msg) {\n        toast.textContent = msg;\n        toast.classList.add('show');\n        setTimeout(() => {\n            toast.classList.remove('show');\n        }, 2500);\n    }\n\n    function escapeHTML(str) {\n        return str.replace(\/[&<>'\"]\/g, \n            tag => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', \"'\": '&#39;', '\"': '&quot;' }[tag] || tag)\n        );\n    }\n\n    init();\n})();\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p># AI NOTES SMART COPY &#8211; PRODUCTION TOOL (100% FUNCTIONAL) AI Notes Smart Copy Paste &bull; Detect &bull; Format &bull; Edit &bull; Preview &bull; Copy &bull; Download &bull; Save Saved \u2713 \ud83c\udf19 Theme \ud83d\udcbe Save Notes Transform Your Messy Notes Paste your class notes, web excerpts, or study material to automatically format them into clean, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-969","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/pages\/969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/comments?post=969"}],"version-history":[{"count":3,"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/pages\/969\/revisions"}],"predecessor-version":[{"id":972,"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/pages\/969\/revisions\/972"}],"wp:attachment":[{"href":"https:\/\/freewebtools.co.in\/index.php\/wp-json\/wp\/v2\/media?parent=969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}