facebook / index.html
Althnayi's picture
Upload 27 files
2a196ac verified
Raw
History Blame Contribute Delete
169 kB
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fritree Enterprise Platform</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<div class="container" style="max-width: 1500px;">
<div class="app-layout">
<!-- Sidebar Navigation Menu -->
<aside class="sidebar">
<div class="sidebar-brand"><i class="fa-solid fa-robot"></i><span>Workspace Core</span></div>
<div class="nav-item active" data-target="pane-dashboard"><i class="fa-solid fa-chart-line"></i><span>Live Dashboard</span></div>
<div class="nav-item" data-target="pane-fb-pub"><i class="fa-brands fa-facebook"></i><span>Facebook Poster</span></div>
<div class="nav-item" data-target="pane-wa-pub"><i class="fa-brands fa-whatsapp"></i><span>WhatsApp Broadcast</span></div>
<div class="nav-item" data-target="pane-content-lib"><i class="fa-solid fa-folder-open"></i><span>Content Library</span></div>
<div class="nav-item" data-target="pane-wallet"><i class="fa-solid fa-wallet"></i><span>Secure Wallet</span></div>
<div class="nav-item" data-target="pane-store"><i class="fa-solid fa-cart-shopping"></i><span>Licensing Store</span></div>
<div class="nav-item" data-target="pane-history"><i class="fa-solid fa-box-archive"></i><span>Campaign Ledger</span></div>
<div class="nav-item" data-target="pane-account-details"><i class="fa-solid fa-user-shield"></i><span>Account &amp; Verification</span></div>
<div class="nav-item" data-target="pane-migration"><i class="fa-solid fa-database"></i><span>Workspace Migration</span></div>
<div class="nav-item" data-target="pane-support"><i class="fa-solid fa-headset"></i><span>Support &amp; Exchange</span></div>
</aside>
<!-- Main Content Area -->
<main class="content-area">
<!-- Unified Status Top Bar -->
<header style="flex-wrap: wrap; gap: 10px;">
<div class="auth-status" style="flex-wrap: wrap;">
<!-- Facebook Share Cards Badge -->
<div id="fb-shares-badge" class="badge" style="background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd;" title="Available cards for publishing on Facebook">
<i class="fa-brands fa-facebook"></i><span>FB Cards: </span><span id="fb-shares-balance">0</span>
</div>
<!-- WhatsApp Broadcast Cards Badge -->
<div id="wa-shares-badge" class="badge" style="background: #e8f5e9; color: #15803d; border: 1px solid #c8e6c9;" title="Available cards for sending WhatsApp broadcasts">
<i class="fa-brands fa-whatsapp"></i><span>WA Cards: </span><span id="wa-shares-balance">0</span>
</div>
<!-- Stealth Shield Risk Badge -->
<div id="protection-badge" class="badge green" style="cursor: pointer;" title="Click to view Stealth Shield and Risk Metrics">
<i class="fa-solid fa-shield-halved"></i><span>Shield Connected</span>
</div>
<!-- Isolated Facebook Session Badge -->
<div id="session-badge" class="badge red" style="cursor: pointer;" title="Click to launch Facebook in a secure standalone window">
<i class="fa-solid fa-plug-circle-xmark"></i><span>FB Offline</span>
</div>
<!-- WhatsApp Session Badge -->
<div id="wa-session-badge" class="badge red" style="cursor: pointer;" title="Click to sync and establish WhatsApp Web bridge">
<i class="fa-solid fa-plug-circle-xmark"></i><span>WA Offline</span>
</div>
</div>
</header>
<!-- Connection Alert Banner -->
<div id="wa-connect-warning-banner" class="card" style="display: none; background: #fffbeb; border: 1px solid #fde68a; padding: 15px; margin: 0;">
<div style="display: flex; align-items: center; gap: 12px; color: #b45309;">
<i class="fa-solid fa-triangle-exclamation fa-2x"></i>
<div>
<h4 style="font-size: 13px; margin: 0; font-weight: bold;"><i class="fa-solid fa-link-slash"></i><span>WhatsApp Bridge Offline</span></h4>
<p style="font-size: 11px; margin: 2px 0 0 0;"><i class="fa-solid fa-circle-info"></i><span>Please click the red WhatsApp Offline status button above to establish the browser session so we can dispatch your campaigns securely.</span></p>
</div>
</div>
</div>
<!-- Tab Pane 1: Dashboard -->
<section class="tab-pane active" id="pane-dashboard">
<div class="main-grid" style="grid-template-columns: 1fr 1fr;">
<!-- Facebook Connection Status Widget -->
<div class="card">
<div class="card-title"><i class="fa-brands fa-facebook"></i><span>Facebook Connection</span></div>
<div class="stats-row" style="grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0;">
<div class="stat-box" style="padding: 15px;"><div class="num" id="fb-dash-status-lbl" style="color: var(--danger); font-size: 16px;"><i class="fa-solid fa-circle-xmark"></i><span>Offline</span></div><div class="lbl"><i class="fa-solid fa-signal"></i><span>Network State</span></div></div>
<div class="stat-box" style="padding: 15px;"><div class="num" id="fb-dash-total-groups" style="color: var(--primary); font-size: 18px;"><i class="fa-solid fa-hashtag"></i>0</div><div class="lbl"><i class="fa-solid fa-users"></i><span>Groups Cached</span></div></div>
</div>
</div>
<!-- WhatsApp Connection Status Widget -->
<div class="card">
<div class="card-title"><i class="fa-brands fa-whatsapp"></i><span>WhatsApp Connection</span></div>
<div class="stats-row" style="grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 0;">
<div class="stat-box" style="padding: 15px;"><div class="num" id="wa-dash-status-lbl" style="color: var(--danger); font-size: 16px;"><i class="fa-solid fa-unlink"></i><span>Offline</span></div><div class="lbl"><i class="fa-solid fa-plug"></i><span>Bridge State</span></div></div>
<div class="stat-box" style="padding: 15px;"><div class="num" id="wa-dash-sent-today" style="color: var(--success); font-size: 18px;"><i class="fa-solid fa-hashtag"></i>0</div><div class="lbl"><i class="fa-solid fa-paper-plane"></i><span>Sent Today</span></div></div>
</div>
</div>
</div>
<!-- Stealth Behavioral Shield Widget -->
<div class="card" id="stealth-shield-dash-card">
<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px;">
<div>
<h4 style="font-size: 14px; color: #1e293b; margin: 0; font-weight: 900;"><i class="fa-solid fa-shield-halved" style="color: #1877f2; margin-right: 5px;"></i><span>Stealth &amp; Motion Control Guard</span></h4>
<p style="font-size: 11px; color: #64748b; margin: 4px 0 0 0;"><i class="fa-solid fa-lock"></i><span>Floating guard is active and running under strict cryptographic validation parameters.</span></p>
</div>
<div style="display: flex; gap: 8px;">
<button id="btn-dash-open-standalone-fb" class="btn-primary" style="font-size: 11px; padding: 6px 14px; background: #1877f2;"><i class="fa-solid fa-window-restore"></i><span>Sandbox Window</span></button>
<button id="btn-dash-configure-stealth" class="btn-secondary"><i class="fa-solid fa-sliders"></i><span>Adjust Shields</span></button>
</div>
</div>
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; border-top: 1px solid #cbd5e1; padding-top: 12px; text-align: center;">
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: var(--shadow-xs);">
<div style="font-size: 13px; font-weight: bold; color: #1e293b;" id="dash-stealth-scroll-step"><i class="fa-solid fa-arrows-up-down"></i><span>250 px</span></div>
<div style="font-size: 10px; color: #64748b; margin-top: 2px;"><i class="fa-solid fa-circle-nodes"></i><span>Scroll Increment</span></div>
</div>
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: var(--shadow-xs);">
<div style="font-size: 13px; font-weight: bold; color: #1e293b;" id="dash-stealth-scroll-cycles"><i class="fa-solid fa-rotate"></i><span>4 Cycles</span></div>
<div style="font-size: 10px; color: #64748b; margin-top: 2px;"><i class="fa-solid fa-book-open"></i><span>Read Simulation</span></div>
</div>
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: var(--shadow-xs);">
<div style="font-size: 13px; font-weight: bold; color: #1e293b;" id="dash-stealth-mouse-cycles"><i class="fa-solid fa-bezier-curve"></i><span>5 Path(s)</span></div>
<div style="font-size: 10px; color: #64748b; margin-top: 2px;"><i class="fa-solid fa-arrow-pointer"></i><span>Bezier Mouse Paths</span></div>
</div>
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: var(--shadow-xs);">
<div style="font-size: 13px; font-weight: bold; color: #10b981;" id="dash-stealth-cursor-status"><i class="fa-solid fa-eye"></i><span>Active</span></div>
<div style="font-size: 10px; color: #64748b; margin-top: 2px;"><i class="fa-solid fa-hand-pointer"></i><span>Virtual Cursor</span></div>
</div>
</div>
</div>
<!-- Daily Objectives Panel -->
<div class="card">
<div class="card-title">
<span><i class="fa-solid fa-list-check"></i><span>Daily Objectives &amp; Challenge Board</span></span>
</div>
<p style="font-size: 12px; color: var(--text-muted); margin-bottom: 5px;"><i class="fa-solid fa-circle-question"></i><span>Complete your active daily challenges to gain experience, level up, and obtain free dispatch cards directly from the system!</span></p>
<div id="tasks-container" style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; direction: ltr; text-align: left;">
<!-- Rendered Dynamically from modules/dashboard.js -->
</div>
</div>
</section>
<!-- Tab Pane 2: Facebook Poster -->
<section id="pane-fb-pub" class="tab-pane">
<!-- Cohesive Two-Column Split Workspace -->
<div class="main-grid" style="grid-template-columns: 1.2fr 1.8fr; gap: 15px; margin-bottom: 15px;">
<!-- Column Left: Facebook Group Registry -->
<div class="card" style="display: flex; flex-direction: column; height: 100%;">
<div class="card-title" style="margin-bottom: 10px;"><i class="fa-solid fa-users-rectangle"></i><span>Facebook Group Registry</span></div>
<!-- Targeting Search & Filter Module -->
<div style="margin-bottom: 12px; padding: 12px; background: linear-gradient(180deg, #ffffff, #f7fbfe); border: 1px solid #e2e8f0; border-radius: 8px; display: flex; flex-direction: column; gap: 10px;">
<h4 style="font-size: 12px; margin-bottom: 2px; color: #3b82f6; font-weight: bold;"><i class="fa-solid fa-magnifying-glass"></i><span>Targeting Console:</span></h4>
<input type="text" id="unified-group-input" class="search-box" style="padding: 10px 14px;" placeholder="Search by name, custom keywords, or tags...">
<div style="display: flex; gap: 8px;">
<button id="btn-select-similar" class="btn-primary" style="flex: 1; padding: 8px; font-size: 11px;"><i class="fa-solid fa-filter"></i><span>Match Keywords</span></button>
<button id="btn-save-tag" class="btn-primary" style="flex: 1; padding: 8px; font-size: 11px; background: #10b981; border-color: #10b981;"><i class="fa-solid fa-floppy-disk"></i><span>Save Segment</span></button>
</div>
</div>
<div style="display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;">
<button id="btn-select-all" class="btn-secondary" style="padding: 6px 12px; font-size: 12px;"><i class="fa-solid fa-check-double"></i><span>Select All</span></button>
<button id="btn-deselect-all" class="btn-secondary" style="padding: 6px 12px; font-size: 12px;"><i class="fa-solid fa-ban"></i><span>Deselect All</span></button>
<button id="btn-select-admin" class="btn-secondary" style="padding: 6px 12px; font-size: 12px;"><i class="fa-solid fa-user-tie"></i><span>My Groups</span></button>
</div>
<div style="margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--border)">
<div style="font-size: 12px; font-weight: bold; margin-bottom: 5px; color: var(--text-muted);"><i class="fa-solid fa-tags"></i><span>Saved Target Segments:</span></div>
<div id="saved-tags-container" style="display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;"></div>
</div>
<div style="margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); font-weight: bold;" id="selected-count"><i class="fa-solid fa-square-check"></i><span>Groups Selected: 0 of 0</span></div>
<div class="groups-container" id="groups-list" style="flex: 1; max-height: 400px; overflow-y: auto;">
<div style="padding: 20px; text-align: center; color: var(--text-muted);"><i class="fa-solid fa-circle-exclamation"></i><span>Establish your active Facebook session so we can load your communities list here.</span></div>
</div>
</div>
<!-- Column Right: Campaign Composer & Settings -->
<div class="card" style="display: flex; flex-direction: column; height: 100%;">
<div class="card-title" style="margin-bottom: 10px;">
<span><i class="fa-solid fa-pen-nib"></i><span>Facebook Campaign Composer</span></span>
</div>
<!-- Smart Rotation Matrix Mode Alert -->
<div class="smart-dist-panel" id="prev-posts-indicator-panel" style="display: none; background: #f0fdf4; border: 2px dashed #0d9488; margin-bottom: 12px; padding: 12px; border-radius: 8px;">
<div class="smart-dist-header" style="color: #0f766e; border-bottom: 1px solid #99f6e4; padding-bottom: 6px; display: flex; justify-content: space-between; align-items: center; font-weight: bold; font-size: 13px;">
<span><i class="fa-solid fa-arrows-spin"></i><span>Smart Rotation Matrix Mode Active</span></span>
<button id="btn-disable-prev-posts-mode" class="btn-secondary" style="padding: 2px 6px; font-size: 10px; background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4;"><i class="fa-solid fa-link-slash"></i><span>Exit Rotation</span></button>
</div>
<p style="font-size: 11px; margin-top: 5px; color: #0d9488;"><i class="fa-solid fa-circle-info"></i><span>Currently dispatching </span><b id="lbl-active-prev-posts-count"><i class="fa-solid fa-hashtag"></i>0</b><span> archived post(s) under the active algorithm: </span><b id="lbl-active-prev-posts-mode"><i class="fa-solid fa-shield-halved"></i>Balanced Random Protection</b>.</p>
</div>
<!-- Default Single Post Composer with Spintax Tooling -->
<div id="default-composer-panel" style="flex: 1;">
<div class="spintax-panel">
<div class="spintax-header">
<div class="spintax-title"><i class="fa-solid fa-wand-magic-sparkles"></i><span>Spintax Content Variation Console</span></div>
</div>
<div class="spintax-stats">
<span id="spintax-count-lbl"><i class="fa-solid fa-calculator"></i><span>Unique Variations: 1</span></span>
<span id="spintax-unique-lbl"><i class="fa-solid fa-fingerprint"></i><span>Uniqueness score: 0%</span></span>
<span id="spintax-duplicate-warn" class="spintax-warning"></span>
</div>
<div id="spintax-preview-box"></div>
</div>
<textarea id="post-text" class="main-composer" style="height: 120px;" placeholder="Type your primary campaign copy here... Try using spintax structures to prevent bot detection: {Special Promo|Amazing Deal|Unbeatable Offer} for our services..."></textarea>
<!-- Attach Media Assets Section -->
<div style="margin-top: 15px;">
<label style="font-size: 13px; font-weight: bold; color: var(--text-muted); display: block; margin-bottom: 10px;"><i class="fa-solid fa-photo-film"></i><span>Attach Campaign Media Assets (Images/Videos):</span></label>
<div class="image-uploader-area" id="image-dropzone" style="padding: 15px 30px;">
<i class="fa-solid fa-cloud-arrow-up fa-lg"></i><br>
<span><i class="fa-solid fa-folder-open"></i>Drag &amp; drop campaign media here or click to browse...</span>
<input type="file" id="image-file-input" multiple accept="image/*,video/mp4,video/webm" style="display: none;">
</div>
<div class="img-preview-container" id="image-previews"></div>
</div>
<!-- Campaign Launch Target Mode -->
<div class="form-group" style="margin-top: 15px;">
<label style="font-size: 13px; font-weight: bold; color: var(--text-muted);"><i class="fa-solid fa-window-restore"></i><span>Campaign Launch Target Mode</span></label>
<select id="fb-launch-mode" class="search-box">
<option value="tab" selected>Open groups in background tabs (Standard)</option>
<option value="window">Open groups in separate sandbox windows (Popup Isolation)</option>
</select>
</div>
</div>
<!-- Composer Actions -->
<div class="composer-actions" style="margin-top: auto;">
<button id="btn-start-publish" class="btn-primary" style="flex-grow: 2;" disabled><i class="fa-solid fa-paper-plane"></i><span>Launch Simulated Campaign</span></button>
<button id="btn-stop-publish" class="btn-danger" style="flex-grow: 1;" disabled><i class="fa-solid fa-circle-pause"></i><span>Pause / Freeze Campaign</span></button>
</div>
</div>
</div>
</section>
<!-- Tab Pane 3: Content Library -->
<section id="pane-content-lib" class="tab-pane">
<!-- Reorganized Split-Pane Content Rotation Workspace -->
<div class="content-lib-layout">
<!-- LEFT SIDE: Controls, Filter Options, and Advanced Settings -->
<div class="content-lib-sidebar card">
<div class="sidebar-section-header">
<h3 style="font-size: 14px; font-weight: 800; color: #0d9488; margin: 0; display: flex; align-items: center; gap: 8px;">
<i class="fa-solid fa-arrows-spin"></i><span>Rotation Engine Console</span>
</h3>
<div id="rotation-status-badge" class="badge red" style="font-size: 10px; padding: 4px 8px;"><i class="fa-solid fa-triangle-exclamation"></i><span>Engine Disabled</span></div>
</div>
<!-- Instant-Saving Automation Controls -->
<div class="automation-control-box">
<div class="checkbox-group automation-toggle-wrapper" style="padding: 12px; border-radius: 10px; background: #faf5ff; border: 1px solid #d8b4fe; margin-bottom: 12px; cursor: pointer;">
<input type="checkbox" id="chk-enable-rotation" style="width: 18px; height: 18px; cursor: pointer;">
<label for="chk-enable-rotation" style="font-size: 12px; font-weight: 800; color: #6b21a8; margin-left: 8px; cursor: pointer;"><i class="fa-solid fa-circle-play"></i><span>Turn ON Facebook Rotation</span></label>
</div>
<div id="rotation-config-details" class="form-group animate-slide-down" style="display: none; gap: 6px; margin-bottom: 15px;">
<label style="font-size: 11px; font-weight: 800; color: #6b21a8;"><i class="fa-solid fa-route"></i><span>Rotation Routing Strategy:</span></label>
<select id="sel-rotation-mode" class="cl-filter-select" style="width: 100%; padding: 10px; font-size: 12px; border-color: #d8b4fe; border-radius: var(--radius-md); background: #ffffff;">
<option value="balanced" selected>Balanced Queue (Equal Dispatch)</option>
<option value="weighted">Priority-Weighted Distribution</option>
<option value="high_perf">Performance Focus (Prioritize Success)</option>
<option value="newest">Chronological Order (Newest First)</option>
<option value="oldest">Chronological Order (Oldest First)</option>
<option value="random">Complete Random Dispatch Mode</option>
</select>
</div>
<!-- Real-time Synchronization Status Alert -->
<div class="auto-sync-status-indicator" style="background: #e6fcf5; border: 1px solid #34c759; border-radius: 8px; padding: 10px; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; color: #099268; font-size: 11px;">
<i class="fa-solid fa-cloud-arrow-up fa-bounce"></i>
<span style="font-weight: bold;"><i class="fa-solid fa-check-double"></i><span>Continuous Cloud Sync Active: Changes are saved instantly.</span></span>
</div>
</div>
<!-- Expandable Search & Search Filter Form Section -->
<div class="filters-collapsible-wrapper">
<div class="form-group">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-magnifying-glass"></i><span>Text Search (Content &amp; Titles):</span></label>
<input type="text" id="prev-posts-search" class="search-box" style="padding: 10px; font-size: 12px;" placeholder="Search copy or titles...">
</div>
<div class="collapsible-filters-grid" style="display: flex; flex-direction: column; gap: 10px; margin-top: 10px;">
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-tag"></i><span>Filter by Keyword:</span></label>
<input type="text" id="prev-posts-filter-keyword" class="search-box" style="padding: 8px; font-size: 11px;" placeholder="e.g. promo, realestate...">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-folder-open"></i><span>Filter by Category:</span></label>
<input type="text" id="prev-posts-filter-category" class="search-box" style="padding: 8px; font-size: 11px;" placeholder="e.g. sales, support...">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-sticky-note"></i><span>Search Inside Internal Team Notes:</span></label>
<input type="text" id="prev-posts-filter-notes" class="search-box" style="padding: 8px; font-size: 11px;" placeholder="Search developer notes...">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-calendar-day"></i><span>Filter by Scheduled Follow-Up Date:</span></label>
<input type="date" id="prev-posts-filter-followup-date" class="search-box" style="padding: 8px; font-size: 11px;">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-star"></i><span>Minimum Quality Score (%):</span></label>
<input type="number" id="prev-posts-filter-min-score" class="search-box" style="padding: 8px; font-size: 11px;" min="0" max="100" placeholder="0 to 100">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-font"></i><span>Max Permitted Text Characters:</span></label>
<input type="number" id="prev-posts-filter-max-chars" class="search-box" style="padding: 8px; font-size: 11px;" placeholder="e.g. 280 characters">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-circle-info"></i><span>Template Active State:</span></label>
<select id="prev-posts-filter-status" class="cl-filter-select" style="padding: 8px; font-size: 11px; width: 100%; border-radius: var(--radius-md); border-color: var(--border);">
<option value="all" selected>All Active States</option>
<option value="active">Active &amp; Ready</option>
<option value="inactive">Temporarily Deactivated</option>
<option value="frozen">Frozen / Expired</option>
<option value="draft">Draft Block</option>
</select>
</div>
</div>
</div>
<div class="sorting-wrapper" style="border-top: 1px dashed #cbd5e1; padding-top: 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px;">
<label style="font-size: 10px; font-weight: 800; color: #475569;"><i class="fa-solid fa-arrow-down-wide-short"></i><span>Sort Registry View By:</span></label>
<select id="prev-posts-sort-by" class="cl-filter-select" style="padding: 8px; font-size: 11px; width: 100%; border-radius: var(--radius-md); border-color: var(--border);">
<option value="newest" selected>Chronological (Most Recent)</option>
<option value="oldest">Chronological (Oldest First)</option>
<option value="most_pub">Most Dispatched Templates</option>
<option value="least_pub">Least Dispatched Templates</option>
<option value="highest_score">Highest Performance Score</option>
<option value="lowest_score">Lowest Performance Score</option>
</select>
</div>
<!-- Instant Actions Shortcuts -->
<div style="border-top: 1px dashed #cbd5e1; padding-top: 12px; margin-top: 10px;">
<button id="btn-add-current-to-prev-library" class="btn-primary" style="font-size: 11px; padding: 10px; width: 100%; background: #0f766e; border: none; box-shadow: 0 4px 6px rgba(15, 118, 110, 0.15);"><i class="fa-solid fa-floppy-disk"></i><span>Save Composer state as Template</span></button>
</div>
</div>
<!-- RIGHT SIDE: Multi-Tab Workspace Area -->
<div class="content-lib-main-container">
<div class="content-lib-main-headercard card" style="padding: 16px 20px;">
<div class="rot-nav-tabs" style="border-bottom: none; margin-bottom: 0; background: transparent; padding: 0;">
<div class="rot-tab-btn active" data-page="rot-page-manage" style="padding: 10px 16px;"><i class="fa-solid fa-folder-tree"></i><span>Ledger &amp; Management</span></div>
<div class="rot-tab-btn" data-page="rot-page-add" style="padding: 10px 16px;"><i class="fa-solid fa-plus"></i><span>Add New Post</span></div>
<div class="rot-tab-btn" data-page="rot-page-evaluation" style="padding: 10px 16px;"><i class="fa-solid fa-chart-line"></i><span>Performance Insights</span></div>
</div>
</div>
<!-- Sub-Page A: Ledger & Bulk Management -->
<div id="rot-page-manage" class="rot-modal-page" style="display: block; margin-top: 15px;">
<!-- Bulk Operations Utility Bar -->
<div class="bulk-operations-bar card" style="padding: 12px 18px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; background: #fafbfc; border-color: #cbd5e1;">
<div style="display: flex; align-items: center; gap: 8px;">
<input type="checkbox" id="prev-posts-select-all" style="width: 18px; height: 18px; cursor: pointer; accent-color: #0d9488;">
<label for="prev-posts-select-all" style="font-size: 12px; font-weight: 800; color: #475569; cursor: pointer;"><i class="fa-solid fa-square-check"></i><span>Select All Templates</span></label>
</div>
<div class="bulk-actions-buttons-cluster" style="display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto;">
<button id="btn-prev-bulk-freeze" class="btn-secondary cl-bulk-btn" style="padding: 6px 12px; font-size: 11px;"><i class="fa-solid fa-lock"></i><span>Freeze</span></button>
<button id="btn-prev-bulk-unfreeze" class="btn-secondary cl-bulk-btn" style="padding: 6px 12px; font-size: 11px;"><i class="fa-solid fa-lock-open"></i><span>Unfreeze</span></button>
<button id="btn-prev-bulk-draft" class="btn-secondary cl-bulk-btn" style="padding: 6px 12px; font-size: 11px; background: #f1f5f9; color: #475569;"><i class="fa-solid fa-file-pen"></i><span>Draft</span></button>
<button id="btn-prev-bulk-active" class="btn-secondary cl-bulk-btn" style="padding: 6px 12px; font-size: 11px; background: #dcfce7; color: #166534; border-color: #bbf7d0;"><i class="fa-solid fa-circle-play"></i><span>Activate</span></button>
<button id="btn-prev-bulk-archive" class="btn-secondary cl-bulk-btn" style="padding: 6px 12px; font-size: 11px; background: #fef2f2; color: #991b1b; border-color: #fecaca;"><i class="fa-solid fa-circle-stop"></i><span>Deactivate</span></button>
<button id="btn-prev-bulk-delete" class="btn-danger cl-bulk-btn" style="padding: 6px 12px; font-size: 11px; background: #fee2e2; color: #ef4444;"><i class="fa-solid fa-trash"></i><span>Wipe</span></button>
</div>
</div>
<!-- Main Grid Container for Rotation template items -->
<div id="prev-posts-grid-container" class="cl-template-grid animate-fade-in" style="margin-top: 15px;">
<!-- Dynamically populated via modules/rotation.js -->
</div>
</div>
<!-- Sub-Page B: Add New Template Block -->
<div id="rot-page-add" class="rot-modal-page" style="display: none; margin-top: 15px;">
<div class="card" style="padding: 24px; background: #ffffff;">
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px;">
<div class="form-group" style="margin-bottom: 0;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-heading"></i><span>Template Descriptive Title:</span></label>
<input type="text" id="add-prev-post-title" class="search-box" style="padding: 10px;" placeholder="Identify this block in the registry...">
</div>
<div class="form-group" style="margin-bottom: 0;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-circle-info"></i><span>Default Active State:</span></label>
<select id="add-prev-post-status" class="cl-filter-select" style="width: 100%; padding: 10px; border-radius: var(--radius-md); border-color: var(--border);">
<option value="active" selected>Active &amp; Ready for Rotation</option>
<option value="inactive">Temporarily Deactivated</option>
<option value="frozen">Frozen / Expired</option>
<option value="draft">Draft Block</option>
</select>
</div>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; background: #f8fafc; padding: 12px; border-radius: 8px; border: 1px solid #cbd5e1; margin-top: 15px;">
<div class="form-group" style="margin-bottom:0;">
<label style="font-weight: bold; color: #475569;"><i class="fa-solid fa-hourglass-start"></i><span>Active Rotation Start Date/Time:</span></label>
<input type="datetime-local" id="add-prev-post-entry-date" class="search-box" style="padding: 8px;">
</div>
<div class="form-group" style="margin-bottom:0;">
<label style="font-weight: bold; color: #475569;"><i class="fa-solid fa-hourglass-end"></i><span>Expiration Boundary Date/Time:</span></label>
<input type="datetime-local" id="add-prev-post-expire-date" class="search-box" style="padding: 8px;">
</div>
</div>
<div class="form-group" style="margin-top: 15px;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-pen-fancy"></i><span>Primary Campaign Text Copy:</span></label>
<textarea id="add-prev-post-text" class="main-composer" style="height: 120px;" placeholder="Compose your copy... Support spintax brackets: {Special Promo|Amazing Deal}..."></textarea>
</div>
<div class="spintax-panel" style="margin-top: 10px; border: 1px solid #bfdbfe; background: #f0f7ff; padding: 12px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px;">
<div style="flex: 1;">
<span style="font-size:12px; font-weight:bold; color:#1e40af; display: flex; align-items: center; gap: 6px;"><i class="fa-solid fa-wand-magic-sparkles"></i><span>Spintax Parser &amp; Brackets Verifier</span></span>
<div id="add-spintax-analysis-output" style="font-size: 11px; color:#64748b; font-weight: 500; margin-top: 2px;"><i class="fa-solid fa-keyboard"></i><span>Enter your text copy with braces, then verify...</span></div>
</div>
<button type="button" id="btn-validate-add-spintax" class="btn-secondary" style="padding: 8px 12px; font-size: 11px; background: #ffffff; border: 1px solid #bfdbfe;"><i class="fa-solid fa-magnifying-glass"></i><span>Verify Brackets</span></button>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-top: 15px;">
<div class="form-group" style="margin-bottom:0;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-life-ring"></i><span>Fallback Copy (If Media Upload Fails):</span></label>
<input type="text" id="add-prev-post-alt-text" class="search-box" style="padding: 10px;" placeholder="Fallback text copy...">
</div>
<div class="form-group" style="margin-bottom:0;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-weight-hanging"></i><span>Selection Priority Weight (1-100):</span></label>
<input type="number" id="add-prev-post-priority" class="search-box" value="50" min="1" max="100" style="padding: 10px;">
</div>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-top: 15px;">
<div class="form-group" style="margin-bottom:0;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-key"></i><span>Registry Keywords:</span></label>
<input type="text" id="add-prev-post-keywords" class="search-box" style="padding: 10px;" placeholder="promo, realestate (comma list)">
</div>
<div class="form-group" style="margin-bottom:0;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-tags"></i><span>Management Categories:</span></label>
<input type="text" id="add-prev-post-categories" class="search-box" style="padding: 10px;" placeholder="sales, support (comma list)">
</div>
</div>
<div class="form-group" style="margin-top: 15px;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-sticky-note"></i><span>Internal Team / Developer Notes:</span></label>
<input type="text" id="add-prev-post-notes" class="search-box" style="padding: 10px;" placeholder="Private instructions for marketing executors...">
</div>
<!-- WhatsApp Scheduled Follow-Ups Segment -->
<div style="background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 10px; color: #15803d; margin-top: 15px;">
<div class="checkbox-group" style="background: #ffffff; margin-bottom: 0; border-color: #bbf7d0; padding: 10px 15px;">
<input type="checkbox" id="add-prev-post-wa-followup" style="width:16px; height:16px; cursor: pointer;">
<label for="add-prev-post-wa-followup" style="color: #166534; font-weight: bold; cursor: pointer; font-size: 12px; margin-left: 8px;"><i class="fa-brands fa-whatsapp"></i><span>Enable Automated Follow-Up WhatsApp Broadcast for this Template</span></label>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;">
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-user"></i><span>Recipient Name:</span></label>
<input type="text" id="add-prev-post-client-name" class="search-box" style="border-color: #bbf7d0; padding: 8px;" placeholder="e.g. Jane Doe">
</div>
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-phone"></i><span>Target Numbers (Comma List):</span></label>
<input type="text" id="add-prev-post-phones" class="search-box" style="border-color: #bbf7d0; padding: 8px;" placeholder="e.g. +xxxxxxxxxxxx">
</div>
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-clock"></i><span>Scheduled Dispatch Time:</span></label>
<input type="datetime-local" id="add-prev-post-followup-date" class="search-box" style="border-color: #bbf7d0; padding: 8px;">
</div>
</div>
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-comment-sms"></i><span>Follow-Up Broadcast Copy:</span></label>
<textarea id="add-prev-post-followup-msg" class="search-box" style="height: 80px; resize: vertical; border-color: #bbf7d0;" placeholder="Hello {client_name}, we are checking in regarding your request..."></textarea>
</div>
</div>
<!-- Template specific Media -->
<div class="form-group" style="margin-top: 15px;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-images"></i><span>Attach Template Specific Media Assets:</span></label>
<div class="image-uploader-area" id="add-prev-post-dropzone" style="background: #fafbfc; padding: 25px; border-radius: var(--radius-md);">
<span><i class="fa-solid fa-cloud-arrow-up"></i>Drag &amp; drop template specific media here or click to browse...</span>
<input type="file" id="add-prev-post-file-input" multiple accept="image/*" style="display: none;">
</div>
<div class="img-preview-container" id="add-prev-post-previews" style="margin-top: 12px;"></div>
</div>
<button id="btn-submit-new-prev-post" class="btn-primary" style="width: 100%; padding: 12px; margin-top: 20px; background: #0d9488; border: none; box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25); font-size:13px; text-transform:uppercase;"><i class="fa-solid fa-plus"></i><span>Save Template Block to Database</span></button>
</div>
</div>
<!-- Sub-Page C: Template Performance Insights -->
<div id="rot-page-evaluation" class="rot-modal-page" style="display: none; margin-top: 15px;">
<div class="card" style="padding: 24px; background: #ffffff;">
<h4 style="font-size: 14px; font-weight: bold; color: #1e293b; margin-top: 0; margin-bottom: 12px;"><i class="fa-solid fa-chart-column"></i><span>Real-time interaction ratings and success statistics per Template Block</span></h4>
<div class="history-table-container">
<table class="history-table" id="rot-evaluation-table">
<thead>
<tr>
<th><i class="fa-solid fa-heading"></i><span>Template Block Descriptive Title</span></th>
<th><i class="fa-solid fa-calculator"></i><span>Execution Iterations</span></th>
<th><i class="fa-solid fa-circle-check"></i><span>Successful Dispatches</span></th>
<th><i class="fa-solid fa-spinner"></i><span>Under Moderation / Pending</span></th>
<th><i class="fa-solid fa-triangle-exclamation"></i><span>Failures / Restrictions Hit</span></th>
</tr>
</thead>
<tbody id="rot-evaluation-list"></tbody>
<tfoot>
<tr id="rot-evaluation-totals-row" style="font-weight: 900; background: linear-gradient(180deg, #ffffff, #f7fbfe); border-top: 2px solid #cbd5e1;">
<td style="color:#0f172a; font-weight: 900;"><i class="fa-solid fa-sigma"></i><span>Cumulative Analytics Totals:</span></td>
<td id="rot-total-published" style="color:#1e293b; font-weight: 900;"><i class="fa-solid fa-play"></i>0</td>
<td id="rot-total-successful" style="color:#10b981; font-weight: 900;"><i class="fa-solid fa-circle-check"></i>0</td>
<td id="rot-total-reviewed" style="color:#f59e0b; font-weight: 900;"><i class="fa-solid fa-hourglass-half"></i>0</td>
<td id="rot-total-failed" style="color:#ef4444; font-weight: 900;"><i class="fa-solid fa-circle-xmark"></i>0</td>
</tr>
</tfoot>
</table>
</div>
<div id="rot-evaluation-pagination" style="display: flex; justify-content: center; margin-top: 15px; gap: 10px; align-items: center;"></div>
</div>
</div>
</div>
</div>
</section>
<!-- Tab Pane 4: WhatsApp Broadcast -->
<section id="pane-wa-pub" class="tab-pane">
<div class="main-grid" style="grid-template-columns: 1fr 1.5fr;">
<!-- Column Right: WhatsApp Contact & Number Queue Manager -->
<div class="card">
<div class="card-title"><i class="fa-solid fa-address-book"></i><span>WhatsApp Broadcast Targets</span></div>
<div class="form-group">
<label><i class="fa-solid fa-user-plus"></i><span>Target Single Recipient (with Country Code)</span></label>
<input type="text" id="wa-single-number" class="search-box" placeholder="e.g. +xxxxxxxxxxxx">
</div>
<div class="form-group" style="margin-top: 10px;">
<label><i class="fa-solid fa-users-line"></i><span>Bulk Targets (One phone number per line)</span></label>
<textarea id="wa-multiple-numbers" class="search-box" style="height: 120px; font-family: monospace; font-size: 12px;" placeholder="e.g.&#10;+xxxxxxxxxxxx&#10;+xxxxxxxxxxxx&#10;+xxxxxxxxxxxx&#10;+xxxxxxxxxxxx&#10;+xxxxxxxxxxxx"></textarea>
</div>
<!-- CSV contacts parsing module -->
<div class="wa-import-area" id="wa-csv-dropzone">
<strong><i class="fa-solid fa-cloud-arrow-up"></i><span>Drag &amp; drop CSV or TXT contact lists here...</span></strong><br>
<span style="font-size: 11px; color: var(--text-muted);"><i class="fa-solid fa-wand-magic-sparkles"></i><span>Names are parsed automatically for dynamic personalization.</span></span>
<input type="file" id="wa-csv-file-input" accept=".csv,.txt" style="display: none;">
</div>
<div style="display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;">
<button id="btn-wa-validate" class="btn-secondary" style="padding: 5px 10px; font-size: 9px;"><i class="fa-solid fa-shield-halved"></i><span>Verify Phone Formats</span></button>
<button id="btn-wa-dedup" class="btn-secondary" style="padding: 5px 10px; font-size: 9px;"><i class="fa-solid fa-trash-can"></i><span>Clean Duplicates</span></button>
<button id="btn-wa-clear-recipients" class="btn-danger" style="padding: 6px 12px; font-size: 11px; background: #fee2e2; color: #ef4444;"><i class="fa-solid fa-eraser"></i><span>Reset Target Queue</span></button>
</div>
<div style="display: flex; justify-content: space-between; font-size: 12px; font-weight: bold; margin-top: 15px; border-top: 1px solid var(--border); padding-top: 10px;">
<span><i class="fa-solid fa-hashtag"></i><span>Total Queue Count:</span></span>
<span class="recipient-list-badge" id="wa-recipients-count"><i class="fa-solid fa-user-clock"></i>0 Recipients Waiting</span>
</div>
<!-- Active recipients container -->
<div class="groups-container" id="wa-recipients-list" style="max-height: 200px;">
<div style="padding: 15px; text-align: center; color: var(--text-muted); font-size: 12px;"><i class="fa-solid fa-users-slash"></i><span>Queue is empty. Load contacts to start broadcasting.</span></div>
</div>
</div>
<!-- Column Left: WhatsApp Message & Template Composer -->
<div class="card">
<div class="card-title">
<span><i class="fa-solid fa-paper-plane"></i><span>WhatsApp Template Composer</span></span>
</div>
<div style="display: flex; gap: 10px; margin-bottom: 12px;">
<select id="wa-template-select" class="search-box" style="width: auto; flex: 1; padding: 10px;"></select>
<button id="btn-wa-save-template" class="btn-secondary" style="padding: 10px 18px;"><i class="fa-solid fa-floppy-disk"></i><span>Save as Template</span></button>
</div>
<!-- Cooldown recommendations -->
<div class="spintax-panel" style="margin-bottom: 12px;">
<span style="font-size: 11px; font-weight: 800; color: #64748b;"><i class="fa-solid fa-lightbulb"></i><span>Security Tip: Vary message contents to decrease chances of platform monitoring limits.</span></span>
</div>
<textarea id="wa-message-text" class="main-composer" placeholder="Compose broadcast message copy here... Use brackets: {name} for recipient name, {phone} for phone number, and {date} to inject the current date dynamically."></textarea>
<div style="margin-bottom: 12px; display: flex; gap: 5px; flex-wrap: wrap;">
<span style="font-size: 12px; color: var(--text-muted); font-weight: bold;"><i class="fa-solid fa-tags"></i><span>Insert Personalization tags:</span></span>
<button class="btn-wa-var-insert" data-var="{name}" style="font-size: 11px; padding: 2px 6px;"><i class="fa-solid fa-user"></i><span>Name</span></button>
<button class="btn-wa-var-insert" data-var="{phone}" style="font-size: 11px; padding: 2px 6px;"><i class="fa-solid fa-phone"></i><span>Phone</span></button>
<button class="btn-wa-var-insert" data-var="{date}" style="font-size: 11px; padding: 2px 6px;"><i class="fa-solid fa-calendar-day"></i><span>Date</span></button>
</div>
<!-- Broadcast Target Launch Option -->
<div class="form-group" style="margin-top: 15px;">
<label style="font-size: 13px; font-weight: bold; color: var(--text-muted);"><i class="fa-solid fa-window-restore"></i><span>Broadcast Launch Target Mode</span></label>
<select id="wa-launch-mode" class="search-box">
<option value="tab" selected>Open chats in background tabs (Standard)</option>
<option value="window">Open chats in separate sandbox windows (Popup Isolation)</option>
</select>
</div>
<div class="composer-actions" style="margin-top: 25px;">
<button id="btn-wa-start" class="btn-primary" style="background:#00a884; flex-grow: 2;"><i class="fa-solid fa-paper-plane"></i><span>Launch WhatsApp Broadcast Campaign</span></button>
<button id="btn-wa-stop" class="btn-danger" style="flex-grow: 1;" disabled><i class="fa-solid fa-hand"></i><span>Pause / Freeze Broadcast</span></button>
</div>
</div>
</div>
</section>
<!-- Tab Pane 5: Account Details -->
<section id="pane-account-details" class="tab-pane">
<div class="card">
<div class="card-title">
<span><i class="fa-solid fa-id-card-clip"></i><span>Account Tier &amp; Progression Matrix</span></span>
</div>
<!-- XP Progression Bar -->
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.02);">
<div style="display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px;">
<div>
<h3 style="font-size: 18px; color: #1e293b; margin: 0;"><i class="fa-solid fa-trophy" style="color:#eab308;"></i><span>Workspace Level: </span><span id="acc-details-level" style="color: #4338ca; font-weight: 900; font-size: 24px;">1</span></h3>
<p style="font-size: 12px; color: var(--text-muted); margin: 0;"><i class="fa-solid fa-chart-line"></i><span>Accumulated XP: </span><span id="acc-details-xp">0</span><span> / </span><span id="acc-details-next-xp">1000</span><span> XP</span></p>
</div>
<div style="text-align: right;">
<span id="acc-details-rank" class="badge" style="background: #e0f2fe; color: #4338ca; border: 1px solid #c7d2fe; font-size: 12px;"><i class="fa-solid fa-award"></i><span>Novice Marketer</span></span>
</div>
</div>
<div class="progress-bar-bg" style="height: 12px; margin-top: 10px; background: #e2e8f0; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);">
<div class="progress-bar-fill" id="acc-details-xp-fill" style="background: linear-gradient(90deg, #6366f1, #8b5cf6); width: 0%;"></div>
</div>
</div>
<div class="main-grid" style="grid-template-columns: 1fr; gap: 20px;">
<!-- Workspace Achievements -->
<div class="card" style="box-shadow: none; border-color: #cbd5e1; background-color: linear-gradient(180deg, #ffffff, #f7fbfe)">
<h4 style="font-size: 14px; margin-bottom: 15px; color: #334155; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px;"><i class="fa-solid fa-chart-column"></i><span>Workspace Achievements</span></h4>
<div style="display: flex; flex-direction: column; gap: 10px; font-size: 13px;">
<div style="display: flex; justify-content: space-between;">
<span style="color: var(--text-muted);"><i class="fa-brands fa-facebook"></i><span>Lifetime Facebook Posts:</span></span>
<strong id="acc-lifetime-fb" style="color: #1d4ed8;"><i class="fa-solid fa-circle-check"></i>0 successful</strong>
</div>
<div style="display: flex; justify-content: space-between;">
<span style="color: var(--text-muted);"><i class="fa-brands fa-whatsapp"></i><span>Lifetime WhatsApp Broadcasts:</span></span>
<strong id="acc-lifetime-wa" style="color: #15803d;"><i class="fa-solid fa-paper-plane"></i>0 dispatched</strong>
</div>
</div>
</div>
</div>
<!-- Account ID Cryptographic display -->
<div style="margin-top: 25px; border-top: 1px dashed #cbd5e1; padding-top: 20px;">
<h4 style="font-size: 14px; font-weight: bold; color: #1e293b; margin-bottom: 10px;">
<i class="fa-solid fa-fingerprint"></i><span>Cryptographic Account Identifier (128 characters)</span>
</h4>
<p style="font-size: 12px; color: var(--text-muted); margin-bottom: 15px;">
<i class="fa-solid fa-circle-info"></i><span>This cryptographic ID is unique to your local installation. Use it to receive verified points packages and licensing tokens (.txt) from other accounts without tampering risks.</span>
</p>
<div style="display: flex; gap: 10px; align-items: center; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 15px; border: 1px solid #e2e8f0; border-radius: 8px;">
<div style="flex: 1;">
<label style="font-size: 11px; font-weight: bold; color: #64748b; margin-bottom: 4px; display: block;"><i class="fa-solid fa-id-card"></i><span>Workspace Public Key:</span></label>
<input type="text" id="account-id-display" readonly style="width: 100%; padding: 10px; font-family: monospace; font-size: 10px; font-weight: bold; letter-spacing: 0.5px; color: #1e293b; border: 1px solid #cbd5e1; border-radius: 4px; background: white;" value="Resolving secure identifier...">
</div>
<button id="btn-copy-account-id" class="btn-secondary" style="padding: 10px; align-self: flex-end;" title="Copy Public Key">
<i class="fa-solid fa-copy"></i>
</button>
</div>
<!-- Destroy Identity Warnings -->
<div style="margin-top: 20px;">
<button id="btn-regenerate-account" class="btn-danger" style="background: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; box-shadow: none;">
<i class="fa-solid fa-triangle-exclamation"></i><span>Destroy Current Identity &amp; Generate New Key (128 characters)</span>
</button>
<p style="font-size: 11px; color: #ef4444; margin-top: 6px; font-weight: bold;">
<i class="fa-solid fa-skull-crossbones"></i><span>CRITICAL WARNING: This action is irreversible. Regenerating your workspace public key invalidates all pending point packages (.txt) generated specifically for your old key.</span>
</p>
</div>
</div>
</div>
</section>
<!-- Tab Pane 6: Wallet and Serial Key management -->
<section id="pane-wallet" class="tab-pane">
<!-- Unified Balances Hero Segment -->
<div class="card">
<div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; border-bottom: 1px solid #e2e8f0; padding-bottom: 15px; margin-bottom: 20px;">
<div>
<h3 style="font-size: 18px; font-weight: 900; color: #1e293b; margin: 0; display: flex; align-items: center; gap: 8px;">
<i class="fa-solid fa-vault" style="color: #4f46e5;"></i><span>Secure Cryptographic Asset Vault</span>
</h3>
<p style="font-size: 11px; color: #64748b; margin: 4px 0 0 0;">
<i class="fa-solid fa-shield-halved"></i><span>All ledger updates, serial creations, and redemption top-ups are cryptographically signed using AES-256-GCM hardware protection keys.</span>
</p>
</div>
<div>
<span class="badge green" style="font-size: 11px; padding: 6px 14px;"><i class="fa-solid fa-shield-halved"></i><span>Double-Anchor (SIS) Active</span></span>
</div>
</div>
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;">
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 16px; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 6px;">
<span style="font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;"><i class="fa-solid fa-circle-dollar-to-slot" style="color: #0d9488;"></i><span>USD Available Balance</span></span>
<strong style="font-size: 24px; color: #10b981; text-align: center;"><span id="wallet-usd-balance">0.00</span></strong>
</div>
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 16px; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 6px;">
<span style="font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;"><i class="fa-brands fa-facebook" style="color: #1d4ed8;"></i><span>Facebook Dispatch Cards</span></span>
<strong style="font-size: 24px; color: #1d4ed8; text-align: center;"><span id="wallet-fb-cards">0</span></strong>
</div>
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 16px; border-radius: 12px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 6px;">
<span style="font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;"><i class="fa-brands fa-whatsapp" style="color: #15803d;"></i><span>WhatsApp Broadcast Cards</span></span>
<strong style="font-size: 24px; color: #15803d; text-align: center;"><span id="wallet-wa-cards">0</span></strong>
</div>
</div>
</div>
<!-- Dynamic Two-Column Layout Grid -->
<div style="display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start;">
<!-- Column Left: Combined Interactive Workspace -->
<div class="card" style="padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border)">
<!-- Interactive Segment Navigation Switches -->
<div class="rot-nav-tabs" style="border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; gap: 5px;">
<div class="rot-tab-btn active" data-wallet-sub="sub-wallet-redeem-serial" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px;">
<i class="fa-solid fa-key"></i><span>Redeem Code Key</span>
</div>
<div class="rot-tab-btn" data-wallet-sub="sub-wallet-gen-serial" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px;">
<i class="fa-solid fa-plus-minus"></i><span>Compile Serial Package</span>
</div>
</div>
<!-- Workspace Sub-Pane A: Redeem Serial Key -->
<div id="sub-wallet-redeem-serial" class="wallet-sub-pane" style="display: block;">
<div class="form-group">
<label style="font-size: 11px; font-weight: bold; color: #334155;"><i class="fa-solid fa-paste"></i><span>Paste Serial License Code Block:</span></label>
<textarea id="serial-redeem-input-code" class="search-box" style="height: 110px; font-family: monospace; font-size: 8px; resize: none; background: #fafbfc; border-color: #cbd5e1;" placeholder="Cryptographic Serial"></textarea>
</div>
<div class="form-group" style="margin-top: 10px;">
<label style="font-size: 11px; font-weight: bold; color: #334155;"><i class="fa-solid fa-lock"></i><span>Decryption Passphrase Protection (If Encrypted):</span></label>
<input type="password" id="serial-redeem-input-password" class="search-box" style="padding: 10px; background: #fafbfc; border-color: #cbd5e1;" placeholder="Leave blank if the license key is publicly unlocked...">
</div>
<button id="btn-redeem-serial-key" class="btn-primary" style="width: 100%; margin-top: 15px; padding: 14px; background: #00a884; font-size: 13px; box-shadow: 0 4px 10px rgba(0, 168, 132, 0.25);">
<i class="fa-solid fa-arrow-down-to-bracket"></i><span>Decrypt, Verify &amp; Redeem Serial Balance</span>
</button>
<div id="serial-redeem-status-msg" style="font-size: 11px; font-weight: bold; text-align: center; margin-top: 12px; padding: 8px; border-radius: 6px;"></div>
</div>
<!-- Workspace Sub-Pane B: Compile / Generate Serial Key -->
<div id="sub-wallet-gen-serial" class="wallet-sub-pane" style="display: none;">
<!-- Step 1: Asset Quantification Selection Grid -->
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0;">
<div class="form-group" style="margin:0;">
<label style="font-size: 10px; color: #475569;"><i class="fa-solid fa-dollar-sign"></i><span>USD Amount:</span></label>
<input type="number" id="serial-gen-points" value="0.00" min="0" step="0.01" class="search-box" style="padding: 8px; font-weight: bold; text-align: center;">
</div>
<div class="form-group" style="margin:0;">
<label style="font-size: 10px; color: #475569;"><i class="fa-brands fa-facebook"></i><span>FB Cards:</span></label>
<input type="number" id="serial-gen-fb-cards" value="0" min="0" class="search-box" style="padding: 8px; font-weight: bold; text-align: center;">
</div>
<div class="form-group" style="margin:0;">
<label style="font-size: 10px; color: #475569;"><i class="fa-brands fa-whatsapp"></i><span>WA Cards:</span></label>
<input type="number" id="serial-gen-wa-cards" value="0" min="0" class="search-box" style="padding: 8px; font-weight: bold; text-align: center;">
</div>
</div>
<!-- Step 2: Target Recipient Account Security -->
<div class="form-group" style="margin-bottom: 12px;">
<label style="font-size: 11px; font-weight: bold; color: #334155;"><i class="fa-solid fa-address-card"></i><span>Recipient Public Account ID Lock (128 Characters):</span></label>
<input type="text" id="serial-gen-recipient-id" class="search-box" style="font-family: monospace; font-size: 10px; padding: 10px; background: #fafbfc; border-color: #cbd5e1;" placeholder="Paste the recipient's exact 128-character public identifier key...">
</div>
<!-- Step 3: Passphrase & Management Note -->
<div style="display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; margin-bottom: 15px;">
<div class="form-group" style="margin: 0;">
<label style="font-size: 11px; font-weight: bold; color: #334155;"><i class="fa-solid fa-lock"></i><span>Optional Key Password:</span></label>
<input type="password" id="serial-gen-password" class="search-box" style="padding: 10px; background: #fafbfc; border-color: #cbd5e1;" placeholder="Set access passphrase...">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 11px; font-weight: bold; color: #334155;"><i class="fa-solid fa-comment-dots"></i><span>Internal Memo note:</span></label>
<input type="text" id="serial-gen-note" class="search-box" style="padding: 10px; background: #fafbfc; border-color: #cbd5e1;" placeholder="e.g. Package for region group...">
</div>
</div>
<!-- Action: Immediate Deduction Trigger -->
<button id="btn-generate-serial-key" class="btn-primary" style="width: 100%; padding: 14px; font-size: 13px; background: #4f46e5; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);">
<i class="fa-solid fa-screwdriver-wrench"></i><span>Deduct Balances &amp; Package Serial ZIP File</span>
</button>
<div id="serial-gen-status-msg" style="font-size: 11px; font-weight: bold; text-align: center; margin-top: 10px; padding: 8px; border-radius: 6px;"></div>
<!-- Output Box Segment -->
<div style="margin-top: 15px; border-top: 1px dashed #cbd5e1; padding-top: 15px;">
<label style="font-size: 11px; font-weight: bold; color: #64748b; display: block; margin-bottom: 6px;"><i class="fa-solid fa-code"></i><span>Generated Cryptographic Serial Output:</span></label>
<div style="display: flex; gap: 8px;">
<input type="text" id="gen-serial-key-output" class="search-box" readonly style="font-family: monospace; font-size: 10px; background: linear-gradient(180deg, #ffffff, #f7fbfe); border-color: #cbd5e1;" placeholder="Generated file payload will write here...">
<button id="btn-copy-generated-serial-output" class="btn-secondary" style="padding: 10px; border-color: #cbd5e1;" title="Copy Output to Clipboard"><i class="fa-solid fa-copy"></i></button>
</div>
</div>
</div>
</div>
<!-- Column Right: Secure Transactions Audit Ledger -->
<div class="card" style="padding: 20px; box-shadow: var(--shadow-sm); min-height: 480px; display: flex; flex-direction: column; border: 1px solid var(--border)">
<div style="border-bottom: 2px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 15px;">
<h4 style="font-size: 13px; font-weight: 800; color: #1e293b; margin: 0; display: flex; align-items: center; gap: 6px;">
<i class="fa-solid fa-receipt" style="color: #4f46e5;"></i><span>Vault Transaction Registry</span>
</h4>
<span style="font-size: 10px; color: #64748b; display: block; margin-top: 2px;">
<i class="fa-solid fa-circle-info"></i><span>A structured historical audit trail of all asset fluctuations.</span>
</span>
</div>
<!-- Ledger Database Table Container -->
<div class="history-table-container" style="flex: 1; max-height: 420px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 8px;">
<table style="width: 100%; font-size: 11px;">
<thead>
<tr>
<th style="font-size: 10px; padding: 10px;"><i class="fa-solid fa-clock"></i><span>Timestamp</span></th>
<th style="font-size: 10px; padding: 10px;"><i class="fa-solid fa-comment-dots"></i><span>Audit Memo</span></th>
<th style="font-size: 10px; padding: 10px; text-align: center;"><i class="fa-solid fa-circle-nodes"></i><span>Asset</span></th>
<th style="font-size: 10px; padding: 10px; text-align: right;"><i class="fa-solid fa-plus-minus"></i><span>Change</span></th>
</tr>
</thead>
<tbody id="wallet-transactions-tbody">
<tr>
<td colspan="4" style="text-align: center; color: var(--text-muted); padding: 20px;">
<i class="fa-solid fa-circle-info"></i><span>No transaction records found in this vault.</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<!-- Tab Pane 7: Store Panel -->
<section id="pane-store" class="tab-pane">
<div class="card">
<div class="card-title" style="display: flex; justify-content: space-between; align-items: center;">
<span><i class="fa-solid fa-cart-shopping"></i><span>Fritree Asset Exchange Store</span></span>
<span style="font-size: 13px; color: #b45309;"><i class="fa-solid fa-wallet"></i><span>Current Balance: </span><b id="store-pts-balance"><i class="fa-solid fa-dollar-sign"></i>0.00</b><span> USD</span></span>
</div>
<h3 style="font-size: 14px; color: #334155; margin-bottom: 15px; border-bottom: 2px solid var(--bg-main); padding-bottom: 8px;"><i class="fa-solid fa-arrows-rotate"></i><span>Card Exchange Console</span></h3>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
<!-- Facebook Packages -->
<div>
<h4 style="font-size: 13px; font-weight: bold; color: #475569; margin-bottom: 10px; text-transform: uppercase;"><i class="fa-brands fa-facebook" style="color:#1d4ed8;"></i><span>Facebook Card Exchanges</span></h4>
<div id="store-fb-packages" style="display:flex; flex-direction:column; gap:10px;"></div>
</div>
<!-- WhatsApp Packages -->
<div>
<h4 style="font-size: 13px; font-weight: bold; color: #475569; margin-bottom: 10px; text-transform: uppercase;"><i class="fa-brands fa-whatsapp" style="color:#15803d;"></i><span>WhatsApp Card Exchanges</span></h4>
<div id="store-wa-packages" style="display:flex; flex-direction:column; gap:10px;"></div>
</div>
</div>
</div>
</section>
<!-- Tab Pane 8: Campaign History and Reports -->
<section id="pane-history" class="tab-pane">
<div class="card" id="history-panel" style="margin: 0;">
<div class="card-title" style="display: flex; justify-content: space-between; align-items: center;">
<span><i class="fa-solid fa-box-archive"></i><span>Campaign Archive &amp; Performance Ledger</span></span>
<button id="btn-export-history" class="btn-secondary"><i class="fa-solid fa-file-csv"></i><span>Export Ledger as CSV</span></button>
</div>
<!-- History Quick Insights -->
<div class="history-insights">
<div class="insight-card">
<div class="i-val" id="ins-total-camp"><i class="fa-solid fa-hashtag"></i>0</div>
<div class="i-lbl"><i class="fa-solid fa-list-check"></i><span>Campaigns Completed</span></div>
</div>
<div class="insight-card">
<div class="i-val" id="ins-total-posts"><i class="fa-solid fa-circle-check"></i>0</div>
<div class="i-lbl"><i class="fa-solid fa-paper-plane"></i><span>Successful Dispatches</span></div>
</div>
<div class="insight-card">
<div class="i-val" id="ins-success-rate" style="color: var(--success);"><i class="fa-solid fa-percent"></i>0%</div>
<div class="i-lbl"><i class="fa-solid fa-gauge-high"></i><span>Cumulative Efficiency</span></div>
</div>
<div class="insight-card">
<div class="i-val" id="ins-best-day" style="font-size: 18px;"><i class="fa-solid fa-calendar-day"></i>-</div>
<div class="i-lbl"><i class="fa-solid fa-chart-line"></i><span>Peak Performance Day</span></div>
</div>
</div>
<!-- Trends Chart Container -->
<div class="trends-container">
<div class="trends-title"><i class="fa-solid fa-chart-simple"></i><span>Dispatch &amp; Broadcast Frequency (Last 7 Active Days)</span></div>
<div class="chart-grid" id="trends-chart"></div>
</div>
<!-- Search Filters -->
<div class="history-filters-grid">
<input type="text" id="hist-search" class="search-box" placeholder="Search by campaign name or dispatch keywords...">
<div class="form-group"><input type="date" id="hist-date-from" title="Start Date"></div>
<div class="form-group"><input type="date" id="hist-date-to" title="End Date"></div>
<div class="form-group">
<select id="hist-status-filter">
<option value="all">All Campaign Statuses</option>
<option value="Completed">Completed successfully</option>
<option value="Stopped">Stopped manually</option>
<option value="Running">Running currently</option>
</select>
</div>
</div>
<!-- Ledger Table -->
<div class="history-table-container">
<table class="history-table" id="history-table">
<thead>
<tr>
<th style="width: 25%;"><i class="fa-solid fa-circle-info"></i><span>Campaign Details</span></th>
<th style="width: 20%;"><i class="fa-solid fa-calendar-days"></i><span>Dispatch Date</span></th>
<th style="width: 25%;"><i class="fa-solid fa-percent"></i><span>Success Rate</span></th>
<th style="width: 15%;"><i class="fa-solid fa-shield-halved"></i><span>Dispatch Status</span></th>
<th style="width: 15%; text-align: center;"><i class="fa-solid fa-sliders"></i><span>Actions</span></th>
</tr>
</thead>
<tbody id="history-tbody">
<tr><td colspan="5" style="text-align: center; color: var(--text-muted);"><i class="fa-solid fa-circle-info"></i><span>No campaign dispatches recorded yet in this workspace.</span></td></tr>
</tbody>
</table>
</div>
</div>
<!-- Technical Report Exporter -->
<div class="card" id="export-panel" style="display: block;">
<div class="card-title">
<span><i class="fa-solid fa-file-invoice-dollar"></i><span>Report Generator</span></span>
</div>
<div class="export-grid">
<div class="export-section">
<h3><i class="fa-solid fa-calendar"></i><span>1. Select Report Type &amp; Date Range</span></h3>
<div class="form-group">
<label><i class="fa-solid fa-database"></i><span>Data to include:</span></label>
<select id="export-data-type">
<option value="campaigns">Key Performance Indicators (KPI) Summary</option>
<option value="logs">Individual Delivery logs &amp; Dispatch Ledger</option>
</select>
</div>
<div class="form-group" style="margin-top: 10px;">
<label><i class="fa-solid fa-paint-roller"></i><span>Report Template Theme:</span></label>
<select id="export-template">
<option value="standard">Standard Technical Report Format</option>
<option value="executive">Executive Board &amp; Manager Summary</option>
</select>
</div>
<div style="display: flex; gap: 10px; margin-top: 10px;">
<div class="form-group" style="flex: 1;"><label><i class="fa-solid fa-calendar-days"></i><span>From Date</span></label><input type="date" id="export-date-from"></div>
<div class="form-group" style="flex: 1;"><label><i class="fa-solid fa-calendar-days"></i><span>To Date</span></label><input type="date" id="export-date-to"></div>
</div>
</div>
<div class="export-section">
<h3><i class="fa-solid fa-gears"></i><span>2. Format &amp; Output Configuration</span></h3>
<div class="form-group" style="margin-bottom: 15px;">
<label><i class="fa-solid fa-file-export"></i><span>Export Format:</span></label>
<select id="export-format">
<option value="pdf">Print-Ready Document Format (PDF)</option>
<option value="csv">Standard Data Sheet Format (CSV)</option>
<option value="xls">Microsoft Excel Spreadsheet (XLS)</option>
<option value="json">Raw Programmer JSON Object (JSON)</option>
</select>
</div>
<div class="export-checkboxes">
<label><input type="checkbox" id="col-id" checked><i class="fa-solid fa-hashtag"></i><span> Include Unique ID fields</span></label>
<label><input type="checkbox" id="col-name" checked><i class="fa-solid fa-heading"></i><span> Include Campaign Names</span></label>
<label><input type="checkbox" id="col-date" checked><i class="fa-solid fa-clock"></i><span> Include Dispatched Timestamps</span></label>
<label><input type="checkbox" id="col-status" checked><i class="fa-solid fa-circle-info"></i><span> Include Final States</span></label>
<label><input type="checkbox" id="col-stats" checked><i class="fa-solid fa-chart-line"></i><span> Include Operational metrics</span></label>
</div>
</div>
</div>
<div style="display: flex; justify-content: flex-end; margin-top: 20px;">
<button id="btn-generate-report" class="btn-primary" style="padding: 12px 24px;"><i class="fa-solid fa-file-arrow-down"></i><span>Generate &amp; Download Document</span></button>
</div>
</div>
</section>
<!-- Tab Pane 9: Migration Panel -->
<section id="pane-migration" class="tab-pane">
<div class="card">
<div class="card-title">
<span><i class="fa-solid fa-database"></i><span>Workspace System Backup &amp; State Migration</span></span>
</div>
<div class="export-grid" style="margin-top: 0;">
<div class="export-section">
<h3><i class="fa-solid fa-filter"></i><span>Choose data blocks to include in your package:</span></h3>
<div class="export-checkboxes">
<div class="checkbox-group"><input type="checkbox" id="chk-ie-cl" checked> <label><i class="fa-solid fa-arrows-spin"></i><span>Rotation Matrix &amp; Broadcast Templates</span></label></div>
<div class="checkbox-group"><input type="checkbox" id="chk-ie-ch" checked> <label><i class="fa-solid fa-box-archive"></i><span>Campaign History &amp; Delivery Ledgers</span></label></div>
<div class="checkbox-group"><input type="checkbox" id="chk-ie-sch" checked> <label><i class="fa-solid fa-calendar-day"></i><span>Scheduled Tasks &amp; Dispatch Queue</span></label></div>
<div class="checkbox-group"><input type="checkbox" id="chk-ie-grp" checked> <label><i class="fa-solid fa-users"></i><span>Groups Registry &amp; Saved Target Segments</span></label></div>
<div class="checkbox-group"><input type="checkbox" id="chk-ie-int" checked> <label><i class="fa-solid fa-user-secret"></i><span>Cooldown Parameters &amp; Stealth Profiles</span></label></div>
</div>
<div class="checkbox-group" style="margin-top:10px; border-top: 1px solid #e2e8f0; padding-top: 10px;">
<input type="checkbox" id="chk-ie-all" checked>
<label style="font-weight:bold; color:var(--primary);"><i class="fa-solid fa-folder-open"></i><span>Package All Local Database Store Blocks</span></label>
</div>
</div>
<!-- Import/Export Tools -->
<div class="export-section">
<h3><i class="fa-solid fa-shield-halved"></i><span>Secure Export / Import Console</span></h3>
<p style="font-size: 12px; color: var(--text-muted); margin-bottom: 15px;">
<i class="fa-solid fa-circle-info"></i><span>Export your workspace settings, targets, templates, and logs into a single encrypted backups file (.txt) to safely migrate your setup.</span>
</p>
<!-- Target Account restrictions -->
<div class="form-group" style="margin-bottom: 12px;">
<label style="font-size: 11px; font-weight: bold;"><i class="fa-solid fa-lock"></i><span>Restrict Backup file to a specific Account ID (Optional):</span></label>
<input type="text" id="export-restricted-target-id" class="search-box" style="font-family: monospace; font-size: 11px;" placeholder="Paste the target public key to restrict restoring on other systems...">
</div>
<div style="display: flex; gap: 10px; margin-bottom: 10px;">
<button id="btn-export-settings" class="btn-primary" style="flex: 1;"><i class="fa-solid fa-file-export"></i><span>Export Backup Package</span></button>
<button id="btn-import-settings-trigger" class="btn-secondary" style="flex: 1; background: #f59e0b; color: white;"><i class="fa-solid fa-file-import"></i><span>Import Backup Package</span></button>
<input type="file" id="file-import-settings" accept=".txt" style="display: none;">
</div>
<div id="ie-status-msg" style="font-size: 11px; color: var(--success); font-weight: bold; text-align: center;"></div>
</div>
</div>
</div>
</section>
<!-- Tab Pane 10: Support & Currency Exchange -->
<section id="pane-support" class="tab-pane">
<div class="main-grid" style="grid-template-columns: 1fr 1.2fr;">
<!-- Column Left: Contact Support via WhatsApp -->
<div class="card" style="padding: 24px; box-shadow: var(--shadow-md);">
<div class="card-title" style="border-bottom: 2px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 20px;">
<span style="font-size: 16px; font-weight: 900; color: #1e293b; display: flex; align-items: center; gap: 8px;">
<i class="fa-solid fa-headset"></i><span>Contact Workspace Support</span>
</span>
</div>
<p style="font-size: 13px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.6;">
<i class="fa-solid fa-comment-sms"></i><span>Need assistance, licensing inquiries, or direct credit top-up approvals? Our team is available. Open a secure chat directly on WhatsApp.</span>
</p>
<div style="display: flex; flex-direction: column; gap: 15px;">
<div>
<label style="font-size: 11px; font-weight: bold; color: #64748b; margin-bottom: 4px; display: block;"><i class="fa-brands fa-whatsapp"></i><span>WhatsApp Number:</span></label>
<div style="font-size: 15px; font-weight: 600; color: #075e54; background: #e8f5e9; border: 1px solid #c8e6c9; padding: 10px 15px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 8px;">
<i class="fa-brands fa-whatsapp fa-lg" style="color: #25d366;"></i><span>+201096896689</span>
</div>
</div>
<div>
<label style="font-size: 11px; font-weight: bold; color: #64748b; margin-bottom: 4px; display: block;"><i class="fa-solid fa-id-card"></i><span>Verified Workspace ID:</span></label>
<input type="text" id="support-workspace-id-display" readonly style="width: 100%; padding: 10px; font-family: monospace; font-size: 11px; font-weight: bold; background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 4px; color: #1e293b;" value="Loading...">
</div>
</div>
<button id="btn-open-wa-support" class="btn-primary" style="width: 100%; margin-top: 25px; padding: 14px; background: #25d366; font-size: 14px; font-weight: 800; display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.25);">
<i class="fa-brands fa-whatsapp"></i><span>Open Chat on WhatsApp</span>
</button>
</div>
<!-- Column Right: USD Credit Purchase & Currency Exchange Calculator -->
<div class="card" style="padding: 24px; box-shadow: var(--shadow-md);">
<div class="card-title" style="border-bottom: 2px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 20px;">
<span style="font-size: 16px; font-weight: 900; color: #1e293b; display: flex; align-items: center; gap: 8px;">
<i class="fa-solid fa-calculator"></i><span>Credit Purchase &amp; Exchange Calculator</span>
</span>
</div>
<!-- Rate Synchronization Status Control Block -->
<div style="display: flex; align-items: center; justify-content: space-between; background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 14px; margin-bottom: 15px; font-size: 12px;">
<div style="display: flex; align-items: center; gap: 8px; color: #475569;">
<i id="rate-sync-spinner" class="fa-solid fa-spinner fa-spin" style="display: none; color: #1877f2;"></i>
<span id="rate-sync-status-text" style="font-weight: bold;"><i class="fa-solid fa-arrows-rotate"></i><span>Loading exchange parameters...</span></span>
</div>
<button id="btn-sync-rates-now" class="btn-secondary" style="padding: 6px 12px; font-size: 11px; height: auto;">
<i class="fa-solid fa-arrows-rotate"></i><span> Sync Now</span>
</button>
</div>
<!-- Conversion Form Grid -->
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px;">
<div class="form-group" style="margin: 0;">
<label style="font-size: 11px; font-weight: bold; color: #475569;"><i class="fa-solid fa-money-bill-transfer"></i><span>Payment Currency:</span></label>
<select id="calc-payment-currency" class="search-box" style="padding: 10px; font-weight: bold;">
<option value="AUD">Australian Dollar (AUD)</option>
<option value="CAD">Canadian Dollar (CAD)</option>
<option value="EGP" selected>Egyptian Pound (EGP)</option>
<option value="EUR">Euro (EUR)</option>
<option value="GBP">Pound Sterling (GBP)</option>
<option value="QAR">Qatari Riyal (QAR)</option>
<option value="SAR">Saudi Riyal (SAR)</option>
<option value="CHF">Swiss Franc (CHF)</option>
<option value="AED">UAE Dirham (AED)</option>
<option value="USD">US Dollar (USD)</option>
</select>
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 11px; font-weight: bold; color: #475569;"><i class="fa-solid fa-money-bill-wave"></i><span>Receive Currency:</span></label>
<select id="calc-receive-currency" class="search-box" style="padding: 10px; font-weight: bold;">
<option value="USD" selected>US Dollar (USD)</option>
</select>
</div>
</div>
<!-- Pricing fields and live dynamic conversion -->
<div style="display: flex; flex-direction: column; gap: 15px; background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 20px; margin-bottom: 20px;">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: center;">
<div class="form-group" style="margin: 0;">
<label style="font-size: 11px; font-weight: bold; color: #475569;" id="lbl-payment-amount"><i class="fa-solid fa-circle-minus"></i><span>Amount to Send:</span></label>
<input type="number" id="calc-payment-amount" value="0.00" min="0.01" step="0.01" class="search-box" style="padding: 10px; font-weight: bold; text-align: center; font-size: 15px;">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 11px; font-weight: bold; color: #475569;" id="lbl-receive-amount"><i class="fa-solid fa-circle-plus"></i><span>Credit to Receive:</span></label>
<input type="number" id="calc-receive-amount" value="10.00" min="0.01" step="0.01" class="search-box" style="padding: 10px; font-weight: bold; text-align: center; font-size: 15px;">
</div>
</div>
<div style="border-top: 1px dashed #cbd5e1; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #475569; font-weight: bold;">
<span><i class="fa-solid fa-chart-line"></i><span>Internet Exchange Rate:</span></span>
<span style="color: #1877f2; font-size: 13px;" id="lbl-live-exchange-rate">0 USD = 0 EGP</span>
</div>
</div>
<div style="margin-top: auto; display: flex; flex-direction: column; gap: 10px;">
<button id="btn-checkout-via-wa" class="btn-primary" style="padding: 14px; font-size: 14px; font-weight: 800; background: #00a884; box-shadow: 0 4px 10px rgba(0, 168, 132, 0.25);">
<i class="fa-solid fa-ticket"></i><span>Generate Secure Ticket &amp; Purchase</span>
</button>
</div>
</div>
<!-- Secure Payment Methods Card Section -->
<div class="card" style="grid-column: span 2; padding: 24px; box-shadow: var(--shadow-md); margin-top: 20px;">
<div class="card-title" style="border-bottom: 2px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; width: 100%;">
<span style="font-size: 16px; font-weight: 900; color: #1e293b; display: flex; align-items: center; gap: 8px;">
<i class="fa-solid fa-building-columns" style="color: #059669;"></i><span>Secure Payment Methods &amp; Accounts</span>
</span>
<span style="font-size: 11px; color: #64748b; font-weight: bold;"><i class="fa-solid fa-shield-halved" style="color:#059669;"></i><span> Verified Recipient</span></span>
</div>
<!-- Tab Selection Navigation Switches -->
<div class="rot-nav-tabs" style="border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; display: flex; gap: 5px;">
<div class="rot-tab-btn active" id="tab-pm-bank" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;">
<i class="fa-solid fa-bank"></i><span>Bank Transfer</span>
</div>
<div class="rot-tab-btn" id="tab-pm-instapay" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;">
<i class="fa-solid fa-mobile-screen-button"></i><span>Instant Transfer</span>
</div>
<div class="rot-tab-btn" id="tab-pm-wallets" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;">
<i class="fa-solid fa-wallet"></i><span>Electronic Wallets</span>
</div>
</div>
<!-- Tab Pane 1: Bank Transfer -->
<div id="pm-content-bank" class="pm-sub-pane" style="display: block;">
<p style="font-size: 12px; color: var(--text-muted); margin-bottom: 15px;">
<i class="fa-solid fa-circle-info"></i><span> Make a bank transfer to our CIB corporate currency accounts. Select your desired currency below to fetch and copy the account parameters instantly.</span>
</p>
<div style="display: grid; grid-template-columns: 1.2fr 2fr; gap: 20px; align-items: center; background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 18px;">
<div class="form-group" style="margin: 0;">
<label style="font-weight: bold; color: #475569;"><i class="fa-solid fa-coins"></i><span>Selected Account Currency:</span></label>
<select id="pm-bank-currency-select" class="search-box" style="padding: 10px; font-weight: bold; border-color: #cbd5e1;">
<option value="AUD">Australian Dollar (AUD)</option>
<option value="CAD">Canadian Dollar (CAD)</option>
<option value="EGP" selected>Egyptian Pound (EGP)</option>
<option value="EUR">Euro (EUR)</option>
<option value="GBP">Pound Sterling (GBP)</option>
<option value="QAR">Qatari Riyal (QAR)</option>
<option value="SAR">Saudi Riyal (SAR)</option>
<option value="CHF">Swiss Franc (CHF)</option>
<option value="AED">UAE Dirham (AED)</option>
<option value="USD">US Dollar (USD)</option>
</select>
</div>
<div style="display: flex; flex-direction: column; gap: 8px; border-left: 1px dashed #cbd5e1; padding-left: 20px;">
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-building"></i><span>Bank Name:</span></span>
<strong style="font-size: 13px; color: #1e293b;">Commercial International Bank (CIB)</strong>
</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-user"></i><span>Account Holder's Name:</span></span>
<strong style="font-size: 13px; color: #1e293b;" id="pm-bank-holder">Mohamed Ahmed Mohamed Farouk</strong>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 4px;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-hashtag"></i><span>Account Number:</span></span>
<div style="display: flex; gap: 8px; align-items: center;">
<input type="text" id="pm-bank-account-num" readonly style="padding: 6px 12px; font-family: monospace; font-size: 13px; font-weight: bold; background: white; border: 1px solid #cbd5e1; border-radius: 6px; color: #1e293b; width: 170px; text-align: center;" value="100054187089">
<button id="btn-copy-pm-bank-account" class="btn-secondary" style="padding: 6px 12px; height: auto; border: 1px solid #cbd5e1;" title="Copy Account Number"><i class="fa-solid fa-copy"></i></button>
</div>
</div>
</div>
</div>
</div>
<!-- Tab Pane 2: Instapay Egypt Transfer Detail -->
<div id="pm-content-instapay" class="pm-sub-pane" style="display: none;">
<p style="font-size: 12px; color: var(--text-muted); margin-bottom: 15px;">
<i class="fa-solid fa-circle-info"></i><span> Send instant free transfers to our official Instapay Egypt address or linked mobile phone.</span>
</p>
<div style="display: grid; grid-template-columns: 1fr; gap: 12px; background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 18px;">
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #e2e8f0; padding-bottom: 8px;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-bolt"></i><span>Integration Service:</span></span>
<strong style="font-size: 13px; color: #4f46e5;">Instapay</strong>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #e2e8f0; padding-bottom: 8px;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-user"></i><span>Account Holder Name:</span></span>
<strong style="font-size: 13px; color: #1e293b;">Mohamed Ahmed Mohamed Farouk</strong>
</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-phone"></i><span>Phone Number / Payment ID:</span></span>
<div style="display: flex; gap: 8px; align-items: center;">
<input type="text" id="pm-instapay-num" readonly style="padding: 6px 12px; font-family: monospace; font-size: 13px; font-weight: bold; background: white; border: 1px solid #cbd5e1; border-radius: 6px; color: #1e293b; width: 170px; text-align: center;" value="01096896689">
<button id="btn-copy-pm-instapay" class="btn-secondary" style="padding: 6px 12px; height: auto; border: 1px solid #cbd5e1;" title="Copy Phone Number"><i class="fa-solid fa-copy"></i></button>
</div>
</div>
</div>
</div>
<!-- Tab Pane 3: Electronic Mobile Wallets -->
<div id="pm-content-wallets" class="pm-sub-pane" style="display: none;">
<p style="font-size: 12px; color: var(--text-muted); margin-bottom: 15px;">
<i class="fa-solid fa-circle-info"></i><span> Send cash transfers directly from any Egyptian mobile wallet (Vodafone Cash, Etisalat Cash, Orange Cash, etc.) to our verified receiver address.</span>
</p>
<div style="display: grid; grid-template-columns: 1fr; gap: 12px; background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 18px;">
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #e2e8f0; padding-bottom: 8px;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-mobile"></i><span>Wallet Operator:</span></span>
<strong style="font-size: 13px; color: #dc2626;">Vodafone Cash</strong>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #e2e8f0; padding-bottom: 8px;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-user"></i><span>Wallet Holder Name:</span></span>
<strong style="font-size: 13px; color: #1e293b;">Mohamed Ahmed Mohamed Farouk</strong>
</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span style="font-size: 11px; font-weight: bold; color: #64748b;"><i class="fa-solid fa-phone"></i><span>Wallet Phone Number:</span></span>
<div style="display: flex; gap: 8px; align-items: center;">
<input type="text" id="pm-wallet-num" readonly style="padding: 6px 12px; font-family: monospace; font-size: 13px; font-weight: bold; background: white; border: 1px solid #cbd5e1; border-radius: 6px; color: #1e293b; width: 170px; text-align: center;" value="01096896689">
<button id="btn-copy-pm-wallet" class="btn-secondary" style="padding: 6px 12px; height: auto; border: 1px solid #cbd5e1;" title="Copy Phone Number"><i class="fa-solid fa-copy"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Simulated Execution Dispatch Monitor -->
<div class="card" id="process-panel">
<div class="card-title"><i class="fa-solid fa-desktop"></i><span>Real-Time Simulated Campaign Dispatch Monitor</span></div>
<!-- Live Statistics Counter -->
<div class="stats-row" style="grid-template-columns: repeat(6, 1fr); gap: 10px;">
<!-- Facebook stats -->
<div class="stat-box"><div class="num" id="stat-total">0</div><div class="lbl"><i class="fa-solid fa-list"></i><span>Total FB</span></div></div>
<div class="stat-box"><div class="num" id="stat-success" style="color: var(--success);">0</div><div class="lbl"><i class="fa-solid fa-thumbs-up"></i><span>Success FB</span></div></div>
<div class="stat-box"><div class="num" id="stat-pending" style="color: var(--warning);">0</div><div class="lbl"><i class="fa-solid fa-hourglass-half"></i><span>Pending FB</span></div></div>
<div class="stat-box"><div class="num" id="stat-failed" style="color: var(--danger);">0</div><div class="lbl"><i class="fa-solid fa-triangle-exclamation"></i><span>Restricted FB</span></div></div>
<!-- WhatsApp stats -->
<div class="stat-box"><div class="num" id="stat-wa-total-clients">0</div><div class="lbl"><i class="fa-solid fa-users"></i><span>Total WA</span></div></div>
<div class="stat-box"><div class="num" id="stat-wa-success-clients" style="color: var(--success);">0</div><div class="lbl"><i class="fa-solid fa-paper-plane"></i><span>Success WA</span></div></div>
</div>
<div class="stats-row analytics" style="grid-template-columns: repeat(3, 1fr);">
<div class="stat-box"><div class="num" id="stat-time-elapsed">00:00:00</div><div class="lbl"><i class="fa-solid fa-stopwatch"></i><span>Simulated Execution Time</span></div></div>
<div class="stat-box"><div class="num" id="stat-wait-total">00:00:00</div><div class="lbl"><i class="fa-solid fa-hourglass-start"></i><span>Total Cooldown Wait-Time</span></div></div>
<div class="stat-box" id="btn-view-intervals-analytic" style="cursor: pointer;" title="Click to adjust cooldowns">
<div class="num" id="stat-wait-avg" style="color: #8b5cf6;">0 seconds</div>
<div class="lbl"><i class="fa-solid fa-gauge"></i><span>Average Step Interval</span></div>
</div>
</div>
<!-- Facebook active progress -->
<div style="margin-bottom: 12px; border-bottom: 1px dashed #e2e8f0; padding-bottom: 10px;">
<div style="display: flex; justify-content: space-between; font-size: 12px; font-weight: bold; color: var(--text-muted);">
<span id="progress-lbl"><i class="fa-brands fa-facebook"></i><span>Active Facebook Campaign Dispatch Progress:</span></span>
<span id="progress-pct">0%</span>
</div>
<div class="progress-bar-bg" style="height:10px;"><div class="progress-bar-fill" id="progress-fill"></div></div>
</div>
<!-- WhatsApp active progress -->
<div>
<div style="display: flex; justify-content: space-between; font-size: 12px; font-weight: bold; color: var(--text-muted);">
<span id="progress-lbl-wa"><i class="fa-brands fa-whatsapp"></i><span>Active WhatsApp Broadcast Dispatch Progress:</span></span>
<span id="progress-pct-wa">0%</span>
</div>
<div class="progress-bar-bg" style="height:10px;"><div class="progress-bar-fill" id="progress-fill-wa" style="background: linear-gradient(90deg, #10b981, #059669);"></div></div>
</div>
</div>
<!-- Real-Time Console Logging Terminal & Live Dispatch Log -->
<div class="main-grid" style="grid-template-columns: 1fr 1fr;">
<!-- Live Terminal logs -->
<div class="terminal-card">
<div class="terminal-header">
<span class="terminal-title"><i class="fa-solid fa-terminal"></i><span>Real-Time Console Terminal (System kernel)</span></span>
<div style="display:flex; gap: 5px;">
<button id="term-btn-clear" class="btn-icon" title="Clear console logs" style="background:#334155; color:white; border:none; padding:4px 8px; border-radius:4px; cursor:pointer;"><i class="fa-solid fa-broom"></i></button>
<button id="term-btn-pause" class="btn-icon" title="Pause console logs" style="background:#334155; color:white; border:none; padding:4px 8px; border-radius:4px; cursor:pointer;"><i class="fa-solid fa-pause"></i></button>
</div>
</div>
<div class="terminal-body" id="terminal-log">
<div class="log-line"><span class="log-time">[00:00:00]</span><span class="log-info"><i class="fa-solid fa-shield-halved"></i><span> Secure execution sandbox initialized. Double-Anchor Signature Guard (SIS) active.</span></span></div>
</div>
</div>
<!-- Live Dispatch proof links -->
<div class="card" style="max-height: 350px; overflow-y: auto;">
<div class="card-title" style="margin:0;"><i class="fa-solid fa-link"></i><span>Active Dispatch Log &amp; Live Proof Links</span></div>
<table id="results-table">
<thead>
<tr>
<th><i class="fa-solid fa-bullseye"></i><span>Destination Target</span></th>
<th><i class="fa-solid fa-circle-info"></i><span>Dispatch State</span></th>
<th><i class="fa-solid fa-check"></i><span>Verification Proof Link</span></th>
</tr>
</thead>
<tbody>
<tr id="no-results-row"><td colspan="3" style="text-align: center; color: var(--text-muted);"><i class="fa-solid fa-circle-exclamation"></i><span>Links to successful posts and messages will populate here in real-time once dispatch simulation begins.</span></td></tr>
</tbody>
</table>
</div>
</div>
</main>
</div>
</div>
<!-- ========================================================
Workspace Modal Overlays
======================================================== -->
<!-- Modal 1: Licensing USD & Secure Wallet Ledger -->
<div class="modal-overlay" id="points-modal">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title"><i class="fa-solid fa-vault"></i><span>Secure Asset &amp; Licensing Vault</span></div>
<button class="modal-close" id="points-modal-close-btn">&times;</button>
</div>
<div class="modal-body">
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; background: var(--bg-main); padding: 15px; border-radius: 12px; border: 1px solid var(--border);">
<div style="background: white; padding: 12px; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 4px; text-align: left;">
<span style="font-size: 11px; font-weight: bold; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;"><i class="fa-solid fa-dollar-sign"></i><span>USD Balance:</span></span>
<strong style="font-size: 16px; color: #1e293b;"><span id="modal-points-balance">0.00</span></strong>
</div>
<div style="background: white; padding: 12px; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 4px; text-align: left;">
<span style="font-size: 11px; font-weight: bold; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;"><i class="fa-brands fa-facebook"></i><span>Facebook Cards:</span></span>
<strong style="font-size: 16px; color: #1d4ed8;"><span id="modal-fb-shares-balance">0</span></strong>
</div>
<div style="background: white; padding: 12px; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 4px; text-align: left;">
<span style="font-size: 11px; font-weight: bold; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;"><i class="fa-brands fa-whatsapp"></i><span>WhatsApp Cards:</span></span>
<strong style="font-size: 16px; color: #15803d;"><span id="modal-wa-shares-balance">0</span></strong>
</div>
</div>
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); border: 1px solid #cbd5e1; border-radius: 8px; padding: 12px; margin-bottom: 15px; font-size: 11px; color: #475569; line-height: 1.5;">
<strong><i class="fa-solid fa-shield-halved"></i><span>Secure Asset Transfers:</span></strong><span> Licensing currency and campaigns cards are managed entirely via high-strength AES-256-GCM encrypted tokens (.txt) in the </span><strong><i class="fa-solid fa-wallet"></i><span>Secure Wallet</span></strong><span> pane. This system prevents standard browser tampering and external balance spoofing.</span>
</div>
<div style="margin-top: 20px;">
<h4 style="font-size: 12px; font-weight: bold; color: #475569; border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; margin-bottom: 10px;">
<i class="fa-solid fa-receipt"></i><span>Transaction Ledger</span>
</h4>
<div id="points-history-list" style="max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;"></div>
</div>
</div>
</div>
</div>
<!-- Modal 2: Cooldown & Cooldown Schedules configuration -->
<div class="modal-overlay" id="intervals-modal">
<div class="modal-content" style="max-width: 750px; width: 95%;">
<div class="modal-header">
<div class="modal-title"><i class="fa-solid fa-clock"></i><span>Configure Dispatch Cooldown &amp; Sleep Schedules</span></div>
<button class="modal-close" id="intervals-modal-close-btn">&times;</button>
</div>
<div class="modal-body">
<div style="background: #eff6ff; border: 1px solid #bfdbfe; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 12px; color: #1e40af; line-height: 1.5;">
<strong><i class="fa-solid fa-circle-info"></i><span>Safe Dispatch Best Practice:</span></strong><span> To avoid detection thresholds and preserve account safety, we highly recommend utilizing the Continuous Thermal Pacing mode (which applies smooth decay-based intervals) or standard random delays.</span>
</div>
<div class="intervals-panel" style="margin: 0; padding: 15px; border: 1px solid #cbd5e1; box-shadow: none; background: #fff;">
<div class="delay-settings">
<div>
<label for="delay-mode"><i class="fa-solid fa-sliders"></i><span>Delay Algorithm Selection</span></label>
<select id="delay-mode">
<option value="continuous" selected>Continuous Thermal Pacing (Optimal Protection)</option>
<option value="random">Random Cooldown Mode (Highly Recommended)</option>
<option value="fixed">Fixed Interval Delay Mode ⏱</option>
<option value="burst">Burst Dispatch Mode (Rapid dispatches followed by sleep phase)</option>
<option value="fibonacci">Fibonacci Progression Cooldown Sequence</option>
<option value="adaptive">Adaptive Cooldown Engine (Calculated based on group metrics)</option>
</select>
</div>
</div>
<!-- Random/Continuous cooldown fields -->
<div id="delay-random-container" class="interval-row">
<div>
<label><i class="fa-solid fa-hourglass-start"></i><span>Minimum Delay (Seconds):</span></label>
<input type="number" id="delay-min" value="45" min="5" placeholder="Seconds">
</div>
<div>
<label><i class="fa-solid fa-hourglass-end"></i><span>Maximum Delay (Seconds):</span></label>
<input type="number" id="delay-max" value="120" min="10" placeholder="Seconds">
</div>
</div>
<!-- Fixed cooldown fields -->
<div id="delay-fixed-container" class="interval-row" style="display: none;">
<div>
<label><i class="fa-solid fa-clock"></i><span>Fixed Delay Interval (Seconds):</span></label>
<input type="number" id="delay-fixed" value="60" min="5" placeholder="Seconds">
</div>
</div>
<!-- Burst cooldown fields -->
<div id="delay-burst-container" class="interval-row" style="display: none;">
<div>
<label><i class="fa-solid fa-bolt"></i><span>Dispatch Burst Threshold (Operations):</span></label>
<input type="number" id="burst-count" value="5" min="2" placeholder="Operations">
</div>
<div>
<label><i class="fa-solid fa-moon"></i><span>Long Sleep Period (Seconds):</span></label>
<input type="number" id="burst-pause" value="300" min="10" placeholder="Seconds">
</div>
</div>
<!-- Mandatory breaks fields -->
<div class="interval-row" style="margin-top: 15px; border-top: 1px solid #e4e6eb; padding-top: 15px;">
<div>
<label><i class="fa-solid fa-circle-pause"></i><span>Trigger Long Break After (Operations):</span></label>
<input type="number" id="long-break-count" value="15" min="0" placeholder="0 to disable breaks">
</div>
<div>
<label><i class="fa-solid fa-hourglass"></i><span>Break Duration (Seconds):</span></label>
<input type="number" id="long-break-pause" value="900" min="30" placeholder="e.g. 900 seconds is 15 minutes">
</div>
</div>
</div>
<!-- Strategy Timeline Simulator -->
<div style="margin-top: 15px; padding: 15px; background: linear-gradient(180deg, #ffffff, #f7fbfe); border: 1px solid #e2e8f0; border-radius: 12px;">
<h4 style="font-size: 13px; font-weight: bold; color: #1e293b; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between;">
<span><i class="fa-solid fa-microchip"></i><span>Strategy Timeline Simulator</span></span>
<span id="simulator-summary" style="font-size: 12px; color: #1e3a8a; font-weight: 800;"><i class="fa-solid fa-stopwatch"></i><span>Estimated Time: 0 minutes</span></span>
</h4>
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; background: #fff; padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1;">
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px;"><i class="fa-solid fa-play"></i><span>Dispatch Operations Count:</span></label>
<input type="number" id="sim-post-count" value="20" min="1" style="padding: 4px 8px; font-size: 11px; font-weight: bold; color: #334155; border: 1px solid #cbd5e1; border-radius: 4px;">
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px;"><i class="fa-solid fa-signal"></i><span>Network Speed State:</span></label>
<select id="sim-network-speed" style="padding: 5px; font-size: 9px;">
<option value="3">Excellent Broadband (3s upload)</option>
<option value="5" selected>Average Network Speed (5s upload)</option>
<option value="10">Slow / Poor Network Connection (10s upload)</option>
</select>
</div>
<div class="form-group" style="margin: 0;">
<label style="font-size: 10px;"><i class="fa-solid fa-triangle-exclamation"></i><span>Target Restrictions:</span></label>
<select id="sim-failure-rate" style="padding: 5px 10px; font-size: 10px; height: auto;">
<option value="0" selected>0% (All public open destinations)</option>
<option value="10">10% (Moderated communities require approval)</option>
<option value="30">30% (Highly restricted target groups)</option>
</select>
</div>
</div>
<div style="display: flex; gap: 8px; align-items: center; margin-bottom: 10px;">
<button id="btn-run-simulation" class="btn-secondary" style="padding: 6px 14px; font-size: 12px;"><i class="fa-solid fa-play"></i><span>Run Timeline Audit</span></button>
<div id="sim-health-indicator" style="font-size: 11px; font-weight: bold; margin-right: auto; display: flex; align-items: center; gap: 5px;">
<span><i class="fa-solid fa-shield-halved"></i><span>Estimated Safety Index:</span></span>
<span id="sim-health-badge" class="badge green" style="padding: 4px 10px; font-size: 10px;"><i class="fa-solid fa-circle-check"></i><span>High Account Protection Index</span></span>
</div>
</div>
<p id="simulator-output-text" style="font-size: 11px; color: #64748b; margin: 0; line-height: 1.4;"><i class="fa-solid fa-file-invoice"></i><span>Click the Run Timeline Audit button above to generate the dispatch simulation timeline and audit your active configuration.</span></p>
</div>
<button id="btn-save-intervals-modal-close" class="btn-primary" style="width: 100%; margin-top: 15px; padding: 12px; background: #8b5cf6; border: none; box-shadow: 0 4px 6px rgba(139, 92, 246, 0.2);"><i class="fa-solid fa-circle-check"></i><span>Apply &amp; Commit Cooldowns</span></button>
</div>
</div>
</div>
<!-- Modal 3: Stealth Matrix Layout & Protections Guard -->
<div class="modal-overlay" id="protection-modal">
<div class="modal-content" style="max-width: 1100px; width: 95%;">
<div class="modal-header">
<div class="modal-title"><i class="fa-solid fa-shield-halved"></i><span>Stealth Protective Guard &amp; Antiban Matrix</span></div>
<button class="modal-close" id="protection-modal-close-btn">&times;</button>
</div>
<div class="modal-body" style="padding: 20px 30px;">
<!-- Antiban Dynamic Safety Rating Bar -->
<div style="background: linear-gradient(180deg, #ffffff, #f7fbfe); border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; margin-bottom: 20px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
<span style="font-size: 12px; font-weight: bold; color: #475569;"><i class="fa-solid fa-gauge-high"></i><span>Symmetric Security Risk Assessment:</span></span>
<span id="risk-score-badge" class="badge green"><i class="fa-solid fa-circle-check"></i><span>Shield Active</span></span>
</div>
<div class="progress-bar-bg" style="height: 10px; background: #e2e8f0; margin-top: 0;">
<div class="progress-bar-fill" id="risk-progress-bar" style="background: linear-gradient(90deg, #10b981, #34d399); width: 100%;"></div>
</div>
<p style="font-size: 10px; color: #64748b; margin-top: 6px;"><i class="fa-solid fa-info"></i><span>Risk score is dynamically calculated based on active human-emulation parameters and security filters.</span></p>
</div>
<!-- Navigation Tabs inside the Protection modal -->
<div class="rot-nav-tabs" style="border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; display: flex; gap: 5px;">
<div class="rot-tab-btn active" id="tab-modal-fb-rules" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;"><i class="fa-brands fa-facebook"></i><span>Facebook Stealth Safeguards</span></div>
<div class="rot-tab-btn" id="tab-modal-fb-mouse" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;"><i class="fa-solid fa-bezier-curve"></i><span>Facebook Motion Profiles</span></div>
<div class="rot-tab-btn" id="tab-modal-wa-rules" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;"><i class="fa-brands fa-whatsapp"></i><span>WhatsApp Stealth Safeguards</span></div>
<div class="rot-tab-btn" id="tab-modal-wa-mouse" style="flex: 1; text-align: center; justify-content: center; font-size: 12px; padding: 12px 10px; cursor: pointer;"><i class="fa-solid fa-bezier-curve"></i><span>WhatsApp Motion Profiles</span></div>
</div>
<!-- Section A: Facebook Stealth Safeguards tab content -->
<div id="modal-fb-stealth-behavior-section" class="stealth-section-grid" style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;">
<!-- Category 1: Cognitive Mimicry -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #1e3a8a; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-brain"></i> Cognitive Mimicry (Typing &amp; Interacting)</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-keyboard" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-human-typing" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Organic Keystroke Delays</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Injects micro-variations and keyboard typing jitter between character keystrokes.</span>
</div>
<input type="checkbox" id="chk-human-typing" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-hourglass-half" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-random-micro" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Random Micro-Pauses</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Simulates cognitive pauses and human hesitation intervals during active navigation.</span>
</div>
<input type="checkbox" id="chk-random-micro" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-eye-slash" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-anti-honeypot" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Honeypot Decoy Bypass</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Bypasses invisible or deceptive page elements designed to trigger automated bot traps.</span>
</div>
<input type="checkbox" id="chk-anti-honeypot" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
</div>
</div>
<!-- Category 2: Identity Obfuscation -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #0d9488; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-mask"></i> Identity Obfuscation (Device Fingerprinting)</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-image" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-canvas-noise" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Canvas Anti-Profiling</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Injects randomized microscopic pixel distortions into canvas operations to prevent device tracking.</span>
</div>
<input type="checkbox" id="chk-canvas-noise" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-music" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-fb-audio-noise" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Audio Fingerprint Noise</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Adds sub-frequency noise to generated sound waves to disrupt unique acoustic fingerprints.</span>
</div>
<input type="checkbox" id="chk-fb-audio-noise" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-network-wired" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-post-layout-scramble" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">WebRTC Private IP Protection</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Conceals local and private network IP leakages by enforcing strict WebRTC relay policies.</span>
</div>
<input type="checkbox" id="chk-post-layout-scramble" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
</div>
</div>
<!-- Category 3: Navigation Mimicry -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #854d0e; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-compass"></i> Navigation Mimicry &amp; Viewports</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-arrows-up-down" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-human-scroll" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Organic Scroll Simulation</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Performs page scrolls to simulate human reading patterns on target group views.</span>
</div>
<input type="checkbox" id="chk-human-scroll" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-expand" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-fb-viewport-jitter" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Dynamic Viewport Jitter</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Creates periodic, imperceptible window width offsets to throw off resolution tracking.</span>
</div>
<input type="checkbox" id="chk-fb-viewport-jitter" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-window-restore" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-random-tab-switch" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Idle Tab Swapping</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Rotates attention and focuses on random idle browser tabs to mock actual multi-tasking patterns.</span>
</div>
<input type="checkbox" id="chk-random-tab-switch" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
</div>
</div>
<!-- Category 4: Dispatch Limits & Bounds -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #991b1b; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-ban"></i> Dispatch Safety Boundaries</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-circle-pause" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-auto-pause-fail" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Auto-Pause on Failure</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Pauses campaigns automatically if pages fail to load or connectivity drops.</span>
</div>
<input type="checkbox" id="chk-auto-pause-fail" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-cloud-sun" style="color: var(--primary); font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-safe-hours-scheduler" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Daylight Hours Lock</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Restricts automatic dispatches to natural daytime hours based on local timezone configurations.</span>
</div>
<input type="checkbox" id="chk-safe-hours-scheduler" style="width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);">
</div>
<div class="form-group" style="margin: 0; padding: 5px 10px;">
<label for="num-max-daily-posts" style="font-weight: bold; font-size: 12px; color: #1e293b; margin-bottom: 5px;"><i class="fa-solid fa-calculator"></i> Daily Action Limit Cap</label>
<input type="number" id="num-max-daily-posts" value="100" min="1" max="5000" class="search-box" style="padding: 8px;">
</div>
</div>
</div>
</div>
<!-- Section B: Facebook Motion Profiles tab content -->
<div id="modal-fb-stealth-mouse-scroll-section" class="stealth-section-grid" style="display: none; flex-direction: column; gap: 15px;">
<div style="background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 15px;">
<div class="checkbox-group" style="display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;">
<input type="checkbox" id="chk-fb-show-virtual-cursor" checked style="width: 18px; height: 18px; cursor: pointer;">
<label for="chk-fb-show-virtual-cursor" style="font-weight: bold; font-size: 13px; color: #1e293b; margin: 0; cursor: pointer;"><i class="fa-solid fa-arrow-pointer"></i> Render Visible Red Virtual Cursor on Target Tabs</label>
</div>
<div class="checkbox-group" style="display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;">
<input type="checkbox" id="chk-fb-cursor-drift" checked style="width: 18px; height: 18px; cursor: pointer;">
<label for="chk-fb-cursor-drift" style="font-weight: bold; font-size: 13px; color: #1e293b; margin: 0; cursor: pointer;"><i class="fa-solid fa-arrow-pointer"></i> Passive Cursor Drift Emulation (Resting Cursor)</label>
</div>
<div class="checkbox-group" style="display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;">
<input type="checkbox" id="chk-simulate-mouse" checked style="width: 18px; height: 18px; cursor: pointer;">
<label for="chk-simulate-mouse" style="font-weight: bold; font-size: 13px; color: #1e293b; margin: 0; cursor: pointer;"><i class="fa-solid fa-bezier-curve"></i> Bezier Mouse Emulation (Curves and Movements)</label>
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
<!-- Left side: Scroll configs -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #334155; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-arrows-up-down"></i> Scroll Configs</h4>
<div style="display: flex; flex-direction: column; gap: 15px;">
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Scroll Step Distance (Pixels)</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-scroll-step" min="100" max="10000" step="50" value="250" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-scroll-step" min="100" max="10000" step="50" value="250" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-scroll-pixels-val" style="color: var(--primary); font-weight: bold;">250 px</span></span>
</div>
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Scroll Cycles Count (Cycles)</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-scroll-cycles" min="1" max="20" step="1" value="4" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-scroll-cycles" min="1" max="20" step="1" value="4" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-scroll-cycles-val" style="color: var(--primary); font-weight: bold;">4 Cycles</span></span>
</div>
</div>
</div>
<!-- Right side: Mouse path configs -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #334155; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-arrow-pointer"></i> Path Configs</h4>
<div style="display: flex; flex-direction: column; gap: 15px;">
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Bezier Mouse Movement Paths</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-mouse-cycles" min="1" max="25" step="1" value="5" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-mouse-cycles" min="1" max="25" step="1" value="5" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-mouse-cycles-val" style="color: var(--primary); font-weight: bold;">5 Path(s)</span></span>
</div>
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Path Movement Delay Jitter (ms)</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-mouse-speed" min="3" max="50" step="1" value="8" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-mouse-speed" min="3" max="50" step="1" value="8" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-mouse-speed-val" style="color: var(--primary); font-weight: bold;">8 ms</span></span>
</div>
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Interactive Click Coordinate Jitter</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-click-jitter" min="1" max="30" step="1" value="8" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-click-jitter" min="1" max="30" step="1" value="8" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-click-jitter-val" style="color: var(--primary); font-weight: bold;">8 px</span></span>
</div>
</div>
</div>
</div>
<button type="button" id="btn-workspace-trigger-mouse-scroll-test" class="btn-primary" style="width: 100%; margin-top: 10px; padding: 12px; background: #10b981; border: none; box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);">
<i class="fa-solid fa-vial"></i><span>Trigger Live Simulation Test on Active Facebook Tab</span>
</button>
</div>
<!-- Section C: WhatsApp Stealth Safeguards tab content -->
<div id="modal-wa-stealth-behavior-section" class="stealth-section-grid" style="display: none; grid-template-columns: repeat(2, 1fr); gap: 15px;">
<!-- Category 1: Cognitive Mimicry (WhatsApp) -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #1e3a8a; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-brain"></i> Cognitive Mimicry (Typing &amp; Interacting)</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-keyboard" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-human-typing" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Organic Keystroke Delays</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Randomizes keystroke delay intervals to mimic human typing rhythm.</span>
</div>
<input type="checkbox" id="chk-wa-human-typing" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-quote-left" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-typing-simulation" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Active "Typing..." Mimicry</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Simulates draft creation and backspacing cycles natively inside WhatsApp.</span>
</div>
<input type="checkbox" id="chk-wa-typing-simulation" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-eye-slash" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-anti-honeypot" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Honeypot Decoy Bypass</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Prevents clicking or typing into elements flagged as automation traps.</span>
</div>
<input type="checkbox" id="chk-wa-anti-honeypot" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
</div>
</div>
<!-- Category 2: Identity Obfuscation (WhatsApp) -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #0d9488; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-mask"></i> Identity Obfuscation</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-image" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-canvas" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Canvas Anti-Fingerprinting</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Applies micro-noise modifications to canvas render requests inside WhatsApp Web.</span>
</div>
<input type="checkbox" id="chk-wa-canvas" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
</div>
</div>
<!-- Category 3: Navigation Mimicry (WhatsApp) -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #854d0e; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-compass"></i> Navigation Mimicry &amp; Viewports</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-arrows-up-down" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-scroll" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">WhatsApp Feed Scrolling</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Performs feed scrolling sweeps before sending broadcasts to replicate real reading patterns.</span>
</div>
<input type="checkbox" id="chk-wa-scroll" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-expand" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-viewport-jitter" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Viewport Size Jitter</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Modifies visible window dimensions slightly to prevent static screen profiling indicators.</span>
</div>
<input type="checkbox" id="chk-wa-viewport-jitter" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
<div class="checkbox-group" style="display: flex; align-items: flex-start; gap: 12px; padding: 10px;">
<i class="fa-solid fa-window-restore" style="color: #00a884; font-size: 16px; margin-top: 2px;"></i>
<div style="flex: 1; display: flex; flex-direction: column; text-align: left;">
<label for="chk-wa-random-tab" style="font-weight: bold; font-size: 12px; color: #1e293b; margin: 0; cursor: pointer;">Random Page Focus Switches</label>
<span style="font-size: 10px; color: #64748b; margin-top: 2px;">Mock multi-tasking patterns by periodically switching page focus during delays.</span>
</div>
<input type="checkbox" id="chk-wa-random-tab" style="width: 16px; height: 16px; cursor: pointer; accent-color: #00a884;">
</div>
</div>
</div>
<!-- Category 4: Dispatch Limits & Bounds (WhatsApp) -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #991b1b; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-ban"></i> Dispatch Safety Boundaries</h4>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div class="form-group" style="margin: 0; padding: 5px 10px;">
<label for="num-wa-max-daily" style="font-weight: bold; font-size: 12px; color: #1e293b; margin-bottom: 5px;"><i class="fa-solid fa-calculator"></i> Daily Action Limit Cap</label>
<input type="number" id="num-wa-max-daily" value="150" min="1" max="5000" class="search-box" style="padding: 8px;">
</div>
</div>
</div>
</div>
<!-- Section D: WhatsApp Motion Profiles tab content -->
<div id="modal-wa-stealth-mouse-scroll-section" class="stealth-section-grid" style="display: none; flex-direction: column; gap: 15px;">
<div style="background: #fafbfc; border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 15px;">
<div class="checkbox-group" style="display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;">
<input type="checkbox" id="chk-wa-cursor-emulation" checked style="width: 18px; height: 18px; cursor: pointer;">
<label for="chk-wa-cursor-emulation" style="font-weight: bold; font-size: 13px; color: #1e293b; margin: 0; cursor: pointer;"><i class="fa-solid fa-arrow-pointer"></i> Render Visible Green Virtual Cursor on Target Tabs</label>
</div>
<div class="checkbox-group" style="display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;">
<input type="checkbox" id="chk-wa-mouse-emulation" checked style="width: 18px; height: 18px; cursor: pointer;">
<label for="chk-wa-mouse-emulation" style="font-weight: bold; font-size: 13px; color: #1e293b; margin: 0; cursor: pointer;"><i class="fa-solid fa-bezier-curve"></i> Bezier Mouse Emulation (Curves and Movements)</label>
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
<!-- Left side: Scroll configs -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #334155; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-arrows-up-down"></i> Scroll Configs</h4>
<div style="display: flex; flex-direction: column; gap: 15px;">
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Scroll Step Distance (Pixels)</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-wa-scroll-step" min="100" max="5000" step="50" value="200" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-wa-scroll-step" min="100" max="5000" step="50" value="200" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-wa-scroll-pixels" style="color: #008069; font-weight: bold;">200 px</span></span>
</div>
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Scroll Cycles Count (Cycles)</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-wa-scroll-cycles" min="1" max="20" step="1" value="3" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-wa-scroll-cycles" min="1" max="20" step="1" value="3" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-wa-scroll-cycles" style="color: #008069; font-weight: bold;">3 Cycles</span></span>
</div>
</div>
</div>
<!-- Right side: Mouse / Typing configs -->
<div class="stealth-group-card" style="border: 1px solid #cbd5e1; border-radius: 12px; padding: 15px; background: #fff;">
<h4 style="font-size: 12px; font-weight: bold; color: #334155; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 12px;"><i class="fa-solid fa-arrow-pointer"></i> Path / Typing Configs</h4>
<div style="display: flex; flex-direction: column; gap: 15px;">
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Click Target Coordinates Offset</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-wa-click-jitter" min="1" max="30" step="1" value="6" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-wa-click-jitter" min="1" max="30" step="1" value="6" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-wa-click-jitter" style="color: #008069; font-weight: bold;">6 px</span></span>
</div>
<div class="form-group" style="margin:0;">
<label style="font-weight: bold; margin-bottom: 5px;">Typing Emulation Repeat Cycles</label>
<div style="display: flex; gap: 10px; align-items: center;">
<input type="number" id="num-wa-typing-deletions" min="1" max="15" step="1" value="3" class="search-box" style="flex: 1; padding: 8px; font-weight: bold;">
<input type="range" id="range-wa-typing-deletions" min="1" max="15" step="1" value="3" style="flex: 2; margin: 0;">
</div>
<span style="font-size: 10px; color: #64748b; margin-top: 4px;">Current value: <span id="modal-lbl-wa-typing-deletions" style="color: #008069; font-weight: bold;">3 Cycles</span></span>
</div>
</div>
</div>
</div>
<button type="button" id="btn-wa-trigger-simulated-test" class="btn-primary" style="width: 100%; margin-top: 10px; padding: 12px; background: #00a884; box-shadow: 0 4px 6px rgba(0, 168, 132, 0.25);">
<i class="fa-solid fa-vial"></i><span>Trigger Live Pointer &amp; Scrolling Test on Active WhatsApp Tab</span>
</button>
</div>
</div>
<div style="margin-top: 15px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #cbd5e1; padding: 15px;">
<button id="btn-save-protection-settings" class="btn-primary" style="background: var(--primary);"><i class="fa-solid fa-floppy-disk"></i><span>Save Protection Parameters</span></button>
</div>
</div>
</div>
<!-- Modal 4: Campaign Trace Log Details -->
<div class="modal-overlay" id="history-modal">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title" id="modal-camp-title"><i class="fa-solid fa-receipt"></i><span>Complete Delivery Report Ledger</span></div>
<button class="modal-close" id="modal-close-btn">&times;</button>
</div>
<div class="modal-body">
<div class="card" style="box-shadow: none; border: 1px solid var(--border); margin-bottom: 15px; padding: 15px;">
<div id="modal-camp-text" style="font-size: 12px; color: #334155; white-space: pre-wrap; max-height: 120px; overflow-y: auto;"></div>
</div>
<div class="history-table-container" style="max-height: 350px;">
<table style="width: 100%;">
<thead>
<tr>
<th><i class="fa-solid fa-bullseye"></i><span>Target Destination (Group/Phone)</span></th>
<th><i class="fa-solid fa-circle-info"></i><span>Dispatch State</span></th>
<th><i class="fa-solid fa-file-invoice"></i><span>Template Assigned</span></th>
<th><i class="fa-solid fa-check"></i><span>Live Dispatch Proof</span></th>
</tr>
</thead>
<tbody id="modal-logs-tbody"></tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Modal 5: Edit existing Template Block parameters -->
<div class="modal-overlay" id="edit-prev-post-modal">
<div class="modal-content" style="max-width: 800px; width: 95%;">
<div class="modal-header">
<div class="modal-title"><i class="fa-solid fa-pen-to-square"></i><span>Modify Template Block parameters</span></div>
<button class="modal-close" id="edit-prev-post-close-btn">&times;</button>
</div>
<div class="modal-body">
<input type="hidden" id="edit-prev-post-id">
<div class="form-group">
<label><i class="fa-solid fa-heading"></i><span>Template Block Descriptive Title:</span></label>
<input type="text" id="edit-prev-post-title" class="search-box">
</div>
<div class="form-group">
<label><i class="fa-solid fa-circle-info"></i><span>Active State:</span></label>
<select id="edit-prev-post-status" class="cl-filter-select">
<option value="active">Active &amp; ready for rotation</option>
<option value="inactive">Temporarily deactivated</option>
<option value="frozen">Frozen / Expired</option>
<option value="draft">Draft Block</option>
</select>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: linear-gradient(180deg, #ffffff, #f7fbfe); padding: 10px; border-radius: 8px;">
<div class="form-group" style="margin: 0;">
<label><i class="fa-solid fa-hourglass-start"></i><span>Active Rotation Start Date/Time:</span></label>
<input type="datetime-local" id="edit-prev-post-entry-date" class="search-box">
</div>
<div class="form-group" style="margin: 0;">
<label><i class="fa-solid fa-hourglass-end"></i><span>Expiration Boundary Date/Time:</span></label>
<input type="datetime-local" id="edit-prev-post-expire-date" class="search-box">
</div>
</div>
<div class="form-group">
<label><i class="fa-solid fa-pen-fancy"></i><span>Primary Campaign Text Copy:</span></label>
<textarea id="edit-prev-post-text" class="main-composer" style="height: 100px;"></textarea>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px;">
<div class="form-group" style="margin: 0;">
<label><i class="fa-solid fa-life-ring"></i><span>Fallback Copy (Text is sent if Media Upload Fails):</span></label>
<input type="text" id="edit-prev-post-alt-text" class="search-box">
</div>
<div class="form-group" style="margin: 0;">
<label><i class="fa-solid fa-weight-hanging"></i><span>Selection Priority Weight (1-100):</span></label>
<input type="number" id="edit-prev-post-priority" class="search-box" min="1" max="100">
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px;">
<div class="form-group" style="margin: 0;">
<label><i class="fa-solid fa-key"></i><span>Registry Keywords (Comma-separated list):</span></label>
<input type="text" id="edit-prev-post-keywords" class="search-box">
</div>
<div class="form-group" style="margin: 0;">
<label><i class="fa-solid fa-tags"></i><span>Management Categories (Comma-separated list):</span></label>
<input type="text" id="edit-prev-post-categories" class="search-box">
</div>
</div>
<div class="form-group">
<label><i class="fa-solid fa-sticky-note"></i><span>Internal Team / Developer Notes:</span></label>
<input type="text" id="edit-prev-post-notes" class="search-box">
</div>
<div style="background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 10px; color: #15803d;">
<div class="checkbox-group" style="background: #ffffff; margin-bottom: 0; border-color: #bbf7d0; padding: 10px 15px;">
<input type="checkbox" id="edit-prev-post-wa-followup">
<label for="edit-prev-post-wa-followup" style="color: #166534; font-weight: bold;"><i class="fa-brands fa-whatsapp"></i><span>Enable Automated Follow-Up WhatsApp Broadcast for this template</span></label>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;">
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-user"></i><span>Recipient Name:</span></label>
<input type="text" id="edit-prev-post-client-name" class="search-box" style="border-color: #bbf7d0;">
</div>
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-phone"></i><span>Target Numbers (comma list):</span></label>
<input type="text" id="edit-prev-post-phones" class="search-box" style="border-color: #bbf7d0;">
</div>
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-clock"></i><span>Schedule Dispatch Time:</span></label>
<input type="datetime-local" id="edit-prev-post-followup-date" class="search-box" style="border-color: #bbf7d0;">
</div>
</div>
<div class="form-group" style="margin: 0;">
<label style="color: #166534;"><i class="fa-solid fa-comment-sms"></i><span>Follow-Up Broadcast Copy:</span></label>
<textarea id="edit-prev-post-followup-msg" class="search-box" style="height: 80px; resize: vertical; border-color: #bbf7d0;"></textarea>
</div>
</div>
<div class="form-group" style="margin-top: 15px;">
<label style="font-weight: bold; color: #334155;"><i class="fa-solid fa-images"></i><span>Attach Template specific Media Assets (Images/Videos):</span></label>
<div class="image-uploader-area" id="edit-prev-post-dropzone" style="background: white; padding: 15px;">
<span><i class="fa-solid fa-cloud-arrow-up"></i>Drag &amp; drop new media here or click to browse files...</span>
<input type="file" id="edit-prev-post-file-input" multiple accept="image/*" style="display: none;">
</div>
<div class="img-preview-container" id="edit-prev-post-previews"></div>
</div>
</div>
<div style="margin-top: 15px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #cbd5e1; padding: 15px;">
<button id="btn-save-edited-prev-post" class="btn-primary" style="background: #0284c7; border: none; padding: 10px 20px;"><i class="fa-solid fa-circle-check"></i><span>Apply &amp; Commit Parameters changes</span></button>
</div>
</div>
</div>
<!-- Modal 6: Delivery Trace and Verification links -->
<div class="modal-overlay" id="variant-trace-modal">
<div class="modal-content" style="max-width: 750px; width: 90%; max-height: 80vh;">
<div class="modal-header" style="background: linear-gradient(180deg, #ffffff, #f7fbfe); border-bottom: 1px solid #cbd5e1;">
<div class="modal-title"><i class="fa-solid fa-chart-line"></i><span>Active delivery trace &amp; verification ledger</span></div>
<button class="modal-close" id="variant-trace-modal-close-btn">&times;</button>
</div>
<div class="modal-body" style="overflow-y: auto; padding: 15px;">
<div id="variant-trace-meta-info" style="font-size: 12px; color: #475569; margin-bottom: 12px; font-weight: bold; background: #f1f5f9; padding: 10px; border-radius: 6px;"></div>
<div class="history-table-container">
<table style="width: 100%;">
<thead>
<tr>
<th><i class="fa-solid fa-heading"></i><span>Campaign Name</span></th>
<th><i class="fa-solid fa-bullseye"></i><span>Destination Target Identifier</span></th>
<th><i class="fa-solid fa-circle-info"></i><span>Final State</span></th>
<th><i class="fa-solid fa-check"></i><span>Live Dispatch Proof Link</span></th>
</tr>
</thead>
<tbody id="variant-trace-tbody"></tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Canvas Container for celebration animations -->
<div id="celebration-canvas-container" style="position: fixed; inset: 0; pointer-events: none; z-index: 99999; overflow: hidden; display: none;"></div>
<!-- Core JavaScript modules loading -->
<script src="modules/crypto.js"></script>
<script src="modules/storage.js"></script>
<script src="modules/dashboard.js"></script>
<script src="modules/facebook.js"></script>
<script src="modules/whatsapp.js"></script>
<script src="modules/rotation.js"></script>
<script src="modules/history.js"></script>
<script src="modules/migration.js"></script>
<script src="index.js"></script>
<script src="rules.js"></script>
</body>
</html>