/* =========================================================
   Image to PDF — Complete Layout (Scoped to .page-image-to-pdf)
   ========================================================= */

/* =========================================================
   1. WORKSPACE & PANELS
   ========================================================= */
.page-image-to-pdf .itp-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 30px 0;
    align-items: start;
}

@media (max-width: 900px) {
    .page-image-to-pdf .itp-workspace {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.page-image-to-pdf .itp-upload-panel .panel,
.page-image-to-pdf .itp-info-panel .panel {
    background: var(--bg-panel, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.page-image-to-pdf .itp-info-panel .panel {
    min-height: 400px;
}

.page-image-to-pdf .itp-info-content {
    color: var(--text-muted, #64748b);
    line-height: 1.7;
}

.page-image-to-pdf .itp-info-content p {
    margin: 0 0 16px;
}

.page-image-to-pdf .itp-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-image-to-pdf .itp-features li {
    padding: 10px 0 10px 30px;
    position: relative;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-main, #1e293b);
    font-size: 0.92rem;
}

.page-image-to-pdf .itp-features li:last-child {
    border-bottom: none;
}

.page-image-to-pdf .itp-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 10px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* =========================================================
   2. TABS, DROP ZONE & URL INPUT
   ========================================================= */
.page-image-to-pdf .upload-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-subtle, #f1f5f9);
    padding: 0.3rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0;
}

.page-image-to-pdf .tab-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.page-image-to-pdf .tab-btn:hover {
    color: var(--text-main, #1e293b);
}

.page-image-to-pdf .tab-btn.active {
    background: var(--bg-panel, #fff);
    color: var(--accent, #2563eb);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-image-to-pdf .tab-panel {
    display: none;
}
.page-image-to-pdf .tab-panel.active {
    display: block !important;
}

/* Drop Zone */
.page-image-to-pdf .itp-drop {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 2px dashed var(--border-color, #cbd5e1);
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-main, #f8fafc);
    margin-bottom: 1.25rem;
    transition: all 0.2s;
}

.page-image-to-pdf .itp-drop:hover,
.page-image-to-pdf .itp-drop:focus,
.page-image-to-pdf .itp-drop.drag-over {
    border-color: var(--accent, #2563eb);
    background-color: var(--accent-soft, rgba(37, 99, 235, 0.06));
    outline: none;
}

.page-image-to-pdf .drop-message svg {
    color: var(--accent, #2563eb);
    margin-bottom: 0.75rem;
}

.page-image-to-pdf .drop-message p {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.page-image-to-pdf .browse-link {
    color: var(--accent, #2563eb);
    font-weight: 600;
}

.page-image-to-pdf .sub-text {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

/* URL Input */
.page-image-to-pdf .url-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.page-image-to-pdf .url-input-group input[type="url"] {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: var(--bg-main, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    color: var(--text-main, #1e293b);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-image-to-pdf .url-input-group input[type="url"]:focus {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(37, 99, 235, 0.06));
}

.page-image-to-pdf .small-btn {
    width: auto;
    padding: 0.75rem 1.25rem;
    flex-shrink: 0;
}

.page-image-to-pdf .url-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 1rem;
    font-style: italic;
}

/* Camera */
.page-image-to-pdf .camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 320px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color, #e2e8f0);
}

.page-image-to-pdf #cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.page-image-to-pdf .camera-controls {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1.25rem;
    align-items: center;
    z-index: 3;
}

.page-image-to-pdf .cam-btn {
    background: rgba(0, 0, 0, 0.55);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.page-image-to-pdf .cam-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

.page-image-to-pdf .capture-btn {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.25);
    border: 3px solid #fff;
    padding: 0;
}

.page-image-to-pdf .capture-inner {
    display: block;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.1s;
}

.page-image-to-pdf .capture-btn:active .capture-inner {
    transform: scale(0.9);
}

.page-image-to-pdf .camera-status {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    z-index: 3;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-image-to-pdf .camera-status.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .page-image-to-pdf .camera-container {
        aspect-ratio: 3 / 4;
        min-height: 400px;
    }
    .page-image-to-pdf .capture-btn {
        width: 58px;
        height: 58px;
    }
    .page-image-to-pdf .capture-inner {
        width: 38px;
        height: 38px;
    }
    .page-image-to-pdf .cam-btn {
        width: 40px;
        height: 40px;
    }
}

/* =========================================================
   3. MULTI-PREVIEW GRID & FILE SUMMARY
   ========================================================= */
.page-image-to-pdf .multi-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 14px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
}

.page-image-to-pdf .multi-preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-color, #e2e8f0);
    background: var(--bg-subtle, #f8fafc);
    aspect-ratio: 1;
    cursor: zoom-in; /* ✅ इमेज पर क्लिक करने के लिए ज़ूम-इन कर्सर */
    transition: all 0.15s;
}

.page-image-to-pdf .multi-preview-item:hover {
    border-color: var(--accent, #2563eb);
    transform: scale(1.02);
}

.page-image-to-pdf .multi-preview-item.dragging {
    opacity: 0.4;
    cursor: grabbing; /* ✅ ड्रैग करते समय हाथ वाला कर्सर */
}

.page-image-to-pdf .multi-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.page-image-to-pdf .multi-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.page-image-to-pdf .multi-preview-item .remove-btn:hover {
    background: #dc2626;
}

.page-image-to-pdf .multi-preview-item .file-name-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 10px;
    padding: 3px 6px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.page-image-to-pdf .file-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e40af;
    font-weight: 500;
}

.page-image-to-pdf .file-summary .clear-all {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.page-image-to-pdf .file-summary .clear-all:hover {
    background: #fee2e2;
}

/* =========================================================
   4. OUTPUT MODE SELECTOR
   ========================================================= */
.page-image-to-pdf .output-mode-group {
    background: var(--bg-subtle, #f8fafc);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 18px;
}

.page-image-to-pdf .output-mode-group > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #1e293b);
    margin-bottom: 10px;
}

.page-image-to-pdf .output-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-image-to-pdf .output-mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 14px;
    background: var(--bg-panel, #fff);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.page-image-to-pdf .output-mode-option:hover {
    border-color: #93c5fd;
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.page-image-to-pdf .output-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.page-image-to-pdf .output-mode-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    flex: 1;
    padding-left: 26px;
    position: relative;
}

.page-image-to-pdf .output-mode-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: var(--bg-panel, #fff);
    transition: all 0.2s;
}

.page-image-to-pdf .output-mode-content::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    transition: transform 0.2s;
}

.page-image-to-pdf .output-mode-option input[type="radio"]:checked + .output-mode-content::before {
    border-color: #2563eb;
    background: var(--bg-panel, #fff);
}

.page-image-to-pdf .output-mode-option input[type="radio"]:checked + .output-mode-content::after {
    transform: translateY(-50%) scale(1);
}

.page-image-to-pdf .output-mode-option:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.page-image-to-pdf .output-mode-option:has(input[type="radio"]:checked) .output-mode-content {
    color: var(--accent, #2563eb);
}

.page-image-to-pdf .output-mode-content svg {
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
    transition: color 0.2s;
}

.page-image-to-pdf .output-mode-option:has(input[type="radio"]:checked) .output-mode-content svg {
    color: var(--accent, #2563eb);
}

.page-image-to-pdf .output-mode-content > span {
    flex: 1;
    line-height: 1.4;
}

.page-image-to-pdf .output-mode-hint {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
    line-height: 1.4;
}

/* =========================================================
   5. IMAGE QUALITY SLIDER
   ========================================================= */
.page-image-to-pdf .quality-group {
    background: var(--bg-subtle, #f8fafc);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    margin-top: 18px;
    position: relative;
    overflow: hidden;
}

.page-image-to-pdf .quality-group > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #1e293b);
    margin-bottom: 12px;
}

.page-image-to-pdf .quality-group > label strong {
    color: var(--accent, #2563eb);
    font-weight: 700;
    font-size: 1rem;
    margin-left: 4px;
}

.page-image-to-pdf #qualitySlider {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #ef4444 0%, #f59e0b 33%, #10b981 66%, #059669 100%);
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-image-to-pdf #qualitySlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-panel, #fff);
    border: 3px solid #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35), 0 0 0 4px rgba(37, 99, 235, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-image-to-pdf #qualitySlider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5), 0 0 0 6px rgba(37, 99, 235, 0.15);
}

.page-image-to-pdf #qualitySlider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-panel, #fff);
    border: 3px solid #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Quality Presets */
.page-image-to-pdf .quality-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.page-image-to-pdf .quality-preset {
    position: relative;
    padding: 12px 6px 10px;
    background: var(--bg-panel, #fff);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    overflow: hidden;
    letter-spacing: 0.01em;
    text-align: center;
}

.page-image-to-pdf .quality-preset::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #d1d5db;
    transition: all 0.25s;
    z-index: 2;
}

.page-image-to-pdf .quality-preset::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    z-index: 1;
}

.page-image-to-pdf .quality-preset svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: transform 0.25s;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}

.page-image-to-pdf .quality-preset span {
    position: relative;
    z-index: 3;
    font-weight: 700;
}

.page-image-to-pdf .quality-preset[data-quality="100"]::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.page-image-to-pdf .quality-preset[data-quality="85"]::before  { background: linear-gradient(90deg, #10b981, #14b8a6); }
.page-image-to-pdf .quality-preset[data-quality="70"]::before  { background: linear-gradient(90deg, #f59e0b, #eab308); }
.page-image-to-pdf .quality-preset[data-quality="50"]::before  { background: linear-gradient(90deg, #3b82f6, #6366f1); }

.page-image-to-pdf .quality-preset:hover {
    border-color: #93c5fd;
    color: var(--accent, #2563eb);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.page-image-to-pdf .quality-preset:hover::after {
    opacity: 1;
}

.page-image-to-pdf .quality-preset:hover svg {
    transform: scale(1.15);
}

.page-image-to-pdf .quality-preset.active {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35), 0 2px 6px rgba(124, 58, 237, 0.25);
    transform: translateY(-2px) scale(1.02);
}

.page-image-to-pdf .quality-preset.active::before {
    background: rgba(255, 255, 255, 0.4);
    height: 4px;
}

.page-image-to-pdf .quality-preset.active::after {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15), transparent 70%);
    opacity: 1;
}

.page-image-to-pdf .quality-preset.active:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
}

.page-image-to-pdf .quality-preset.active svg {
    color: #fff;
    transform: scale(1.1);
}

/* Estimate Display */
.page-image-to-pdf .quality-estimate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--accent, #2563eb);
    font-weight: 600;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.page-image-to-pdf .quality-estimate svg {
    flex-shrink: 0;
    color: var(--accent, #2563eb);
}

.page-image-to-pdf .quality-hint {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    margin: 0;
    font-style: italic;
    text-align: center;
}

/* =========================================================
   6. CONTROL GROUPS & SELECT BOXES
   ========================================================= */
.page-image-to-pdf .control-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-image-to-pdf .control-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main, #1e293b);
}

.page-image-to-pdf .control-group select {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-main, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    color: var(--text-main, #1e293b);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.page-image-to-pdf .control-group select:hover {
    border-color: #93c5fd;
    background-color: var(--bg-panel, #fff);
}

.page-image-to-pdf .control-group select:focus {
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(37, 99, 235, 0.06));
    background-color: var(--bg-panel, #fff);
}

html.dark .page-image-to-pdf .control-group select,
html[data-theme="dark"] .page-image-to-pdf .control-group select {
    background-color: #131c2e;
    border-color: #3d4b62;
    color: #f1f5f9;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* =========================================================
   7. HOVER PREVIEW MODAL
   ========================================================= */
.page-image-to-pdf .global-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.page-image-to-pdf .global-preview-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.page-image-to-pdf .global-preview-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 4px solid #fff;
    background: #fff;
    animation: zoomInModal 0.25s ease-out;
    cursor: default;
    pointer-events: auto;
}

@keyframes zoomInModal {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* =========================================================
   8. HERO AD WRAPPER
   ========================================================= */
.page-image-to-pdf .hero-ad-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    min-height: 90px;
    max-width: 970px;
    padding: 0;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
}

.page-image-to-pdf .hero-ad-wrapper ins,
.page-image-to-pdf .hero-ad-wrapper ins.adsbygoogle {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 90px;
    background: transparent !important;
    border: none;
    text-align: center;
}

/* =========================================================
   9. HERO TITLE (H1)
   ========================================================= */
.page-image-to-pdf .hero-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-main, #1e293b);
    text-align: center;
    word-break: break-word;
}

/* =========================================================
   10. HERO SECTION SPACING
   ========================================================= */
.page-image-to-pdf .hero-section {
    padding: 2rem 1rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

html.dark .page-image-to-pdf .hero-ad-wrapper {
    background: #1e293b;
    border-color: #334155;
}

/* =========================================================
   11. CONTENT SECTIONS
   ========================================================= */
.page-image-to-pdf .content-section {
    margin-bottom: 3.5rem;
    margin-top: 2rem;
}

.page-image-to-pdf .content-section h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--text-main, #1e293b);
}

.page-image-to-pdf .steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.page-image-to-pdf .step {
    background: var(--bg-panel, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 1.5rem;
    border-radius: 14px;
    transition: all 0.15s;
}

.page-image-to-pdf .step:hover {
    transform: translateY(-2px);
    border-color: var(--accent, #2563eb);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.page-image-to-pdf .step span {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent, #2563eb);
    opacity: 0.15;
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.page-image-to-pdf .step h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main, #1e293b);
}

.page-image-to-pdf .step p {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}

.page-image-to-pdf .faq-list details {
    background: var(--bg-panel, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 1rem;
    transition: border-color 0.15s;
}

.page-image-to-pdf .faq-list details[open] {
    border-color: var(--accent, #2563eb);
}

.page-image-to-pdf .faq-list summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main, #1e293b);
}

.page-image-to-pdf .faq-list summary::-webkit-details-marker {
    display: none;
}

.page-image-to-pdf .faq-list summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--accent, #2563eb);
    font-weight: 400;
}

.page-image-to-pdf .faq-list details[open] summary::after {
    content: '−';
}

.page-image-to-pdf .faq-list p {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
}

/* =========================================================
   12. HERO BADGES
   ========================================================= */
.page-image-to-pdf .hero-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.6rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 2rem !important;
    width: 100%;
}

.page-image-to-pdf .privacy-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    font-size: 0.82rem !important;
    color: var(--text-muted, #64748b) !important;
    background: var(--bg-panel, #fff) !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    padding: 0.45rem 1rem !important;
    border-radius: 20px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    transition: all 0.2s ease;
    line-height: 1.2 !important;
}

.page-image-to-pdf .privacy-badge:hover {
    border-color: var(--accent, #2563eb) !important;
    color: var(--accent, #2563eb) !important;
    background: rgba(37, 99, 235, 0.05) !important;
    transform: translateY(-1px);
}

.page-image-to-pdf .privacy-badge svg {
    flex-shrink: 0 !important;
    color: var(--accent, #2563eb) !important;
    width: 14px !important;
    height: 14px !important;
    display: block !important;
}

html.dark .page-image-to-pdf .privacy-badge {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

/* =========================================================
   13. RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .page-image-to-pdf .hero-ad-wrapper {
        min-height: 60px;
        max-width: 100%;
        margin: 0 auto 1.5rem;
        border-radius: 10px;
    }
    .page-image-to-pdf .hero-ad-wrapper ins,
    .page-image-to-pdf .hero-ad-wrapper ins.adsbygoogle {
        min-height: 60px;
    }
    .page-image-to-pdf .hero-subtitle {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .page-image-to-pdf .itp-upload-panel .panel,
    .page-image-to-pdf .itp-info-panel .panel {
        padding: 16px;
    }
    .page-image-to-pdf .multi-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .page-image-to-pdf .quality-presets {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .page-image-to-pdf .quality-preset {
        padding: 10px 6px 8px;
        font-size: 0.72rem;
    }
    .page-image-to-pdf .quality-preset svg {
        width: 16px;
        height: 16px;
    }
    .page-image-to-pdf .output-mode-content {
        font-size: 0.82rem;
    }
    .page-image-to-pdf .output-mode-content svg {
        width: 16px;
        height: 16px;
    }
    .page-image-to-pdf .privacy-badge {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.8rem !important;
    }
}

/* =========================================================
   14. 3-in-1 SETTINGS ROW (Spacious Fix)
   ========================================================= */
.page-image-to-pdf .settings-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.page-image-to-pdf .settings-row .control-group {
    margin-bottom: 0;
    gap: 6px;
}

.page-image-to-pdf .settings-row .control-group label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-image-to-pdf .settings-row .control-group select {
    padding: 12px 30px 12px 14px;
    font-size: 0.88rem;
    background-position: right 10px center;
    background-size: 14px;
    height: auto;
    min-height: 44px;
}

@media (max-width: 600px) {
    .page-image-to-pdf .settings-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* =========================================================
   15. SETTINGS HINT
   ========================================================= */
.page-image-to-pdf .settings-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--accent, #2563eb);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    line-height: 1.4;
    font-style: italic;
}

.page-image-to-pdf .settings-hint svg {
    color: var(--accent, #2563eb);
    margin-top: 2px;
}

html.dark .page-image-to-pdf .settings-hint {
    background: rgba(96, 165, 250, 0.1);
    color: #94a3b8;
}

/* =========================================================
   16. PREVIEW HINT
   ========================================================= */
.page-image-to-pdf .preview-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    background: var(--bg-main, #f8fafc);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px dashed var(--border-color, #e2e8f0);
    margin-top: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

.page-image-to-pdf .preview-hint svg {
    flex-shrink: 0;
    color: var(--accent, #2563eb);
}

html.dark .page-image-to-pdf .preview-hint {
    background: #131c2e;
    border-color: #3d4b62;
}

/* =========================================================
   17. REORDER BUTTONS (Left/Right Arrows)
   ========================================================= */
.page-image-to-pdf .multi-preview-item .reorder-btns {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 5;
}

.page-image-to-pdf .multi-preview-item:hover .reorder-btns {
    opacity: 1;
    pointer-events: auto;
}

.page-image-to-pdf .multi-preview-item .move-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-main, #1e293b);
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.page-image-to-pdf .multi-preview-item .move-btn:hover {
    background: var(--accent, #2563eb);
    color: #fff;
    border-color: var(--accent, #2563eb);
}

@media (max-width: 768px) {
    .page-image-to-pdf .multi-preview-item .reorder-btns {
        opacity: 1;
        pointer-events: auto;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}