﻿/* Main Workspace Container */
        .workspace {
            max-width: 1040px;
            width: 100%;
            margin: 1.5rem auto 4rem;
            padding: 0 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.75rem;
        }

        /* Glassmorphic Cards */
        .glass-card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            padding: 2rem;
            box-shadow: var(--shadow-card);
            position: relative;
            overflow: hidden;
        }

        .glass-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
        }

        /* Drop Zone */
        .dropzone {
            border: 2px dashed rgba(99, 102, 241, 0.35);
            border-radius: var(--radius-lg);
            padding: 3.5rem 2rem;
            text-align: center;
            background: rgba(17, 24, 39, 0.4);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            outline: none;
        }

        .dropzone:hover, .dropzone.dragover {
            border-color: var(--accent-primary);
            background: rgba(99, 102, 241, 0.08);
            box-shadow: var(--shadow-glow);
            transform: translateY(-2px);
        }

        .dropzone-icon {
            width: 76px;
            height: 76px;
            border-radius: 50%;
            background: rgba(99, 102, 241, 0.12);
            color: #818cf8;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.25rem;
            margin: 0 auto 1.5rem;
            border: 1px solid rgba(99, 102, 241, 0.25);
            transition: transform 0.25s ease;
        }

        .dropzone:hover .dropzone-icon {
            transform: scale(1.08);
            color: #a5b4fc;
        }

        .dropzone-title {
            font-size: 1.35rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .dropzone-sub {
            color: var(--text-muted);
            font-size: 0.95rem;
            margin-bottom: 1.25rem;
        }

        .btn-choose {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.6rem;
            border-radius: var(--radius-md);
            background: var(--accent-primary);
            color: #fff;
            font-weight: 600;
            font-size: 0.92rem;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
            transition: all 0.2s ease;
        }

        .btn-choose:hover {
            background: #4f46e5;
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
            transform: translateY(-1px);
        }

        .file-input {
            display: none;
        }

        /* File Selected State Bar */
        .file-info-bar {
            display: none;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 1.1rem 1.4rem;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.5rem;
            animation: fadeIn 0.3s ease;
        }

        .file-info-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .pdf-icon-box {
            width: 46px;
            height: 46px;
            border-radius: var(--radius-sm);
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: #f87171;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
        }

        .file-details h4 {
            font-size: 1rem;
            font-weight: 700;
            max-width: 400px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .file-details p {
            font-size: 0.82rem;
            color: var(--text-muted);
            margin-top: 0.2rem;
            display: flex;
            gap: 0.75rem;
        }

        .btn-remove-file {
            background: rgba(244, 63, 94, 0.1);
            color: #fb7185;
            border: 1px solid rgba(244, 63, 94, 0.25);
            padding: 0.45rem 0.85rem;
            border-radius: var(--radius-sm);
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-remove-file:hover {
            background: rgba(244, 63, 94, 0.2);
            color: #fff;
        }

        /* Configuration Sections */
        .config-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .config-title {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            font-size: 1.2rem;
            font-weight: 700;
        }

        .config-title i {
            color: var(--accent-cyan);
        }

        /* Quick Presets Grid */
        .presets-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 0.9rem;
            margin-bottom: 1.75rem;
        }

        .preset-card {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 1.1rem 1rem;
            cursor: pointer;
            text-align: left;
            transition: all 0.2s ease;
            position: relative;
        }

        .preset-card:hover {
            border-color: rgba(99, 102, 241, 0.4);
            background: rgba(99, 102, 241, 0.05);
            transform: translateY(-2px);
        }

        .preset-card.active {
            border-color: var(--accent-primary);
            background: rgba(99, 102, 241, 0.12);
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
        }

        .preset-badge {
            position: absolute;
            top: 0.65rem;
            right: 0.65rem;
            font-size: 0.65rem;
            padding: 0.2rem 0.5rem;
            border-radius: 999px;
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
            font-weight: 700;
            text-transform: uppercase;
        }

        .preset-card h5 {
            font-size: 0.95rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
            gap: 0.45rem;
        }

        .preset-card p {
            font-size: 0.78rem;
            color: var(--text-muted);
            line-height: 1.35;
        }

        /* Detailed Settings Controls */
        .settings-panel {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            padding-top: 1.25rem;
            border-top: 1px solid var(--border-glass);
        }

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

        .control-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .control-label {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .control-val-badge {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            padding: 0.15rem 0.55rem;
            border-radius: var(--radius-sm);
            background: rgba(99, 102, 241, 0.18);
            color: #a5b4fc;
            border: 1px solid rgba(99, 102, 241, 0.3);
        }

        .control-desc {
            font-size: 0.78rem;
            color: var(--text-dim);
            line-height: 1.4;
        }

        .custom-select {
            background: rgba(15, 23, 42, 0.8);
            border: 1px solid var(--border-glass);
            color: var(--text-main);
            padding: 0.75rem 1rem;
            border-radius: var(--radius-md);
            font-size: 0.92rem;
            font-family: inherit;
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .custom-select:focus {
            border-color: var(--border-focus);
        }

        /* Custom Slider */
        .range-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.1);
            outline: none;
            margin: 0.75rem 0 0.25rem;
        }

        .range-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--accent-primary);
            cursor: pointer;
            box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
            border: 2px solid #fff;
            transition: transform 0.1s ease;
        }

        .range-slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        /* Toggles */
        .toggle-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 0;
        }

        .toggle-info h6 {
            font-size: 0.88rem;
            font-weight: 600;
        }

        .toggle-info p {
            font-size: 0.75rem;
            color: var(--text-dim);
        }

        .switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider-switch {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(255, 255, 255, 0.12);
            transition: .3s;
            border-radius: 24px;
        }

        .slider-switch:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .3s;
            border-radius: 50%;
        }

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

        input:checked + .slider-switch:before {
            transform: translateX(20px);
        }

        /* Mode Selection Tabs */
        .mode-tabs {
            display: flex;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 0.3rem;
            gap: 0.3rem;
            margin-bottom: 1.5rem;
        }

        .mode-tab {
            flex: 1;
            padding: 0.65rem 1rem;
            border-radius: var(--radius-sm);
            border: none;
            background: transparent;
            color: var(--text-muted);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
        }

        .mode-tab.active {
            background: var(--bg-card);
            color: var(--text-main);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        /* Action Compress Button */
        .action-container {
            margin-top: 1.5rem;
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }

        .btn-compress {
            display: inline-flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.95rem 2.2rem;
            border-radius: var(--radius-md);
            background: var(--accent-gradient);
            color: #fff;
            font-size: 1.05rem;
            font-weight: 700;
            border: none;
            cursor: pointer;
            box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
            transition: all 0.25s ease;
        }

        .btn-compress:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
        }

        .btn-compress:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* Progress Card */
        .progress-card {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .progress-title {
            font-size: 1.1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .progress-status-badge {
            font-size: 0.85rem;
            font-family: 'JetBrains Mono', monospace;
            color: var(--accent-cyan);
        }

        .progress-track {
            width: 100%;
            height: 10px;
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.06);
            overflow: hidden;
            position: relative;
        }

        .progress-bar-fill {
            height: 100%;
            width: 0%;
            background: var(--accent-gradient);
            border-radius: 5px;
            transition: width 0.25s ease;
            position: relative;
        }

        .progress-bar-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: shimmer 1.5s infinite;
        }

        .progress-subtext {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-top: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .console-log {
            background: #060911;
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: var(--radius-sm);
            padding: 0.75rem 1rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.76rem;
            color: #94a3b8;
            max-height: 120px;
            overflow-y: auto;
            margin-top: 1rem;
        }

        .console-log div {
            margin-bottom: 0.25rem;
        }

        .console-log .highlight {
            color: #38bdf8;
        }

        /* Results Card */
        .results-card {
            display: none;
            animation: fadeIn 0.4s ease;
            background: linear-gradient(180deg, rgba(17, 24, 39, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
            border: 1px solid rgba(99, 102, 241, 0.3);
        }

        .results-hero {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1.5rem;
            padding-bottom: 2rem;
            border-bottom: 1px solid var(--border-glass);
        }

        .savings-box {
            display: flex;
            align-items: center;
            gap: 1.25rem;
        }

        .savings-percentage {
            font-size: 3.25rem;
            font-weight: 800;
            letter-spacing: -0.04em;
            color: var(--accent-emerald);
            line-height: 1;
        }

        .savings-meta h3 {
            font-size: 1.2rem;
            font-weight: 700;
        }

        .savings-meta p {
            font-size: 0.88rem;
            color: var(--text-muted);
        }

        /* Comparison Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
            gap: 1rem;
            margin: 1.75rem 0;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-md);
            padding: 1.1rem;
            text-align: center;
        }

        .stat-card .label {
            font-size: 0.78rem;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.4rem;
        }

        .stat-card .value {
            font-size: 1.35rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
        }

        .stat-card.stat-orig .value {
            color: var(--text-muted);
            text-decoration: line-through;
        }

        .stat-card.stat-new .value {
            color: var(--accent-emerald);
        }

        .results-actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-top: 1.5rem;
        }

        .btn-download {
            display: inline-flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.95rem 2.4rem;
            border-radius: var(--radius-md);
            background: var(--accent-emerald);
            color: #064e3b;
            font-size: 1.05rem;
            font-weight: 800;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
            transition: all 0.25s ease;
            text-decoration: none;
        }

        .btn-download:hover {
            background: #34d399;
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
        }

        .btn-preview {
            display: inline-flex;
            align-items: center;
            gap: 0.55rem;
            padding: 0.95rem 1.6rem;
            border-radius: var(--radius-md);
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-main);
            border: 1px solid var(--border-glass);
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-preview:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .btn-reset {
            display: inline-flex;
            align-items: center;
            gap: 0.55rem;
            padding: 0.95rem 1.6rem;
            border-radius: var(--radius-md);
            background: transparent;
            color: var(--text-muted);
            border: 1px solid var(--border-glass);
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-reset:hover {
            background: rgba(244, 63, 94, 0.1);
            color: #fb7185;
            border-color: rgba(244, 63, 94, 0.3);
        }

        /* Preview Modal */
        .modal-backdrop {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .modal-content {
            background: var(--bg-secondary);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 960px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
            overflow: hidden;
        }

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

        .modal-body {
            padding: 1.5rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1.5rem;
        }

        .preview-canvas-container {
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-sm);
            box-shadow: 0 10px 25px rgba(0,0,0,0.5);
            background: #fff;
            max-width: 100%;
        }

        .modal-close {
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 1.25rem;
            cursor: pointer;
        }

        .modal-close:hover {
            color: #fff;
        }

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

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