/* upscale-image.php: builds on css/theme.css (.sv-hero, .sr-card, .sv-steps, .sv-faq). */
.up-page { --up-line: var(--sv-line, #e4e9f2); }

/* Hero: text on the left, a before/after slider on the right. */
.up-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 34px; align-items: center; }
.up-hero h1 { max-width: 560px; }
.up-hero .sv-stats { margin-top: 26px; }
@media (max-width: 991px) { .up-hero { grid-template-columns: minmax(0, 1fr); } }

/* Before/after slider: the "after" picture is the frame, the "before" layer is clipped
   to the slider value (--pos), the range input covers it all for mouse, touch and keys. */
.up-compare { --pos: 50%; position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: #0b1020;
    aspect-ratio: 1 / 1; box-shadow: 0 30px 70px rgba(5, 10, 40, .45); border: 1px solid rgba(255, 255, 255, .18); user-select: none; touch-action: pan-y; }
.up-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.up-compare .up-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.up-compare .up-before img { image-rendering: auto; }
.up-compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 4; }
.up-compare::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .45); z-index: 2; pointer-events: none; }
.up-handle { position: absolute; top: 50%; left: var(--pos); width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: #fff; color: var(--sv-primary, #2f5bff);
    display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); z-index: 3; pointer-events: none; font-size: 18px; }
.up-compare input[type=range]:focus-visible ~ .up-handle { outline: 3px solid #ffd666; outline-offset: 2px; }
.up-tag { position: absolute; top: 12px; z-index: 3; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(10, 15, 35, .62);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
.up-tag-l { left: 12px; }
.up-tag-r { right: 12px; background: rgba(47, 91, 255, .85); }

/* Tool */
.up-signin { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px; border-radius: 18px; background: #f5f8ff; border: 1px dashed #c9d5ff; }
.up-signin > .fa { font-size: 34px; color: var(--sv-primary, #2f5bff); }
.up-signin div { flex: 1 1 260px; display: flex; flex-direction: column; }
.up-signin div span { color: var(--sv-muted, #556179); }
.up-signin .btn { border-radius: 12px; font-weight: 700; }

.up-scale { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.up-scale label { margin: 0 !important; cursor: pointer; }
.up-scale input { position: absolute; opacity: 0; pointer-events: none; }
.up-scale span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px 16px 14px 48px; position: relative; border: 2px solid var(--up-line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.up-scale span::before { content: ""; position: absolute; left: 16px; top: 17px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b7c3dc; background: #fff; }
.up-scale b { font-size: 20px; font-weight: 800; color: var(--sv-ink, #0f172a); line-height: 1.1; }
.up-scale small { color: var(--sv-muted, #556179); font-weight: 400; font-size: 13px; }
.up-scale input:checked + span { border-color: var(--sv-primary, #2f5bff); box-shadow: 0 10px 26px rgba(47, 91, 255, .14); background: #f7f9ff; }
.up-scale input:checked + span::before { border: 6px solid var(--sv-primary, #2f5bff); }
.up-scale input:focus-visible + span { outline: 3px solid #c9d5ff; outline-offset: 2px; }

.up-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 20px; margin: 0 !important; border: 2px dashed #c3cff5; border-radius: 18px;
    background: linear-gradient(180deg, #fbfcff, #f3f6ff); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.up-drop:hover, .up-drop.over { border-color: var(--sv-primary, #2f5bff); background: #eef2ff; }
.up-drop.over { transform: scale(1.01); }
.up-drop-ico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; color: #fff; margin-bottom: 6px;
    background: linear-gradient(135deg, var(--sv-primary, #2f5bff), #6a8bff); box-shadow: 0 12px 26px rgba(47, 91, 255, .3); }
.up-drop b { font-size: 17px; color: var(--sv-ink, #0f172a); }
.up-drop u { color: var(--sv-primary, #2f5bff); text-decoration: none; border-bottom: 2px solid currentColor; }
.up-drop small { color: var(--sv-muted, #556179); font-weight: 400; font-size: 13.5px; }
.up-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; margin: 14px 0 0; color: var(--sv-muted, #556179); font-size: 14px; }
.up-meta .fa { color: var(--sv-primary, #2f5bff); margin-right: 4px; }

/* One card per picture */
.up-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.up-results:empty { display: none; }
.up-item { border: 1px solid var(--up-line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 10px 26px rgba(15, 23, 42, .06); display: flex; flex-direction: column; }
.up-item .up-compare { border-radius: 0; border: 0; box-shadow: none; aspect-ratio: 4 / 3; background: #eef1f7 repeating-conic-gradient(#e6eaf2 0 25%, #f4f6fa 0 50%) 0 0 / 18px 18px; }
.up-item .up-compare.single input, .up-item .up-compare.single::after, .up-item .up-compare.single .up-handle, .up-item .up-compare.single .up-tag-r { display: none; }
.up-item-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.up-name { font-weight: 700; font-size: 14px; color: var(--sv-ink, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-status { font-size: 13px; color: var(--sv-muted, #556179); min-height: 19px; }
.up-status.bad { color: #b42318; }
.up-status.good { color: #0f9f6e; font-weight: 600; }
.up-bar { height: 6px; border-radius: 999px; background: #eef2ff; overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sv-primary, #2f5bff), #6a8bff); transition: width .3s ease; }
.up-bar.busy i { width: 40% !important; animation: upSlide 1.3s ease-in-out infinite; }
@keyframes upSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.up-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.up-actions .btn { border-radius: 10px; font-weight: 700; font-size: 14px; }
.up-actions .btn-success { background: #12b886; border-color: #12b886; }

/* Recent results */
.up-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.up-thumb { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--up-line); background: #eef1f7; }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-thumb span { position: absolute; inset: auto 0 0 0; padding: 6px; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(10, 15, 35, .75)); text-align: center; opacity: 0; transition: opacity .15s; }
.up-thumb:hover span, .up-thumb:focus span { opacity: 1; }

@media (max-width: 767px) {
    body.up-page { width: auto !important; padding-left: 16px; padding-right: 16px; }
    .up-scale { grid-template-columns: minmax(0, 1fr); }
    .up-uses { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .up-bar.busy i { animation: none; width: 100% !important; opacity: .5; } .up-drop.over { transform: none; } }

/* Hero showcase: example chips under the slider */
.up-showcase { display: flex; flex-direction: column; gap: 12px; }
.up-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.up-chips button { border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.up-chips button:hover { background: rgba(255, 255, 255, .16); }
.up-chips button.active { background: #fff; color: var(--sv-primary-dark, #1f44d6); border-color: #fff; }
.up-chips button .fa { margin-right: 4px; }
.up-chips span { margin-left: auto; color: #b9c6ff; font-size: 12.5px; }
.up-compare img { transition: opacity .25s ease; }

/* Promise row under the tool */
.up-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 16px 0 0; margin: 18px 0 0; border-top: 1px solid var(--up-line); color: #2b3650; font-size: 14px; font-weight: 600; }
.up-trust .fa { color: var(--sv-success, #12b886); margin-right: 6px; }
