/* PDF to JPG Specific UI */

.hidden { display: none !important; }

.pj-workspace {
    max-width: 900px !important;
}

.pj-input-section { margin-bottom: 30px; }

/* Workspace Panel */
.pj-workspace-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow);
    animation: fadeIn 0.4s ease;
    position: relative;
    overflow: hidden;
}

.pj-file-info-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.pj-file-icon {
    font-size: 2.5rem;
    color: #ef4444;
    margin-right: 20px;
}

.pj-file-details {
    flex-grow: 1;
    overflow: hidden;
}

.pj-file-details h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.pj-file-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pj-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Processing Overlay */
.pj-processing-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] .pj-processing-overlay { background: rgba(15, 23, 42, 0.9); }

.pj-loader {
    width: 50px; height: 50px;
    border: 4px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px;
}
.pj-processing-overlay p { font-weight: 700; color: var(--primary); margin-bottom: 15px; font-size: 1.1rem; }

.pj-progress-bar-wrapper { width: 80%; max-width: 300px; height: 8px; background: var(--bg-input); border-radius: 10px; overflow: hidden; }
.pj-progress-bar { height: 100%; width: 0%; background: var(--primary); border-radius: 10px; transition: 0.2s; }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Result Panel & Gallery */
.pj-result-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow);
    animation: fadeIn 0.4s ease;
}

.pj-result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.pj-result-header h3 {
    font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-bottom: 20px;
}
.text-success { color: var(--success); }

.pj-action-row {
    display: flex; justify-content: center; gap: 15px;
}
.pj-btn-success { background: var(--success) !important; }

/* Dynamic Image Grid */
.pj-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.pj-img-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.pj-img-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: white;
    display: block;
    border-bottom: 1px solid var(--border);
}

.pj-img-card-footer {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pj-page-lbl { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.pj-dl-btn {
    width: 35px; height: 35px; border-radius: 8px; background: rgba(37, 99, 235, 0.1);
    color: var(--primary); border: none; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s;
}
.pj-dl-btn:hover { background: var(--primary); color: white; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .pj-settings-grid { grid-template-columns: 1fr; }
    .pj-action-row { flex-direction: column; }
    .pj-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .pj-img-card img { height: 180px; }
}
