.jpg2png-pro {
    --j2p-primary: #2563eb;
    --j2p-primary-dark: #1d4ed8;
    --j2p-bg: #f8fafc;
    --j2p-border: #e2e8f0;
    --j2p-text: #0f172a;
    --j2p-muted: #64748b;
    --j2p-success: #16a34a;
    --j2p-error: #dc2626;
    --j2p-radius-lg: 18px;
    --j2p-radius-md: 12px;
    --j2p-radius-sm: 8px;

    max-width: 1100px;
    margin: 40px auto;
    padding: 28px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--j2p-text);
    box-sizing: border-box;
}
.jpg2png-pro *, .jpg2png-pro *::before, .jpg2png-pro *::after { box-sizing: inherit; }

/* Corner-style variants, controlled from the admin dashboard */
.jpg2png-pro.corner-square { --j2p-radius-lg: 4px; --j2p-radius-md: 4px; --j2p-radius-sm: 3px; }
.jpg2png-pro.corner-soft   { --j2p-radius-lg: 12px; --j2p-radius-md: 8px; --j2p-radius-sm: 6px; }
.jpg2png-pro.corner-rounded { --j2p-radius-lg: 18px; --j2p-radius-md: 12px; --j2p-radius-sm: 8px; }

.jpg2png-head { text-align: center; margin-bottom: 30px; }
.jpg2png-head h1 {
    font-size: 2.15rem;
    margin: 0 0 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--j2p-text) 0%, var(--j2p-primary) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.jpg2png-head .subtitle { color: var(--j2p-muted); font-size: 1.05rem; margin: 0; line-height: 1.5; }

/* Drop zone */
.drop-zone {
    border: 2px dashed #c7d7ea;
    border-radius: var(--j2p-radius-lg);
    padding: 58px 24px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, var(--j2p-bg) 100%);
    transition: border-color .2s ease, background .2s ease, transform .15s ease, box-shadow .2s ease;
    outline: none;
    position: relative;
}
.drop-zone:hover { border-color: var(--j2p-primary); box-shadow: 0 6px 24px rgba(37, 99, 235, .08); }
.drop-zone:focus-visible { border-color: var(--j2p-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.drop-zone.dragover {
    background: color-mix(in srgb, var(--j2p-primary) 6%, white);
    border-color: var(--j2p-primary);
    border-style: solid;
    transform: scale(1.006);
}

.drop-content .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--j2p-primary) 10%, white);
    color: var(--j2p-primary);
    margin-bottom: 16px;
}
.drop-content h3 { font-size: 1.32rem; margin: 0 0 6px; font-weight: 700; }
.drop-content .drop-sub { color: var(--j2p-muted); margin: 8px 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.drop-content .drop-hint { color: var(--j2p-muted); font-size: .85rem; margin: 16px 0 0; }

.browse-btn {
    background: var(--j2p-primary);
    color: #fff;
    padding: 13px 34px;
    border: none;
    border-radius: var(--j2p-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.browse-btn:hover { background: var(--j2p-primary-dark); box-shadow: 0 4px 14px rgba(37, 99, 235, .32); }
.browse-btn:active { transform: scale(0.98); }

/* Status messages */
.status { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.status-msg {
    padding: 11px 16px;
    border-radius: var(--j2p-radius-sm);
    font-size: .92rem;
}
.status-msg.status-error { background: #fef2f2; color: var(--j2p-error); border: 1px solid #fecaca; }
.status-msg.status-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--j2p-border);
    border-radius: var(--j2p-radius-md);
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.toolbar-info { font-weight: 600; color: var(--j2p-muted); font-size: .92rem; }
.toolbar-actions { display: flex; gap: 10px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    border-radius: var(--j2p-radius-sm);
    padding: 10px 18px;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease, transform .1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-icon { flex-shrink: 0; }
.btn-primary { background: var(--j2p-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--j2p-primary-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--j2p-error); border: 1px solid #fecaca; }
.btn-ghost:hover { background: #fef2f2; }

/* Results grid */
.results {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.result-card {
    background: #fff;
    border: 1px solid var(--j2p-border);
    border-radius: var(--j2p-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    transition: box-shadow .2s ease, transform .2s ease;
    animation: j2p-card-in .25s ease;
}
@keyframes j2p-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-card:hover { box-shadow: 0 8px 20px rgba(16, 24, 40, .09); transform: translateY(-2px); }

.thumb-wrap { position: relative; aspect-ratio: 4 / 3; background: #f1f5f9; }
.thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

.progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-mask: radial-gradient(circle 20px at center, transparent 98%, #000 100%);
            mask: radial-gradient(circle 20px at center, transparent 98%, #000 100%);
}
.spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    animation: j2p-spin 0.8s linear infinite;
}
@keyframes j2p-spin { to { transform: rotate(360deg); } }

.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; }
.file-name {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-status { margin: 0; font-size: .8rem; color: var(--j2p-muted); }
.result-card[data-status="done"] .file-status { color: var(--j2p-success); font-weight: 600; }
.result-card[data-status="error"] .file-status { color: var(--j2p-error); font-weight: 600; }

.card-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.download-link {
    background: var(--j2p-success);
    color: #fff;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 700;
    padding: 9px 12px;
    border-radius: var(--j2p-radius-sm);
    flex: 1;
    text-align: center;
    transition: background .15s ease, transform .1s ease;
}
.download-link:hover { filter: brightness(0.92); }
.download-link:active { transform: scale(0.98); }

.remove-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: var(--j2p-radius-sm);
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}
.remove-btn:hover { background: #fee2e2; color: var(--j2p-error); }

/* Footer credit */
.jpg2png-credit {
    text-align: center;
    margin: 30px 0 0;
    font-size: .78rem;
    color: var(--j2p-muted);
    opacity: .8;
}

/* Responsive */
@media (max-width: 560px) {
    .jpg2png-pro { padding: 16px; margin: 20px auto; }
    .jpg2png-head h1 { font-size: 1.6rem; }
    .drop-zone { padding: 38px 16px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-actions { justify-content: stretch; }
    .toolbar-actions .btn { flex: 1; justify-content: center; }
}
