/* ==========================================================================
   EASY OFFICE TOOLS - PREMIUM CSS DESIGN SYSTEM
   ========================================================================== */

/* Google Font Import Configuration */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Color & Token Design Scheme (HSL System) */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-document: Aptos, 'Aptos Display', 'Inter', 'Segoe UI', Calibri, Arial, sans-serif;

    /* Transition Speeds */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Card Shadows & Glass Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    /* Rounded Borders */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* --- Dark Theme Variables (Default) --- */
[data-theme="dark"] {
    --bg-app: #090a0f;
    --bg-header: rgba(13, 15, 23, 0.7);
    --bg-card: rgba(20, 22, 37, 0.6);
    --bg-card-hover: rgba(26, 29, 49, 0.8);
    --bg-input: #121424;
    --bg-active: rgba(99, 102, 241, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #a855f7; /* Purple */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    
    /* PDF Accent (Red/Orange) */
    --pdf-base: #ef4444;
    --pdf-bg: rgba(239, 68, 68, 0.15);
    
    /* Image Accent (Emerald) */
    --image-base: #10b981;
    --image-bg: rgba(16, 185, 129, 0.15);
    
    /* Docs Accent (Sky Blue) */
    --doc-base: #0ea5e9;
    --doc-bg: rgba(14, 165, 233, 0.15);

    /* Converter Accent (Amber) */
    --convert-base: #f59e0b;
    --convert-bg: rgba(245, 158, 11, 0.15);

    /* Text Tools Accent (Violet) */
    --text-base: #8b5cf6;
    --text-bg: rgba(139, 92, 246, 0.15);

    /* Utility Accent (Cyan) */
    --util-base: #06b6d4;
    --util-bg: rgba(6, 182, 212, 0.15);
    
    --glass-blur: blur(16px);
    --nav-dropdown-bg: #141629;
    --nav-dropdown-border: rgba(255, 255, 255, 0.12);
    --nav-dropdown-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --nav-dropdown-item-hover: #1c2038;
}

/* --- Light Theme Variables --- */
[data-theme="light"] {
    --bg-app: #f8fafc;
    --bg-header: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: #f1f5f9;
    --bg-active: rgba(99, 102, 241, 0.08);
    
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(99, 102, 241, 0.2);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-primary: #4f46e5;
    --accent-secondary: #9333ea;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    
    --pdf-base: #dc2626;
    --pdf-bg: rgba(220, 38, 38, 0.08);
    
    --image-base: #059669;
    --image-bg: rgba(5, 150, 105, 0.08);
    
    --doc-base: #0284c7;
    --doc-bg: rgba(2, 132, 199, 0.08);

    --convert-base: #d97706;
    --convert-bg: rgba(217, 119, 6, 0.08);

    --text-base: #7c3aed;
    --text-bg: rgba(124, 58, 237, 0.08);

    --util-base: #0891b2;
    --util-bg: rgba(8, 145, 178, 0.08);
    
    --glass-blur: blur(12px);
    --nav-dropdown-bg: #ffffff;
    --nav-dropdown-border: rgba(15, 23, 42, 0.1);
    --nav-dropdown-shadow: 0 20px 48px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
    --nav-dropdown-item-hover: #f1f5f9;
}

/* ==========================================================================
   CORE RESET & LAYOUT SETUP
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

html.workspace-route-pending body {
    opacity: 0;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   BUTTONS & UI CONTROLS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--border-hover);
}

.btn-danger {
    background-color: var(--pdf-bg);
    color: var(--pdf-base);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--pdf-base);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform var(--transition-fast);
    padding: 0;
}

.btn-text:hover {
    transform: translateX(2px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    transform: scale(1.05);
}

.hidden-input {
    display: none;
}

/* ==========================================================================
   APP HEADER (GLASSMORPHIC)
   ========================================================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-normal);
    isolation: isolate;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon i {
    width: 20px;
    height: 20px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.logo-sub {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    min-width: 0;
    margin: 0 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link i {
    width: 16px;
    height: 16px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger {
    color: var(--text-primary);
    background-color: var(--bg-active);
}

.nav-dropdown-trigger i:first-child {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.65;
    transition: none;
}

.nav-dropdown.open:not(.is-closing) .nav-chevron {
    transform: rotate(180deg);
    transition: transform 0.1s ease-out;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 220px;
    max-width: min(280px, calc(100vw - 24px));
    max-height: min(70vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px;
    background-color: var(--nav-dropdown-bg);
    background-image: none;
    border: 1px solid var(--nav-dropdown-border);
    border-radius: var(--radius-md);
    box-shadow: var(--nav-dropdown-shadow);
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: none;
    z-index: 1200;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.nav-dropdown.open:not(.is-closing) .nav-dropdown-menu {
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition: transform 0.1s ease-out;
}

.nav-dropdown.is-closing .nav-dropdown-menu {
    visibility: hidden !important;
    transform: translateY(-6px) scale(0.98) !important;
    pointer-events: none !important;
    transition: none !important;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    transition: background-color var(--transition-fast);
}

.nav-dropdown-item-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--bg-input);
}

.nav-dropdown-item-icon i {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    color: var(--text-primary);
}

.nav-dropdown-item-icon.pdf-color {
    background-color: var(--pdf-bg);
}

.nav-dropdown-item-icon.image-color {
    background-color: var(--image-bg);
}

.nav-dropdown-item-icon.doc-color {
    background-color: var(--doc-bg);
}

.nav-dropdown-item-icon.convert-color {
    background-color: var(--convert-bg);
}

.nav-dropdown-item-icon.text-color {
    background-color: var(--text-bg);
}

.nav-dropdown-item-icon.util-color {
    background-color: var(--util-bg);
}

.nav-dropdown-item-icon.pdf-color i,
.nav-dropdown-item-icon.image-color i,
.nav-dropdown-item-icon.doc-color i,
.nav-dropdown-item-icon.convert-color i,
.nav-dropdown-item-icon.text-color i,
.nav-dropdown-item-icon.util-color i {
    color: var(--text-primary);
}

.nav-dropdown-item-icon.pdf-color {
    background-color: var(--pdf-bg);
    color: var(--pdf-base);
}

.nav-dropdown-item-icon.image-color {
    background-color: var(--image-bg);
    color: var(--image-base);
}

.nav-dropdown-item-icon.doc-color {
    background-color: var(--doc-bg);
    color: var(--doc-base);
}

.nav-dropdown-item-icon.convert-color {
    background-color: var(--convert-bg);
    color: var(--convert-base);
}

.nav-dropdown-item-icon.text-color {
    background-color: var(--text-bg);
    color: var(--text-base);
}

.nav-dropdown-item-icon.util-color {
    background-color: var(--util-bg);
    color: var(--util-base);
}

.nav-dropdown-item-icon i {
    width: 14px;
    height: 14px;
    display: block;
}

.nav-dropdown-item-icon svg {
    width: 14px !important;
    height: 14px !important;
    color: var(--text-primary) !important;
}

.nav-dropdown-item-icon.pdf-color svg {
    color: var(--pdf-base) !important;
}

.nav-dropdown-item-icon.image-color svg {
    color: var(--image-base) !important;
}

.nav-dropdown-item-icon.doc-color svg {
    color: var(--doc-base) !important;
}

.nav-dropdown-item-icon.convert-color svg {
    color: var(--convert-base) !important;
}

.nav-dropdown-item-icon.text-color svg {
    color: var(--text-base) !important;
}

.nav-dropdown-item-icon.util-color svg {
    color: var(--util-base) !important;
}

.nav-dropdown-item:hover {
    background-color: var(--nav-dropdown-item-hover);
}

.nav-dropdown-footer {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--nav-dropdown-border);
}

.nav-dropdown-all {
    color: var(--accent-primary) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.nav-dropdown-all i {
    width: 14px;
    height: 14px;
}

@media (max-width: 1100px) {
    .nav-dropdown-trigger span {
        display: none;
    }

    .nav-dropdown-trigger {
        padding: 8px;
    }

    .nav-links {
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }
}


/* Theme Switching icon management */
[data-theme="dark"] .sun-icon,
[data-theme="light"] .moon-icon {
    display: block;
}

[data-theme="dark"] .moon-icon,
[data-theme="light"] .sun-icon {
    display: none;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    position: relative;
    padding-top: 140px;
    padding-bottom: 40px;
    text-align: center;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 50%, transparent 100%);
    filter: blur(50px);
    z-index: -1;
    pointer-events: none;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar styling */
.search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

#tool-search {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

#tool-search:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background-color: var(--bg-card-hover);
}

/* ==========================================================================
   SMART DRAG AND DROP ZONE
   ========================================================================== */
.magic-upload-section {
    margin-bottom: 60px;
}

.dropzone {
    position: relative;
    background-color: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-primary);
    background-color: var(--bg-card-hover);
}

.dropzone.dragover {
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

.dropzone-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.dropzone-icon-stack {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dz-cloud {
    width: 54px;
    height: 54px;
    color: var(--accent-primary);
    transition: transform var(--transition-normal);
}

.dz-file {
    position: absolute;
    width: 24px;
    height: 24px;
    color: var(--accent-secondary);
    bottom: 8px;
    right: 8px;
    transform: scale(0.8);
    transition: transform var(--transition-normal);
}

.dropzone:hover .dz-cloud {
    transform: translateY(-4px);
}

.dropzone:hover .dz-file {
    transform: translate(3px, 3px) scale(0.9);
}

.dropzone h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 14px;
    margin-bottom: 24px;
    color: var(--text-muted);
}

/* ==========================================================================
   MAIN DASHBOARD GRID
   ========================================================================== */
.main-dashboard {
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding-bottom: 80px;
}

.tool-category-section {
    scroll-margin-top: 100px;
}

.category-header {
    margin-bottom: 24px;
}

.mobile-section-meta {
    display: none;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.category-title-wrapper h2 {
    font-size: 28px;
    font-weight: 700;
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon i {
    width: 22px;
    height: 22px;
}

.pdf-color {
    background-color: var(--pdf-bg);
    color: var(--pdf-base);
}

.image-color {
    background-color: var(--image-bg);
    color: var(--image-base);
}

.doc-color {
    background-color: var(--doc-bg);
    color: var(--doc-base);
}

.convert-color {
    background-color: var(--convert-bg);
    color: var(--convert-base);
}

.text-color {
    background-color: var(--text-bg);
    color: var(--text-base);
}

.util-color {
    background-color: var(--util-bg);
    color: var(--util-base);
}

/* Tools Grid Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform var(--transition-normal);
}

.tool-card-icon i {
    width: 24px;
    height: 24px;
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.08);
}

.tool-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 24px;
    flex-grow: 1;
}

/* ==========================================================================
   MODAL DIALOG (SMART POPUP)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    background-color: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-card {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    font-size: 14px;
    margin-bottom: 20px;
}

.smart-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.smart-action-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.smart-action-btn:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-active);
    transform: translateX(4px);
}

.smart-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-action-icon i {
    width: 20px;
    height: 20px;
}

.smart-action-info h4 {
    font-size: 14px;
    font-weight: 600;
}

.smart-action-info p {
    font-size: 12px;
    margin: 0;
    color: var(--text-muted);
}

/* ==========================================================================
   DYNAMIC WORKSPACE OVERLAY
   ========================================================================== */
.workspace-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-app);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
    transition: all var(--transition-normal);
}

.workspace-overlay.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.workspace-header {
    background-color: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-title-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

#workspace-title {
    font-size: 20px;
    font-weight: 700;
}

.workspace-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px 24px;
}

/* Common Workspace Components */
.ws-container {
    max-width: 960px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.ws-header {
    text-align: center;
    margin-bottom: 30px;
}

.ws-header h3 {
    font-size: 24px;
    margin-bottom: 6px;
}

.ws-header p {
    font-size: 14px;
}

/* File selection details inside tools */
.selected-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-item-info i {
    color: var(--accent-primary);
}

.file-name {
    font-size: 14px;
    font-weight: 500;
}

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

.file-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Split layout inside tool configurations */
.split-workspace {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 160px);
}

@media (max-width: 900px) {
    .split-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.control-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-panel {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   TOOL WORKSPACE SPECIFIC SCHEMES
   ========================================================================== */

/* --- Image Resizer / Compressor / Cropper Forms --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    padding: 10px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lock-aspect-ratio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.lock-aspect-ratio input {
    accent-color: var(--accent-primary);
}

/* --- Image Cropper Overlay --- */
.crop-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-image {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    user-select: none;
    pointer-events: none;
}

.crop-overlay {
    position: absolute;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    cursor: move;
}

.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: var(--accent-primary);
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.handle-tl { top: -7px; left: -7px; cursor: nwse-resize; }
.handle-tr { top: -7px; right: -7px; cursor: nesw-resize; }
.handle-bl { bottom: -7px; left: -7px; cursor: nesw-resize; }
.handle-br { bottom: -7px; right: -7px; cursor: nwse-resize; }

.crop-preview-panel {
    overflow: auto;
}

.crop-polygon-hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.crop-polygon-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crop-polygon-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 4;
}

.crop-container.crop-mode-polygon {
    cursor: crosshair;
}

.crop-container.crop-mode-polygon .crop-overlay {
    display: none !important;
}

.crop-polygon-dim {
    fill: rgba(0, 0, 0, 0.55);
    fill-rule: evenodd;
}

.crop-polygon-stroke {
    fill: rgba(99, 102, 241, 0.12);
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.crop-polygon-stroke.closed {
    stroke: var(--accent-primary);
    stroke-dasharray: none;
}

.crop-polygon-stroke.open {
    fill: none;
    stroke-dasharray: 6 4;
}

.crop-polygon-vertex {
    fill: #ffffff;
    stroke: var(--accent-primary);
    stroke-width: 2;
    cursor: pointer;
    pointer-events: all;
}

.crop-polygon-vertex.first {
    fill: var(--accent-primary);
    stroke: #ffffff;
}

/* Real-time image side-by-side stats */
.stats-banner {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background-color: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

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

.stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Resume & Invoice Preview Pages --- */
.resume-preview-doc {
    background-color: #ffffff;
    color: #1e293b;
    width: 100%;
    aspect-ratio: 1 / 1.414; /* Standard A4 Aspect Ratio */
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    padding: 40px;
    overflow-y: auto;
    font-family: var(--font-document);
    font-size: 14px;
}

/* Printable PDF sheets layouts */
.resume-tpl-modern .resume-header {
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.resume-tpl-modern .resume-name {
    font-family: var(--font-document);
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
}
.resume-tpl-modern .resume-title {
    font-size: 16px;
    color: #4f46e5;
    font-weight: 600;
}
.resume-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.invoice-preview-doc {
    background-color: #ffffff;
    color: #334155;
    width: 100%;
    aspect-ratio: 1 / 1.414;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    padding: 40px;
    overflow-y: auto;
    font-family: var(--font-document);
}

.invoice-header-grid {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
    font-size: 12px;
}

.invoice-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 12px;
    font-size: 12px;
}

.invoice-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    background-color: var(--bg-card);
}

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

.footer-content p {
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    transition: color var(--transition-fast);
}

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

/* Custom tabs for forms */
.tab-headers {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 12px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   PRINTABLE PAPER STYLES & THEME OVERRIDES (Bypasses Dark Mode variables)
   ========================================================================== */
.resume-preview-doc,
.invoice-preview-doc,
.resume-preview-doc *,
.invoice-preview-doc * {
    color: #1e293b !important;
}

/* Maintain original template design colors */
.resume-tpl-modern .resume-name {
    color: #1e1b4b !important;
}
.resume-tpl-modern .resume-title {
    color: #6366f1 !important;
}
.resume-tpl-modern span,
.resume-tpl-modern span i,
.resume-tpl-modern span * {
    color: #475569 !important;
}
.resume-tpl-modern span i {
    color: #6366f1 !important;
}
.resume-section-title {
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.invoice-preview-doc strong,
.invoice-preview-doc h2,
.invoice-preview-doc span,
.invoice-preview-doc td,
.invoice-preview-doc th {
    color: #1e293b !important;
}
.invoice-preview-doc th {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #cbd5e1 !important;
}
.invoice-preview-doc td {
    border-bottom: 1px solid #f1f5f9 !important;
}
.invoice-preview-doc .invoice-totals span:last-child {
    color: #4f46e5 !important;
}

/* ==========================================================================
   DARK MODE — WORKSPACE & IMAGE TOOLS FULL THEME FIX
   Ensures all text/inputs/selects inside the workspace overlay
   correctly inherit the dark-theme colour tokens.
   ========================================================================== */

/* Workspace overlay background always uses app bg token */
.workspace-overlay {
    background-color: var(--bg-app);
    color: var(--text-primary);
}

/* Headings inside workspace always theme-aware */
.workspace-overlay h3,
.workspace-overlay h4,
.workspace-overlay label,
.workspace-overlay strong {
    color: var(--text-primary);
}

.workspace-overlay p {
    color: var(--text-secondary);
}

/* Control panel (left sidebar of split layout) */
.control-panel {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.control-panel h3 {
    color: var(--text-primary);
}

.control-panel p {
    color: var(--text-secondary);
}

/* Form labels */
.form-group label {
    color: var(--text-secondary);
}

/* All text inputs, textareas, selects — use theme variables */
.form-input,
.form-input:focus,
select.form-input,
textarea.form-input {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

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

/* Select dropdown arrow color fix for dark mode */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Stats banner inside tools */
.stats-banner {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.stat-val {
    color: var(--accent-primary);
}

.stat-lbl {
    color: var(--text-muted);
}

/* File list items */
.file-item {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.file-name {
    color: var(--text-primary);
}

.file-size {
    color: var(--text-muted);
}

/* Smart modal actions */
.smart-action-btn {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.smart-action-info h4 {
    color: var(--text-primary);
}

.smart-action-info p {
    color: var(--text-muted);
}

/* Lock aspect ratio checkbox label */
.lock-aspect-ratio {
    color: var(--text-secondary);
}

/* Preview panel */
.preview-panel {
    background-color: var(--bg-input);
    border-color: var(--border-color);
}

/* WS container (PDF tools) */
.ws-container {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.ws-header h3 {
    color: var(--text-primary);
}

.ws-header p {
    color: var(--text-secondary);
}

/* Quality label value (image compression slider) */
#compimg-quality-val {
    color: var(--accent-primary);
}

/* Compression before/after size labels */
#compimg-size-before,
#compimg-size-after {
    color: var(--text-primary);
}

/* Resize controls heading spans */
#resize-controls span,
#compimg-controls span {
    color: var(--text-secondary);
}

/* Range input thumb */
input[type="range"] {
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Workspace header text */
.workspace-header {
    background-color: var(--bg-header);
    border-color: var(--border-color);
    color: var(--text-primary);
}

#workspace-title {
    color: var(--text-primary);
}

/* Upload zone text inside image tools */
.dropzone p {
    color: var(--text-secondary);
}

/* Dropzone heading */
.dropzone h3 {
    color: var(--text-primary);
}

/* ==========================================================================
   SELECT / OPTION — Native browser dropdown text fix
   ========================================================================== */
select.form-input option {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

/* ==========================================================================
   MODAL CARD — text always theme-aware
   ========================================================================== */
.modal-card {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-header h3 {
    color: var(--text-primary);
}

.modal-body p {
    color: var(--text-secondary);
}

/* Close button inside modal */
.close-modal {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   IMAGE TOOLS — Upload zone initial state in dark mode
   ========================================================================== */
/* When image not yet loaded, show a nice upload prompt */
#resize-upload-zone,
#editor-upload-zone,
#compimg-upload-zone,
#crop-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    border-color: var(--border-hover);
}

#resize-upload-zone p,
#editor-upload-zone p,
#compimg-upload-zone p,
#crop-upload-zone p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Make sure the initial control panel state shows upload zone  */
#resize-controls,
#editor-controls,
#compimg-controls,
#crop-controls {
    gap: 16px;
}

/* Image preview inside panel */
#resize-preview-img,
#compimg-preview-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    object-fit: contain;
}

.editor-preview-canvas {
    max-width: 100%;
    max-height: 70vh;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    object-fit: contain;
}

.editor-crop-nudge {
    display: grid;
    grid-template-columns: 44px 132px 44px;
    grid-template-rows: 40px 40px 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.editor-crop-nudge > button:first-child {
    grid-column: 2;
    grid-row: 1;
}

.editor-crop-nudge > button:last-child {
    grid-column: 2;
    grid-row: 3;
}

.editor-crop-nudge-row {
    grid-column: 1 / 4;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, 44px);
    justify-content: center;
    gap: 8px;
}

.editor-crop-nudge .btn {
    min-width: 44px;
    min-height: 40px;
    padding: 0;
}

/* Compression stats row spans */
.stats-banner span {
    color: var(--text-secondary);
    font-size: 12px;
}

.stats-banner strong {
    color: var(--text-primary);
    font-size: 12px;
}

/* Quality % badge next to slider label */
#compimg-quality-val {
    color: var(--accent-primary) !important;
    font-size: 14px;
    font-weight: 700;
}

/* After estimate shown in image-base colour */
#compimg-size-after {
    color: var(--image-base) !important;
}

.resize-preview-meta {
    align-self: flex-start;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.doc-download-select {
    border: 2px solid var(--accent-primary) !important;
    background-color: var(--bg-active) !important;
    font-weight: 700;
}

.doc-download-select:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.input-prefix-row {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
}

.input-prefix-row span {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.input-prefix-row .form-input {
    border: 0;
    border-radius: 0;
    background: transparent;
}

/* Image to text OCR */
.ocr-preview-panel {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 16px;
    overflow-y: auto;
}

.ocr-image-wrap {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    padding: 16px;
}

.ocr-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background-color: var(--border-color);
}

.ocr-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-gradient);
    transition: width 0.2s ease;
}

.ocr-output-shell {
    display: flex;
    min-height: 260px;
    flex: 1;
    flex-direction: column;
    gap: 12px;
}

.ocr-output-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ocr-output-actions strong {
    color: var(--text-primary);
}

.ocr-output {
    min-height: 240px;
    flex: 1;
    resize: vertical;
    line-height: 1.6;
}

/* ==========================================================================
   SEO CONTENT SECTIONS
   ========================================================================== */

.section-heading {
    text-align: center;
    margin-bottom: 48px;
}

.section-heading h2 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.section-heading p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* How It Works */
.how-it-works-section {
    padding: 80px 24px;
}

.how-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.how-step-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    position: relative;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.how-step-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.how-step-number {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 800;
    color: var(--accent-primary);
    opacity: 0.15;
    line-height: 1;
    margin-bottom: -8px;
}

.how-step-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-active);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.how-step-icon i { width: 24px; height: 24px; }

.how-step-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.how-step-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Features */
.features-section {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 80px 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-active);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.feature-icon i { width: 22px; height: 22px; }

.feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

/* FAQ */
.faq-section {
    padding: 80px 24px;
}

.faq-list {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-normal);
}

.faq-item[open] {
    border-color: var(--border-hover);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px 20px;
    border-top: 1px solid var(--border-color);
}

.faq-answer p {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* ==========================================================================
   TEXT, CONVERTER & UTILITY TOOL COMPONENTS
   ========================================================================== */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.case-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tcompare-result {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 50vh;
    overflow-y: auto;
}

.tcompare-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.tcompare-summary .diff-same { color: var(--image-base); }
.tcompare-summary .diff-changed { color: var(--convert-base); }
.tcompare-summary .diff-removed { color: var(--pdf-base); }
.tcompare-summary .diff-added { color: var(--util-base); }

.tcompare-table {
    font-family: ui-monospace, monospace;
    font-size: 12px;
}

.tcompare-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
}

.tcompare-ln {
    padding: 6px 8px;
    color: var(--text-muted);
    background: var(--bg-input);
    text-align: right;
}

.tcompare-cell {
    padding: 6px 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.tcompare-same .tcompare-cell { background: transparent; }
.tcompare-changed .tcompare-cell { background: rgba(245, 158, 11, 0.12); }
.tcompare-removed .tcompare-a { background: rgba(239, 68, 68, 0.12); }
.tcompare-added .tcompare-b { background: rgba(6, 182, 212, 0.12); }

.qr-mount {
    padding: 16px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.qr-mount img {
    display: block;
}

.color-swatch {
    width: min(280px, 80vw);
    height: min(280px, 50vh);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.pw-strength {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.pw-weak { color: var(--pdf-base); }
.pw-fair { color: var(--convert-base); }
.pw-strong { color: var(--image-base); }
.pw-very-strong { color: var(--util-base); }

#barcode-svg {
    max-width: 100%;
    background: #fff;
    padding: 12px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   UNIFIED FILE CONVERTER
   ========================================================================== */
.tools-grid-single {
    grid-template-columns: minmax(280px, 520px);
}

.tool-card-featured {
    border-color: var(--convert-base);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.fc-workspace .control-panel {
    gap: 14px;
}

.fc-type-select {
    font-weight: 600;
}

.fc-hint {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.fc-dropzone {
    padding: 22px !important;
    border-width: 1px !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.fc-file-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 8px 0 0;
    min-height: 18px;
}

.fc-file-meta.fc-meta-warn {
    color: var(--pdf-base);
}

.fc-text-input {
    min-height: 140px;
    resize: vertical;
    margin-bottom: 8px;
}

.fc-text-upload-btn {
    width: 100%;
}

.fc-range-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.fc-actions .btn-primary {
    flex: 1;
    min-width: 160px;
}

.fc-preview-panel {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.fc-preview-media {
    max-width: 100%;
    max-height: 65vh;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    object-fit: contain;
}

.fc-preview-html {
    width: 100%;
    max-height: 65vh;
    overflow: auto;
    min-height: 120px;
}

.fc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

/* Background remover */
.rmbg-preview-panel {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: auto;
}

.rmbg-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

@media (max-width: 768px) {
    .rmbg-compare {
        grid-template-columns: 1fr;
    }
}

.rmbg-compare-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.rmbg-compare-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.rmbg-preview-img {
    width: 100%;
    max-height: 42vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
}

.rmbg-checkerboard {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

[data-theme="dark"] .rmbg-checkerboard {
    background-color: #1e293b;
    background-image:
        linear-gradient(45deg, #334155 25%, transparent 25%),
        linear-gradient(-45deg, #334155 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #334155 75%),
        linear-gradient(-45deg, transparent 75%, #334155 75%);
}

.rmbg-checkerboard .rmbg-preview-img {
    border: none;
    background: transparent;
}

/* ==========================================================================
   MOBILE UI — LAYOUT, NAV DRAWER & TOUCH-FRIENDLY TOOLS
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
}

.mobile-nav-sheet {
    position: fixed;
    inset: 0;
    z-index: 1300;
    pointer-events: none;
    visibility: hidden;
}

.mobile-nav-sheet.open {
    pointer-events: auto;
    visibility: visible;
}

.mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-nav-sheet.open .mobile-nav-backdrop {
    opacity: 1;
}

.mobile-nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 320px);
    height: 100%;
    max-height: 100dvh;
    background: var(--nav-dropdown-bg);
    border-left: 1px solid var(--nav-dropdown-border);
    box-shadow: var(--nav-dropdown-shadow);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-sheet.open .mobile-nav-panel {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--nav-dropdown-border);
    flex-shrink: 0;
}

.mobile-nav-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-nav-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 24px;
}

.mobile-nav-section-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
}

.mobile-nav-section-row:active {
    background: var(--nav-dropdown-item-hover);
}

.mobile-nav-section-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
}

.mobile-nav-section-icon i {
    width: 20px;
    height: 20px;
}

.mobile-nav-section-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-nav-section-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.mobile-nav-section-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.mobile-nav-section-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

body.mobile-nav-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .nav-links {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .header-container {
        flex-wrap: nowrap;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .container,
    .hero-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-container {
        padding: 10px 16px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .logo-sub {
        display: none;
    }

    .logo-title {
        font-size: 16px;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .hero-section {
        padding-top: 88px;
        padding-bottom: 28px;
    }

    .hero-title {
        font-size: 32px;
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .search-wrapper {
        max-width: 100%;
    }

    #tool-search {
        font-size: 16px;
        padding: 12px 16px 12px 44px;
    }

    .magic-upload-section {
        margin-bottom: 36px;
    }

    .dropzone {
        padding: 28px 16px;
    }

    .dropzone h3 {
        font-size: 16px;
    }

    .dropzone-text,
    .dropzone p {
        font-size: 13px;
    }

    .main-dashboard {
        gap: 10px;
        padding-bottom: 40px;
    }

    .mobile-hub-label {
        grid-column: 1 / -1;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
        margin: 0 0 4px;
        letter-spacing: 0.02em;
    }

    .mobile-section-back {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }

    .mobile-section-back-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Hub: all categories on one screen */
    .main-dashboard.mobile-hub-view {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: stretch;
    }

    .main-dashboard.mobile-hub-view .tool-category-section {
        margin: 0;
    }

    .main-dashboard.mobile-hub-view .tool-category-section .tools-grid {
        display: none !important;
    }

    .main-dashboard.mobile-hub-view .category-header {
        margin: 0;
        height: 100%;
        min-height: 88px;
        padding: 14px 12px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: var(--bg-card);
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .main-dashboard.mobile-hub-view .category-header p {
        display: none;
    }

    .main-dashboard.mobile-hub-view .category-title-wrapper {
        margin: 0;
        align-items: flex-start;
        gap: 8px;
    }

    .main-dashboard.mobile-hub-view .category-title-wrapper h2 {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.25;
    }

    .main-dashboard.mobile-hub-view .category-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .main-dashboard.mobile-hub-view .category-icon i {
        width: 18px;
        height: 18px;
    }

    .mobile-section-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin-top: auto;
    }

    .mobile-section-count {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
    }

    .mobile-section-chevron {
        width: 16px;
        height: 16px;
        color: var(--text-muted);
    }

    .main-dashboard.mobile-drilldown,
    .main-dashboard.mobile-search-active {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Drill-down: one category, compact tool list */
    .main-dashboard.mobile-drilldown .tool-category-section {
        display: none;
        margin-bottom: 0;
    }

    .main-dashboard.mobile-drilldown .tool-category-section.mobile-section-active {
        display: block;
    }

    .main-dashboard.mobile-drilldown .mobile-section-active .category-header {
        margin-bottom: 12px;
        cursor: default;
        padding: 0;
        border: none;
        background: transparent;
        min-height: 0;
    }

    .main-dashboard.mobile-drilldown .mobile-section-active .category-header p {
        display: block;
        font-size: 13px;
        margin-top: 4px;
    }

    .main-dashboard.mobile-drilldown .mobile-section-active .mobile-section-meta {
        display: none;
    }

    .main-dashboard.mobile-drilldown .mobile-section-active .category-title-wrapper h2 {
        font-size: 22px;
    }

    .main-dashboard.mobile-drilldown .tools-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .main-dashboard.mobile-drilldown .tool-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        min-height: 52px;
    }

    .main-dashboard.mobile-drilldown .tool-card-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        margin: 0;
    }

    .main-dashboard.mobile-drilldown .tool-card h3 {
        flex: 1;
        font-size: 15px;
        margin: 0;
    }

    .main-dashboard.mobile-drilldown .tool-card p,
    .main-dashboard.mobile-drilldown .tool-card .btn-text {
        display: none !important;
    }

    /* Search: flat minimal matches */
    .main-dashboard.mobile-search-active .tool-category-section {
        margin-bottom: 20px;
    }

    .main-dashboard.mobile-search-active .category-header p {
        display: none;
    }

    .main-dashboard.mobile-search-active .mobile-section-meta {
        display: none;
    }

    .main-dashboard.mobile-search-active .tool-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
    }

    .main-dashboard.mobile-search-active .tool-card p,
    .main-dashboard.mobile-search-active .tool-card .btn-text {
        display: none !important;
    }

    .main-dashboard.mobile-search-active .tool-card h3 {
        font-size: 15px;
    }

    body.mobile-hub-page .how-it-works-section,
    body.mobile-hub-page .features-section {
        display: none;
    }

    body.mobile-hub-page .hero-section {
        padding-top: 80px;
        padding-bottom: 16px;
    }

    body.mobile-hub-page .hero-title {
        font-size: 26px;
    }

    body.mobile-hub-page .hero-subtitle {
        display: none;
    }

    body.mobile-hub-page .magic-upload-section {
        margin-bottom: 20px;
    }

    body.mobile-hub-page .dropzone {
        padding: 20px 14px;
    }

    body.mobile-hub-page .dropzone h3 {
        font-size: 14px;
    }

    body.mobile-hub-page .dropzone-text,
    body.mobile-hub-page .dropzone p {
        display: none;
    }

    body.mobile-hub-page .dropzone-icon-stack {
        margin-bottom: 8px;
    }

    .tool-category-section {
        margin-bottom: 0;
    }

    .category-header {
        margin-bottom: 12px;
    }

    .category-header p {
        font-size: 14px;
    }

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

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

    .tool-card:hover {
        transform: none;
    }

    .how-steps-grid,
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        text-align: left;
    }

    .footer-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .modal-card {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        overflow-y: auto;
        flex: 1;
    }

    .smart-action-btn:hover {
        transform: none;
    }

    .workspace-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .workspace-title-area {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    #workspace-title {
        font-size: 17px;
        line-height: 1.35;
        white-space: normal;
        word-break: break-word;
    }

    #workspace-back-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .workspace-content {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .ws-container {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    .ws-header h3 {
        font-size: 20px;
    }

    .split-workspace {
        grid-template-columns: 1fr;
        gap: 16px;
        height: auto;
        max-width: 100%;
    }

    .control-panel {
        padding: 16px;
        gap: 14px;
        max-height: none;
        overflow: visible;
    }

    .preview-panel {
        padding: 12px;
        min-height: 200px;
        max-height: none;
    }

    .crop-image {
        max-height: 50vh;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .workspace-overlay .control-panel > div[style*="display: flex"],
    .fc-actions,
    .crop-polygon-actions,
    .case-btn-grid {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .workspace-overlay .control-panel > div[style*="display: flex"] .btn,
    .fc-actions .btn,
    .crop-polygon-actions .btn,
    .case-btn-grid .btn {
        width: 100%;
        min-height: 44px;
    }

    .workspace-overlay .control-panel > div[style*="display: flex"] .btn[style*="flex:"] {
        flex: none !important;
    }

    .fc-text-input,
    .ocr-output,
  textarea.form-input {
        font-size: 16px;
        min-height: 120px;
    }

    .tcompare-row {
        grid-template-columns: 36px 1fr;
        grid-template-areas:
            "ln a"
            "ln b";
    }

    .tcompare-ln {
        grid-area: ln;
    }

    .tcompare-a {
        grid-area: a;
        border-bottom: 1px dashed var(--border-color);
    }

    .tcompare-b {
        grid-area: b;
    }

    .tcompare-b::before {
        content: "B: ";
        font-weight: 700;
        color: var(--text-muted);
        font-size: 10px;
    }

    .tcompare-a::before {
        content: "A: ";
        font-weight: 700;
        color: var(--text-muted);
        font-size: 10px;
    }

    .rmbg-compare {
        grid-template-columns: 1fr;
    }

    .rmbg-preview-img,
    .fc-preview-media {
        max-height: 38vh;
    }

    .resume-preview-doc,
    .invoice-preview-doc {
        padding: 20px;
    }

    .tab-headers {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tab-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
        font-size: 12px;
        padding: 8px 10px;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 40px;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .file-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .nav-dropdown-menu {
        position: fixed;
        left: 16px !important;
        right: 16px !important;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 28px;
    }

    .logo-text {
        max-width: 120px;
    }
}
