/* CoreBait - Dark Theme Dashboard */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2130;
    --bg-input: #252838;
    --bg-hover: #2a2d3e;
    --border: #2e3148;
    --text-primary: #e4e6f0;
    --text-secondary: #8b8fa3;
    --text-muted: #5c6078;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --orange: #f97316;
    --purple: #a855f7;
    --cyan: #06b6d4;
    --sidebar-width: 240px;
    --header-height: 56px;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --glow-accent: 0 0 20px rgba(99,102,241,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 400px;
    max-width: 90vw;
}

.login-box h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent);
}

.login-box .subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 13px;
}

/* App Layout */
.app-container {
    display: none;
    min-height: 100vh;
}

.app-container.active { display: flex; }
.login-container.hidden { display: none; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-height);
}

.sidebar-logo .version {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* Header */
.header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title { font-size: 16px; font-weight: 600; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.connection-dot.connected { background: var(--success); }

/* Page Content */
.page-content {
    padding: 24px;
}

.page { display: none; }
.page.active { display: block; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }
.stat-card.orange::before { background: var(--orange); }

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-weight: 600;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* Status badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-draft { background: #374151; color: #9ca3af; }
.badge-scheduled { background: #1e3a5f; color: #60a5fa; }
.badge-active { background: #14532d; color: #4ade80; }
.badge-launching { background: #422006; color: #fbbf24; }
.badge-paused { background: #431407; color: #fb923c; }
.badge-completed { background: #1e1b4b; color: #a78bfa; }
.badge-cancelled { background: #450a0a; color: #fca5a5; }
.badge-pending { background: #374151; color: #9ca3af; }
.badge-email_sent { background: #1e3a5f; color: #60a5fa; }
.badge-email_opened { background: #422006; color: #fbbf24; }
.badge-link_clicked { background: #431407; color: #fb923c; }
.badge-creds_submitted { background: #14532d; color: #4ade80; }
.badge-session_captured { background: #14532d; color: #4ade80; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
}

.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Activity Feed */
.activity-feed { max-height: 400px; overflow-y: auto; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* Funnel Chart */
.funnel-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
}

.funnel-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.funnel-label {
    width: 120px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.funnel-bar-bg {
    flex: 1;
    height: 28px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.funnel-bar {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    min-width: fit-content;
}

.funnel-value {
    width: 50px;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 20px;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    box-shadow: var(--shadow);
    animation: slideIn 0.2s ease;
    min-width: 300px;
    max-width: 450px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .nav-item span,
    .sidebar .nav-section-title,
    .sidebar-logo .version { display: none; }
    .main-content { margin-left: 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Code / Token display */
.token-display {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    width: 260px;
}

/* Tab navigation */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Loading */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Two-column layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* Phishlet cards */
.phishlet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.phishlet-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s;
}

.phishlet-card:hover { border-color: var(--accent); }

.phishlet-card .phishlet-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.phishlet-card .phishlet-host {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle input { display: none; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 11px;
    transition: 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.2s;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: white;
}

/* Copy button */
.copy-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
}

.copy-btn:hover { color: var(--text-primary); border-color: var(--accent); }

/* Worker cards */
.worker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Scenario cards */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.scenario-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    transition: all 0.15s ease;
}

.worker-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s;
}

.worker-card:hover { border-color: var(--accent); }

.worker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.worker-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.worker-host {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.worker-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.worker-status-dot.ready { background: var(--success); box-shadow: 0 0 6px var(--success); }
.worker-status-dot.busy { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.worker-status-dot.error { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

.worker-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.worker-stat-label {
    color: var(--text-muted);
    font-size: 12px;
}

.worker-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Additional stat card colors */
.stat-card.cyan::before { background: var(--cyan); }

/* 3 column grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* Copy button */
.copy-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 4px;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Wider modal for campaign detail */
.modal.wide {
    width: 800px;
}

/* ===========================
   Help & Documentation Page
   =========================== */

.help-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.help-lang-toggle {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.help-lang-btn {
    padding: 6px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.help-lang-btn.active {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
}

.help-lang-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.help-search-wrap {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.help-search {
    width: 100%;
    border-radius: 20px !important;
    padding-left: 16px !important;
}

/* Help Tabs */
.help-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    position: sticky;
    top: var(--header-height);
    z-index: 40;
}

.help-tab {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.help-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.help-tab.active {
    background: var(--accent);
    color: white;
}

/* Help Content Area */
.help-content {
    scroll-behavior: smooth;
}

/* Help Section Cards */
.help-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.help-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--cyan));
    border-radius: 3px 0 0 3px;
}

.help-section:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.help-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 12px;
    background: linear-gradient(90deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.help-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: var(--text-primary);
}

.help-section p, .help-section li {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 13px;
}

.help-section ul, .help-section ol {
    padding-left: 20px;
    margin: 8px 0;
}

.help-section li {
    margin-bottom: 4px;
}

.help-section code {
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
}

/* Feature Card Grid */
.help-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.help-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.help-feature-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--cyan));
}

.help-feature-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.help-feature-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-left: 10px;
    color: var(--text-primary);
}

.help-feature-card p, .help-feature-card li {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 12.5px;
}

.help-feature-card ul {
    padding-left: 20px;
    margin: 6px 0 0;
}

.help-feature-card li { margin-bottom: 3px; }

/* Concept Tables */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.help-table th {
    text-align: left;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(6,182,212,0.1));
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.help-table th:first-child { border-radius: 6px 0 0 0; }
.help-table th:last-child { border-radius: 0 6px 0 0; }

.help-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-table tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

.help-table tr:last-child td { border-bottom: none; }

/* Workflow Steps */
.help-workflow {
    position: relative;
    padding-left: 40px;
    margin: 16px 0;
}

.help-workflow::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--cyan), var(--accent));
    border-radius: 2px;
}

.workflow-step {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.workflow-step:hover {
    border-color: var(--accent);
}

.step-number {
    position: absolute;
    left: -40px;
    top: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.workflow-step h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.workflow-step p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
}

/* Callout Boxes */
.tip-box, .warning-box, .info-box {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.7;
    border-left: 4px solid;
}

.tip-box {
    background: rgba(99, 102, 241, 0.08);
    border-left-color: var(--accent);
    color: var(--text-secondary);
}

.warning-box {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--warning);
    color: var(--text-secondary);
}

.info-box {
    background: rgba(6, 182, 212, 0.08);
    border-left-color: var(--cyan);
    color: var(--text-secondary);
}

.tip-box strong, .warning-box strong, .info-box strong {
    color: var(--text-primary);
}

/* Workflow Section Header */
.help-workflow-title {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}

.help-workflow-title:first-child { margin-top: 0; }

/* Help section hidden by search */
.help-section.hidden,
.help-feature-card.hidden {
    display: none;
}

/* Tooltip icons */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
}
.tooltip-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.tooltip-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    width: 240px;
    z-index: 1000;
    box-shadow: var(--shadow);
    pointer-events: none;
}

/* Searchable select (integrated dropdown) */
.ss-wrapper {
    position: relative;
}
.ss-display {
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 28px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.ss-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    margin-top: 2px;
    overflow: hidden;
}
.ss-panel.ss-open {
    display: block;
}
.ss-search {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.ss-search::placeholder {
    color: var(--text-muted);
}
.ss-list {
    max-height: 200px;
    overflow-y: auto;
}
.ss-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ss-item:hover {
    background: var(--accent);
    color: #fff;
}
.ss-item.ss-active {
    background: rgba(99,102,241,.15);
    color: var(--accent);
}

/* Extra-wide modal for scenario detail */
.modal.extra-wide { width: 1100px; }

/* Responsive */
@media (max-width: 768px) {
    .help-feature-grid { grid-template-columns: 1fr; }
    .help-header { flex-direction: column; align-items: stretch; }
    .help-search-wrap { max-width: 100%; }
    .help-tabs { flex-wrap: wrap; }
}

/* ===========================
   UI/UX Polish v2.2
   =========================== */

/* Login branding */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo svg {
    filter: drop-shadow(0 0 12px rgba(99,102,241,0.4));
    animation: loginPulse 3s ease-in-out infinite;
}

@keyframes loginPulse {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(99,102,241,0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(99,102,241,0.6)); }
}

.login-box {
    animation: loginSlideUp 0.4s ease-out;
}

@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Version badge */
.version-badge {
    font-size: 11px;
    color: var(--cyan);
    background: rgba(6,182,212,0.1);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(6,182,212,0.2);
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-right: 12px;
}

/* Page transitions */
.page {
    animation: none;
}

.page.active {
    display: block;
    animation: pageIn 0.25s ease-out;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stat card animations */
.stat-card {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-accent);
}

.stat-value {
    transition: color var(--transition-fast);
}

/* Button loading state */
.btn.loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
}

/* Better focus rings for accessibility */
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Improved table row hover */
tr:hover td {
    background: rgba(99,102,241,0.04);
}

/* Card hover glow */
.card {
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    border-color: rgba(99,102,241,0.15);
}

/* Nav item transition improvements */
.nav-item {
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: white;
    border-radius: 0 2px 2px 0;
}

/* Toast exit animation */
.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

/* Sidebar logo gradient */
.sidebar-logo {
    background: linear-gradient(135deg, var(--bg-secondary), rgba(99,102,241,0.05));
}

/* Empty state improvements */
.empty-state svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

.empty-state p {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal entrance animation */
.modal-overlay.active {
    animation: overlayIn 0.2s ease;
}

.modal-overlay.active .modal {
    animation: modalIn 0.25s ease-out;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Badge pulse for notifications */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* Connection status animation */
.connection-dot.connected {
    animation: connPulse 2s ease-in-out infinite;
}

@keyframes connPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* Scenario card improvements */
.scenario-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
}

/* Better scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.4); }

/* Phishlet card status indicator */
.phishlet-card {
    position: relative;
    overflow: hidden;
}

/* Subtle gradient overlay on active elements */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #818cf8, var(--accent));
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* Toolbar title subtitle */
.toolbar-title .subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* Smooth sidebar section transitions */
.nav-section {
    transition: opacity var(--transition-fast);
}

/* Better select dropdown styling */
select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
