/* ═══════════════════════════════════════════════════════════
   BulkyTools — Premium Design System
   ═══════════════════════════════════════════════════════════ */

/* ─── Google Fonts (loaded via HTML preconnect) ─────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── CSS Variables (Light Mode) ──────────────────────────── */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-glow: rgba(79, 70, 229, 0.15);

    --accent: #f59e0b;
    --accent-hover: #d97706;

    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;

    --error: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fecaca;

    --warning: #f59e0b;
    --warning-bg: #fffbeb;

    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-input: #f1f5f9;
    --bg-hover: #f8fafc;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: var(--primary);

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Dark Mode ───────────────────────────────────────────── */
body.dark {
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-light: rgba(129, 140, 248, 0.12);
    --primary-glow: rgba(129, 140, 248, 0.2);

    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.3);

    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: rgba(239, 68, 68, 0.3);

    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --border: #334155;
    --border-hover: #475569;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
}

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
.app-header {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
    transition: background var(--transition-base), border-color var(--transition-base);
}

body.dark .app-header {
    background: rgba(15,23,42,0.85);
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.3rem;
    transition: color var(--transition-fast);
}

.logo em {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: normal;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Dark Mode Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-left: 8px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }

body:not(.dark) .theme-toggle .icon-moon { display: block; }
body.dark .theme-toggle .icon-sun { display: block; }

/* Hamburger */
.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.hamburger:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.hamburger svg { pointer-events: none; }

/* ═══════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════ */
.hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--primary-light) 50%, var(--bg-body) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 36px auto;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 36px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.hero-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 1px 3px rgba(79,70,229,0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    font-size: 1.05rem;
    padding: 14px 36px;
    border-radius: var(--radius-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH & FILTER BAR
   ═══════════════════════════════════════════════════════════ */
.tools-section {
    padding: 60px 0 80px;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-tab.active {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   TOOLS GRID
   ═══════════════════════════════════════════════════════════ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--primary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card.hidden {
    display: none;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.tool-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
    line-height: 1.5;
}

/* Tool Card accent colors */
.bg-indigo   { background: #eef2ff; color: #4f46e5; }
.bg-amber    { background: #fffbeb; color: #d97706; }
.bg-emerald  { background: #ecfdf5; color: #059669; }
.bg-rose     { background: #fff1f2; color: #e11d48; }
.bg-sky      { background: #f0f9ff; color: #0284c7; }
.bg-violet   { background: #f5f3ff; color: #7c3aed; }
.bg-teal     { background: #f0fdfa; color: #0d9488; }
.bg-orange   { background: #fff7ed; color: #ea580c; }
.bg-cyan     { background: #ecfeff; color: #0891b2; }
.bg-fuchsia  { background: #fdf4ff; color: #c026d3; }
.bg-lime     { background: #f7fee7; color: #65a30d; }
.bg-pink     { background: #fdf2f8; color: #db2777; }
.bg-slate    { background: #f8fafc; color: #475569; }

body.dark .bg-indigo   { background: rgba(79,70,229,0.15); }
body.dark .bg-amber    { background: rgba(217,119,6,0.15); }
body.dark .bg-emerald  { background: rgba(5,150,105,0.15); }
body.dark .bg-rose     { background: rgba(225,29,72,0.15); }
body.dark .bg-sky      { background: rgba(2,132,199,0.15); }
body.dark .bg-violet   { background: rgba(124,58,237,0.15); }
body.dark .bg-teal     { background: rgba(13,148,136,0.15); }
body.dark .bg-orange   { background: rgba(234,88,12,0.15); }
body.dark .bg-cyan     { background: rgba(8,145,178,0.15); }
body.dark .bg-fuchsia  { background: rgba(192,38,211,0.15); }
body.dark .bg-lime     { background: rgba(101,163,13,0.15); }
body.dark .bg-pink     { background: rgba(219,39,119,0.15); }
body.dark .bg-slate    { background: rgba(71,85,105,0.15); }

/* No results message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.no-results h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   HOW IT WORKS & INFO SECTIONS
   ═══════════════════════════════════════════════════════════ */
.info-section {
    padding: 60px 0;
}

.bg-light {
    background-color: var(--bg-card);
}

.info-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 40px;
}

.step {
    padding: 24px;
    text-align: center;
}

.step-num {
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

.step h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Privacy section */
#privacy p {
    max-width: 700px;
    margin: 16px auto 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 40px;
    transition: background var(--transition-base);
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-footer strong {
    color: var(--text-primary);
}

.app-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.app-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 24px;
    transition: color var(--transition-fast);
}

.app-footer a:hover {
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    margin: 4% auto;
    padding: 32px;
    border: 1px solid var(--border);
    width: 92%;
    max-width: 640px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateY(-20px) scale(0.98);
    transition: transform var(--transition-base);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.close-btn {
    color: var(--text-muted);
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

input[type="file"],
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.drop-zone {
    border: 2px dashed var(--border);
    padding: 40px 20px;
    text-align: center;
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.drop-zone .drop-icon {
    color: var(--primary);
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */
.progress-wrap {
    display: none;
    margin-top: 16px;
}

.progress-wrap.active {
    display: block;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--transition-fast);
}

.progress-bar-fill.indeterminate {
    width: 30% !important;
    animation: indeterminate 1.5s infinite ease-in-out;
}

@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s ease forwards;
    pointer-events: auto;
    max-width: 400px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

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

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon   { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon    { color: var(--primary); }

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

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

/* ═══════════════════════════════════════════════════════════
   RESULT / ERROR AREAS (in modals)
   ═══════════════════════════════════════════════════════════ */
.result-area {
    display: none;
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
}

.result-area.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.result-area.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
}

.result-area h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.result-area.success h3 { color: var(--success); }
.result-area.error h3   { color: var(--error); }

.result-area p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Client-side tool specific styles */
.tool-output {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
}

.tool-textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
}

.tool-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Diff styles */
.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.diff-output {
    max-height: 350px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}

.diff-add { background: rgba(16,185,129,0.15); }
.diff-del { background: rgba(239,68,68,0.15); }
.diff-neutral { color: var(--text-muted); }

/* QR output grid */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.qr-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.qr-item canvas,
.qr-item img {
    max-width: 120px;
    margin-bottom: 8px;
}

.qr-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* Password output */
.password-list {
    list-style: none;
    padding: 0;
}

.password-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.password-list li button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.password-list li button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Word counter stats */
.counter-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.counter-stat {
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
}

.counter-stat .num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.counter-stat .lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Image compressor previews */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.image-preview-item {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    text-align: center;
}

.image-preview-item img {
    max-width: 100%;
    max-height: 100px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.image-preview-item .img-info {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.image-preview-item .img-saved {
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 600;
}

/* Range slider styling */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    outline: none;
    margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}

/* Hash output */
.hash-results {
    margin-top: 16px;
}

.hash-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.hash-row .hash-algo {
    font-weight: 600;
    color: var(--primary);
    min-width: 70px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.hash-row .hash-value {
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    flex: 1;
    color: var(--text-primary);
}

.hash-row button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.hash-row button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px 16px 16px;
        box-shadow: var(--shadow-md);
        z-index: 99;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 16px;
        width: 100%;
    }

    .hero {
        padding: 50px 0 40px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat .stat-num {
        font-size: 1.6rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .footer-flex {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .app-footer a {
        margin: 0 12px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .category-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 0;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
    }

    .diff-container {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .counter-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tool-card {
    animation: fadeIn 0.4s ease forwards;
}

.tools-grid .tool-card:nth-child(1)  { animation-delay: 0.02s; }
.tools-grid .tool-card:nth-child(2)  { animation-delay: 0.04s; }
.tools-grid .tool-card:nth-child(3)  { animation-delay: 0.06s; }
.tools-grid .tool-card:nth-child(4)  { animation-delay: 0.08s; }
.tools-grid .tool-card:nth-child(5)  { animation-delay: 0.10s; }
.tools-grid .tool-card:nth-child(6)  { animation-delay: 0.12s; }
.tools-grid .tool-card:nth-child(7)  { animation-delay: 0.14s; }
.tools-grid .tool-card:nth-child(8)  { animation-delay: 0.16s; }
.tools-grid .tool-card:nth-child(9)  { animation-delay: 0.18s; }
.tools-grid .tool-card:nth-child(10) { animation-delay: 0.20s; }
.tools-grid .tool-card:nth-child(11) { animation-delay: 0.22s; }
.tools-grid .tool-card:nth-child(12) { animation-delay: 0.24s; }
.tools-grid .tool-card:nth-child(13) { animation-delay: 0.26s; }

/* Scrollbar styling for dark mode */
body.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark ::-webkit-scrollbar-track {
    background: var(--bg-body);
}

body.dark ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

body.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   MAIL-MERGE VISUAL BUILDER
   ═══════════════════════════════════════════════════════════ */
.mm-container { padding: 4px 0; }

/* Step Wizard Bar */
.mm-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mm-step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.mm-step-indicator span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
}

.mm-step-indicator.active {
    background: var(--primary);
    color: var(--text-inverse);
}

.mm-step-indicator.active span {
    background: rgba(255,255,255,0.25);
    color: var(--text-inverse);
}

.mm-step-indicator.completed {
    color: var(--success);
    background: var(--success-bg);
}

.mm-step-indicator.completed span {
    background: var(--success);
    color: white;
}

.mm-step-divider {
    width: 20px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

/* Canvas Editor */
.mm-editor-wrap {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
}

.mm-canvas-container {
    position: relative;
    overflow: hidden;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fafafa 0% 50%) 50% / 20px 20px;
}

body.dark .mm-canvas-container {
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
}

.mm-canvas-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

.mm-field-overlays {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.mm-field-overlay {
    position: absolute;
    cursor: move;
    pointer-events: auto;
    padding: 2px 6px;
    border: 1.5px dashed var(--primary);
    border-radius: 3px;
    background: rgba(79, 70, 229, 0.08);
    white-space: nowrap;
    user-select: none;
    transition: border-color 0.15s;
    min-width: 40px;
    min-height: 20px;
}

.mm-field-overlay:hover {
    background: rgba(79, 70, 229, 0.15);
}

.mm-field-overlay.selected {
    border-color: var(--error);
    border-style: solid;
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Field Controls */
.mm-field-controls {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.mm-field-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.mm-field-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.85rem;
}

.mm-field-item:hover { border-color: var(--primary); }
.mm-field-item.active { border-color: var(--primary); background: var(--primary-light); }

.mm-field-chip {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: monospace;
}

.mm-field-props {
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.mm-prop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mm-prop-grid label {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mm-prop-grid input,
.mm-prop-grid select {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.mm-prop-grid input[type="color"] {
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

.mm-prop-grid input[type="checkbox"] {
    width: auto;
}

/* Data Preview Table */
.mm-data-preview {
    max-height: 200px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.mm-data-preview table {
    font-family: var(--font-sans);
}

/* Mapping */
.mm-mapping-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mm-mapping-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

/* Preview */
.mm-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mm-preview-main {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #fafafa 0% 50%) 50% / 20px 20px;
}

body.dark .mm-preview-main {
    background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
}

.mm-preview-main canvas {
    display: block;
    width: 100%;
    height: auto;
}

.mm-preview-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
}

.mm-thumb {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    color: var(--text-secondary);
}

.mm-thumb:hover { border-color: var(--primary); }
.mm-thumb.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Export Cards */
.mm-export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.mm-export-card {
    padding: 24px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-card);
}

.mm-export-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.mm-export-card svg {
    color: var(--primary);
    margin-bottom: 8px;
}

.mm-export-card h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.mm-export-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Nav Buttons Row */
.mm-nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .mm-prop-grid { grid-template-columns: 1fr; }
    .mm-export-options { grid-template-columns: 1fr; }
    .mm-steps-bar { gap: 2px; }
    .mm-step-divider { width: 10px; }
    .mm-step-indicator { padding: 5px 8px; font-size: 0.7rem; }
    .mm-step-indicator span { width: 18px; height: 18px; font-size: 0.6rem; }
}
