


        .file-preview {
            margin-top: 1rem;
            background: #f1f5f9;
            border-radius: 1rem;
            padding: 0.8rem;
            display: inline-flex;
            align-items: center;
            gap: 12px;
            font-size: 0.9rem;
        }
        .file-preview i {
            font-size: 1.8rem;
            color: #dc2626;
        }

        /* Processing Area */
        .processing-area {
            display: none;
        }
        .processing-area.active {
            display: block;
        }

        /* Grid Layout */
        .tool-grid {
            display: grid;
            grid-template-columns: 1fr 360px;
            gap: 28px;
            align-items: start;
        }

        .left-preview-zone {
            background: transparent;
        }

        .preview-box {
            background: white;
            border-radius: 28px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.03), 0 2px 4px rgba(0,0,0,0.05);
            border: 1px solid #eef2ff;
        }
        .preview-title {
            font-weight: 600;
            margin-bottom: 16px;
            font-size: 1rem;
            display: flex;
            align-items: center;
            gap: 8px;
            color: #1e293b;
        }
.preview-image-container {
    background: #f8fafc;
    border-radius: 20px;
    padding: 16px;

    display: block;          /* مهم */
    overflow: auto;

    min-height: 280px;
    text-align: center;
}        canvas.preview-canvas {
            max-width: 100%;
            height: auto;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            border-radius: 12px;
            background: #fff;
            transition: all 0.1s ease;
        }

        .hidden-source-canvas {
            display: none;
        }

        .checkbox-strip {
            display: flex;
            flex-wrap: wrap;
            gap: 18px;
            background: white;
            border-radius: 24px;
            padding: 16px 20px;
            margin: 20px 0 18px 0;
            border: 1px solid #e2e8f0;
        }
        .checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
        }

        .preset-row, .output-options {
            background: white;
            border-radius: 24px;
            padding: 16px 20px;
            margin-bottom: 16px;
            border: 1px solid #e2e8f0;
        }
        .preset-row select, .output-options input, .output-options input[type="text"] {
            border-radius: 40px;
            padding: 8px 14px;
            border: 1px solid #cbd5e1;
        }

        .controls-sidebar {
            background: white;
            border-radius: 28px;
            padding: 20px;
            position: sticky;
            top: 24px;
            max-height: calc(100vh - 48px);
            overflow-y: auto;
            box-shadow: 0 8px 25px rgba(0,0,0,0.04);
            border: 1px solid #eef2ff;
        }
        .controls-grid {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .control-group {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .control-group label {
            width: 85px;
            font-size: 0.8rem;
            font-weight: 600;
            color: #334155;
        }
        .control-group input[type="range"] {
            flex: 1;
            min-width: 140px;
            height: 4px;
            border-radius: 10px;
        }
        .control-group span {
            width: 40px;
            font-size: 0.75rem;
            text-align: right;
        }

        .nav-zoom-row {
            display: flex;
            justify-content: space-between;
            background: white;
            border-radius: 60px;
            padding: 12px 20px;
            margin: 16px 0;
            border: 1px solid #e2e8f0;
            flex-wrap: wrap;
            gap: 12px;
        }
        .page-nav button, .action-buttons button {
            background: #f1f5f9;
            border: none;
            padding: 8px 16px;
            border-radius: 40px;
            font-weight: 500;
            cursor: pointer;
            transition: 0.2s;
        }
        .btn-primary {
            background: #3b82f6 !important;
            color: white;
        }
.action-buttons {
    position: sticky;
    bottom: 0;
    background: white;
    padding-top: 15px;
    margin-top: 20px;

    display: flex;
    gap: 10px;
}
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            visibility: hidden;
            backdrop-filter: blur(4px);
        }
        .loading-card {
            background: white;
            padding: 28px;
            border-radius: 32px;
            text-align: center;
        }
        .progress-bar-container {
            height: 8px;
            background: #e2e8f0;
            border-radius: 20px;
            overflow: hidden;
            margin-top: 12px;
        }
        .progress-bar {
            width: 0%;
            height: 100%;
            background: #3b82f6;
        }
        @media (max-width: 1000px) {
            .tool-grid {
                grid-template-columns: 1fr;
            }
            .controls-sidebar {
                position: static;
                max-height: none;
            }
            body {
                padding: 16px;
            }
        }
