/* ============================================================================
   CONVERTIX - Tool Page Styles
   ============================================================================
   Styles for individual tool pages: dropzone, upload progress, settings panel,
   conversion results, sidebar cards, and responsive layout.
   ============================================================================ */

/* ============================================================================
   1. BREADCRUMB
   ============================================================================ */
.cvx-breadcrumb {
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-3) 0;
}
.cvx-breadcrumb-list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
}
.cvx-breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.cvx-breadcrumb-list li::after {
    content: '›';
    color: var(--text-tertiary);
    font-size: 0.875rem;
}
.cvx-breadcrumb-list li:last-child::after { display: none; }
.cvx-breadcrumb-list a { color: var(--text-tertiary); }
.cvx-breadcrumb-list a:hover { color: var(--text-link); }
.cvx-breadcrumb-list li:last-child { color: var(--text-secondary); font-weight: 500; }

/* ============================================================================
   2. TOOL HEADER
   ============================================================================ */
.cvx-tool-header {
    padding: var(--space-10) 0 var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}
.cvx-tool-header-inner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-6);
}
.cvx-tool-header-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cvx-tool-header-text h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}
.cvx-tool-header-text p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    max-width: 700px;
}

.cvx-tool-badges {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
    flex-wrap: wrap;
}
.cvx-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}
.cvx-badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--c-accent-600);
}
.cvx-badge-blue {
    background: rgba(99, 102, 241, 0.1);
    color: var(--c-primary-600);
}
[data-theme="dark"] .cvx-badge-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--c-accent-400);
}
[data-theme="dark"] .cvx-badge-blue {
    background: rgba(99, 102, 241, 0.15);
    color: var(--c-primary-300);
}

/* ============================================================================
   3. TOOL WORKSPACE LAYOUT
   ============================================================================ */
.cvx-tool-workspace {
    padding: var(--space-8) 0 var(--space-16);
}
.cvx-tool-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-8);
    align-items: start;
}

.cvx-tool-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.cvx-tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
}

/* ============================================================================
   4. DROPZONE
   ============================================================================ */
.cvx-dropzone {
    background: var(--bg-surface);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-default);
    position: relative;
    overflow: hidden;
}
.cvx-dropzone:hover {
    border-color: var(--c-primary-300);
    background: color-mix(in srgb, var(--c-primary-50) 50%, var(--bg-surface));
}
[data-theme="dark"] .cvx-dropzone:hover {
    background: color-mix(in srgb, var(--c-primary-950) 30%, var(--bg-surface));
    border-color: var(--c-primary-700);
}

.cvx-dropzone.dragover {
    border-color: var(--c-primary-500);
    background: var(--c-primary-50);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: scale(1.01);
}
[data-theme="dark"] .cvx-dropzone.dragover {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.cvx-dropzone-icon {
    margin-bottom: var(--space-4);
    opacity: 0.8;
}

.cvx-dropzone-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.cvx-dropzone-text {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
}

.cvx-dropzone-browse {
    background: none;
    border: none;
    color: var(--c-primary-600);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-body);
    font-size: inherit;
    padding: 0;
}
.cvx-dropzone-browse:hover { color: var(--c-primary-700); }

.cvx-dropzone-meta {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

/* ============================================================================
   5. UPLOAD PROGRESS BAR
   ============================================================================ */
.cvx-upload-progress {
    padding: var(--space-6);
}

.cvx-progress-file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
}
.cvx-progress-filename {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}
.cvx-progress-size { color: var(--text-tertiary); }

.cvx-progress-bar-track {
    height: 8px;
    background: var(--bg-surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
}
.cvx-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary-500), var(--c-primary-400));
    border-radius: var(--radius-full);
    transition: width 200ms ease-out;
    position: relative;
}
.cvx-progress-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: cvx-shimmer 1.5s infinite;
}
@keyframes cvx-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.cvx-progress-percent {
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--c-primary-600);
}

/* ============================================================================
   6. FILE PREVIEW
   ============================================================================ */
.cvx-file-preview {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5);
}

.cvx-preview-image-wrap {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cvx-preview-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cvx-preview-info { flex: 1; }
.cvx-preview-name {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    word-break: break-all;
}
.cvx-preview-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
    line-height: var(--leading-relaxed);
}

/* ============================================================================
   7. SETTINGS PANEL
   ============================================================================ */
.cvx-settings-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.cvx-settings-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.cvx-settings-subtitle {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--c-primary-600);
    background: var(--c-primary-50);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}
[data-theme="dark"] .cvx-settings-subtitle {
    background: rgba(99, 102, 241, 0.15);
    color: var(--c-primary-300);
}

.cvx-setting-group {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}
.cvx-setting-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cvx-setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}
.cvx-setting-value {
    font-weight: 700;
    color: var(--c-primary-600);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}
.cvx-setting-note {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-tertiary);
}
.cvx-setting-help {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-2);
    line-height: var(--leading-relaxed);
}

/* Quality Slider */
.cvx-slider-container { width: 100%; }
.cvx-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-surface-3);
    border-radius: var(--radius-full);
    outline: none;
    transition: background var(--duration-fast);
}
.cvx-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--c-primary-500);
    cursor: pointer;
    border: 3px solid var(--bg-surface);
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-fast) var(--ease-spring);
}
.cvx-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--c-primary-600);
}
.cvx-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--c-primary-500);
    cursor: pointer;
    border: 3px solid var(--bg-surface);
    box-shadow: var(--shadow-md);
}

.cvx-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: var(--space-2);
}

/* Color Picker */
.cvx-color-picker {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.cvx-color-input {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 2px;
    background: var(--bg-surface);
}
.cvx-color-presets {
    display: flex;
    gap: var(--space-2);
}
.cvx-color-preset {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--duration-fast);
}
.cvx-color-preset:hover { border-color: var(--c-primary-400); }

/* Toggle Switch */
.cvx-setting-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.cvx-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.cvx-toggle input { opacity: 0; width: 0; height: 0; }
.cvx-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-surface-3);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.cvx-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--bg-surface);
    border-radius: 50%;
    transition: transform var(--duration-fast) var(--ease-spring);
    box-shadow: var(--shadow-xs);
}
.cvx-toggle input:checked + .cvx-toggle-slider {
    background: var(--c-primary-500);
}
.cvx-toggle input:checked + .cvx-toggle-slider::before {
    transform: translateX(20px);
}

/* Resize Dimension Inputs */
.cvx-dimension-inputs {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
}
.cvx-dimension-field {
    flex: 1;
}
.cvx-dimension-field label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}
.cvx-input-suffix {
    position: relative;
}
.cvx-input-suffix input {
    padding-right: 2.5rem;
}
.cvx-input-suffix span {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    pointer-events: none;
}

.cvx-lock-ratio {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}
.cvx-lock-ratio.active {
    background: var(--c-primary-50);
    color: var(--c-primary-600);
    border-color: var(--c-primary-200);
}
[data-theme="dark"] .cvx-lock-ratio.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--c-primary-300);
}

/* ============================================================================
   8. CONVERT BUTTON
   ============================================================================ */
.cvx-convert-actions {
    margin-top: var(--space-6);
}
.cvx-convert-btn {
    width: 100%;
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-8);
}
.cvx-convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cvx-convert-btn.processing {
    pointer-events: none;
    position: relative;
}
.cvx-convert-btn.processing::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cvx-spin 0.6s linear infinite;
}
@keyframes cvx-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   9. RESULT PANEL
   ============================================================================ */
.cvx-result-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
}
.cvx-result-success {
    text-align: center;
}
.cvx-result-icon { margin-bottom: var(--space-4); }
.cvx-result-success h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-6);
    color: var(--c-accent-500);
}

.cvx-result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    padding: var(--space-4);
    background: var(--bg-surface-2);
    border-radius: var(--radius-lg);
}
.cvx-result-stat {
    text-align: center;
}
.cvx-result-stat-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}
.cvx-result-stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 2px;
}

.cvx-result-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-bottom: var(--space-4);
}

.cvx-result-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ============================================================================
   10. SIDEBAR CARDS
   ============================================================================ */
.cvx-sidebar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}
.cvx-sidebar-card h3 {
    font-size: var(--text-sm);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.cvx-how-to-content {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}
.cvx-how-to-content ol,
.cvx-how-to-steps {
    counter-reset: step;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.cvx-how-to-content li,
.cvx-how-to-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2.25rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}
.cvx-how-to-content li::before,
.cvx-how-to-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--c-primary-50);
    color: var(--c-primary-600);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] .cvx-how-to-content li::before,
[data-theme="dark"] .cvx-how-to-steps li::before {
    background: rgba(99, 102, 241, 0.15);
    color: var(--c-primary-300);
}

.cvx-tool-info-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.cvx-tool-info-list li {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
}
.cvx-tool-info-list li span { color: var(--text-tertiary); }
.cvx-tool-info-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================== */
/* CONTENT SECTIONS (above/below tool)                            */
/* ============================================================== */
.cvx-content-above,
.cvx-content-below {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    padding: var(--space-8) 0;
}
.cvx-content-above h2,
.cvx-content-below h2 {
    font-size: var(--text-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}
.cvx-content-above p,
.cvx-content-below p {
    margin-bottom: var(--space-4);
}

/* ============================================================================
   11. RESPONSIVE
   ============================================================================ */
@media (max-width: 1024px) {
    .cvx-tool-layout {
        grid-template-columns: 1fr;
    }
    .cvx-tool-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }
}

@media (max-width: 768px) {
    .cvx-tool-header-inner { flex-direction: column; gap: var(--space-4); }
    .cvx-tool-header-icon { width: 56px; height: 56px; }

    .cvx-dropzone { padding: var(--space-8) var(--space-4); }

    .cvx-tool-sidebar {
        grid-template-columns: 1fr;
    }

    .cvx-result-actions {
        flex-direction: column;
    }
    .cvx-result-actions .cvx-btn { width: 100%; }

    .cvx-dimension-inputs { flex-direction: column; gap: var(--space-2); }
    .cvx-lock-ratio { align-self: center; }
}

@media (max-width: 480px) {
    .cvx-file-preview { flex-direction: column; text-align: center; }
    .cvx-preview-image-wrap { width: 100px; height: 100px; margin: 0 auto; }
}

/* ============================================================================
   MISSING CVX CLASSES (tool.php wrapper)
   ============================================================================ */
.cvx-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.cvx-tool-settings {
    padding: var(--space-6) 0;
}

.cvx-faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.cvx-faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.cvx-faq-item summary {
    padding: var(--space-4) var(--space-5);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    list-style: none;
    user-select: none;
}
.cvx-faq-item summary::-webkit-details-marker { display: none; }
.cvx-faq-item[open] { border-color: var(--c-primary-200); }
[data-theme="dark"] .cvx-faq-item[open] { border-color: var(--c-primary-800); }

.cvx-resize-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ============================================================================
   STANDALONE TOOL TEMPLATE CLASSES (tool- prefix)
   Used by: manipulator.php, batch.php, qr-barcode.php, encoding.php,
   favicon.php, pdf-tools.php, splitter-joiner.php, ocr.php, password-gen.php
   ============================================================================ */

/* Tool Interface Container */
.tool-interface {
    padding: var(--space-4) 0;
}

/* Upload Section */
.tool-upload-section {
    margin-bottom: var(--space-6);
}

/* Dropzone */
.tool-dropzone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-6);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--duration-normal), background var(--duration-normal);
    position: relative;
}
.tool-dropzone:hover,
.tool-dropzone.dragover {
    border-color: var(--c-primary-400);
    background: rgba(99, 102, 241, 0.03);
}
[data-theme="dark"] .tool-dropzone:hover,
[data-theme="dark"] .tool-dropzone.dragover {
    background: rgba(99, 102, 241, 0.06);
}
.tool-dropzone-batch {
    padding: var(--space-8) var(--space-6);
}

.tool-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}
.tool-dropzone-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: var(--space-2);
}
.tool-dropzone-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}
.tool-dropzone-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.tool-dropzone-limit {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

.tool-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    pointer-events: none;
}

/* Workspace Layout */
.tool-workspace {
    margin-top: var(--space-6);
}
.tool-workspace-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-6);
    align-items: start;
}

/* Preview Panel */
.tool-preview-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.tool-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-xs);
}
.tool-preview-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}
.tool-preview-info {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}
.tool-preview-canvas-wrap {
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: repeating-conic-gradient(var(--bg-surface-2) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}
.tool-preview-canvas {
    max-width: 100%;
    border-radius: var(--radius-sm);
}
.tool-file-info {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
}

/* Controls Panel */
.tool-controls-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}
.tool-controls-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

/* Control Groups */
.tool-control-group {
    margin-bottom: var(--space-4);
}
.tool-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}
.tool-control-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.tool-control-input:focus {
    outline: none;
    border-color: var(--c-primary-400);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.tool-control-input::placeholder { color: var(--text-tertiary); }

/* Range Slider */
.tool-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-surface-3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.tool-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-primary-500);
    border: 2px solid var(--bg-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.tool-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c-primary-500);
    border: 2px solid var(--bg-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

/* Checkbox Label */
.tool-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    cursor: pointer;
    color: var(--text-secondary);
}
.tool-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-primary-500);
}

/* Quick Buttons & Option Buttons */
.tool-quick-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--bg-surface-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all var(--duration-fast);
}
.tool-quick-btn:hover {
    background: var(--c-primary-50);
    border-color: var(--c-primary-300);
    color: var(--c-primary-700);
}

.tool-option-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all var(--duration-fast);
    text-align: left;
    width: 100%;
}
.tool-option-btn:hover {
    border-color: var(--c-primary-300);
    background: var(--bg-surface-2);
}
.tool-option-btn.active {
    border-color: var(--c-primary-500);
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    font-weight: 600;
}
[data-theme="dark"] .tool-option-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--c-primary-300);
    border-color: var(--c-primary-700);
}

/* Actions */
.tool-actions {
    margin-top: var(--space-4);
}
.tool-convert-btn {
    width: 100%;
}

/* Progress */
.tool-progress {
    margin: var(--space-4) 0;
}
.tool-progress-bar {
    height: 6px;
    background: var(--bg-surface-3);
    border-radius: 3px;
    overflow: hidden;
}
.tool-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary-500), var(--c-primary-400));
    border-radius: 3px;
    transition: width 200ms ease-out;
}
.tool-progress-text {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-align: center;
    margin-top: var(--space-2);
}

/* Result Section */
.tool-result {
    margin-top: var(--space-6);
}
.tool-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}
.tool-result-header h3 {
    font-size: var(--text-lg);
}
.tool-result-stats {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.tool-result-preview {
    margin-bottom: var(--space-6);
}
.tool-result-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-4);
    align-items: center;
}
.tool-result-original,
.tool-result-output {
    position: relative;
    text-align: center;
}
.tool-result-original img,
.tool-result-output img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
}
.tool-result-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-2);
}
.tool-result-size {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-2);
    font-family: var(--font-mono);
}
.tool-result-arrow {
    font-size: var(--text-2xl);
    color: var(--c-primary-400);
    font-weight: 700;
}
.tool-result-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}
.tool-batch-controls {
    padding: var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

/* ============================================================================
   STANDALONE TOOL RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .tool-workspace-grid {
        grid-template-columns: 1fr;
    }
    .tool-result-comparison {
        grid-template-columns: 1fr;
    }
    .tool-result-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
    .tool-result-actions {
        flex-direction: column;
    }
    .tool-result-actions .cvx-btn { width: 100%; }
    .tool-batch-controls {
        flex-direction: column;
    }
}
