/* ==========================================================================
   UXCAMP VIETNAM — WEBP COMPRESSOR (Apex Design System Edition)
   100% Tuân thủ Hệ Thống Biến & Tokens từ style/definition.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. THEME VARIABLES & BRIDGES
   -------------------------------------------------------------------------- */
:root {
  /* Surface Tokens bridging to definition.css */
  --comp-bg-body: var(--body-background, #F9F6F1);
  --comp-surface-1: var(--body-background-elevate-1, #FCFAF8);
  --comp-surface-2: var(--body-background-elevate-2, #ffffff);
  --comp-surface-sunken: var(--saved-tab-item-background, #F8F5F0);
  --comp-surface-hover: var(--saved-tab-item-background-hover, #FCFCFB);

  /* Typography Colors */
  --comp-text-primary: var(--main-colors-foreground-f100, #000000);
  --comp-text-body: var(--main-colors-foreground-f-500-main, #373D48);
  --comp-text-muted: var(--main-colors-foreground-f700, #706e6f);

  /* Borders & Accents */
  --comp-stroke: var(--console-stroke, rgb(200, 200, 200));
  --comp-stroke-subtle: var(--transparent-foreground-main-color-10, rgba(55, 61, 72, 0.1));
  --comp-stroke-medium: var(--transparent-foreground-main-color-40, rgba(55, 61, 72, 0.4));

  /* Brand Accents */
  --comp-gold: var(--button-background, #b4935e);
  --comp-gold-hover: var(--button-background-hover, #c9b386);
  --comp-gold-subtle: rgba(180, 147, 94, 0.12);
  --comp-gold-border: rgba(180, 147, 94, 0.35);

  --comp-green: var(--highlight-green, #01b313);
  --comp-green-subtle: rgba(1, 179, 19, 0.12);
  --comp-green-border: rgba(1, 179, 19, 0.35);

  --comp-red: var(--highlight-red, #e62e2e);
  --comp-red-subtle: rgba(230, 46, 46, 0.12);

  --comp-blue: var(--highlight-blue, #1c70ee);

  /* Radius & Shadows */
  --comp-radius-sm: var(--radius-sm, 4px);
  --comp-radius-md: var(--radius-md, 8px);
  --comp-radius-lg: var(--radius-lg, 12px);
  --comp-radius-xl: var(--radius-xl, 16px);
  --comp-radius-card: 20px;
  --comp-radius-pill: 9999px;

  --comp-shadow-card: none;
  --comp-shadow-raised: none;
  --comp-shadow-modal: none;

  /* Font Families */
  --comp-font-serif: var(--font-serif-family, "Crimson Pro", serif);
  --comp-font-sans: var(--font-sans-family, "Work Sans", sans-serif);
  --comp-font-mono: var(--font-mono, 'Chivo Mono', monospace);

  /* Backward Compatibility Aliases for script.js */
  --color-primary: var(--comp-gold);
  --color-success: var(--comp-green);
  --color-error: var(--comp-red);
  --font-mono: var(--comp-font-mono);
}

/* Explicit Dark Mode Overrides (via data-theme="dark" or system preference) */
[data-theme="dark"],
html[data-theme="dark"] {
  --comp-bg-body: var(--body-background, #000000);
  --comp-surface-1: var(--body-background-elevate-1, #0D0D0D);
  --comp-surface-2: var(--body-background-elevate-2, #1A1A1A);
  --comp-surface-sunken: var(--saved-tab-item-background, #1A1A1A);
  --comp-surface-hover: var(--saved-tab-item-background-hover, #292929);

  --comp-text-primary: var(--main-colors-foreground-f100, #ffffff);
  --comp-text-body: var(--main-colors-foreground-f-500-main, #c9c4ca);
  --comp-text-muted: var(--main-colors-foreground-f700, #85808e);

  --comp-stroke: var(--console-stroke, hsl(0, 0%, 24%));
  --comp-stroke-subtle: var(--transparent-foreground-main-color-10, rgba(201, 196, 202, 0.1));
  --comp-stroke-medium: var(--transparent-foreground-main-color-40, rgba(201, 196, 202, 0.4));

  --comp-green: var(--highlight-green, #50C633);
  --comp-green-subtle: rgba(80, 198, 51, 0.15);
  --comp-green-border: rgba(80, 198, 51, 0.35);

  --comp-shadow-card: none;
  --comp-shadow-raised: none;
  --comp-shadow-modal: none;

  --color-primary: var(--comp-gold);
  --color-success: var(--comp-green);
  --color-error: var(--comp-red);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --comp-bg-body: var(--body-background, #000000);
    --comp-surface-1: var(--body-body-background-elevate-1, #0D0D0D);
    --comp-surface-2: var(--body-background-elevate-2, #1A1A1A);
    --comp-surface-sunken: var(--saved-tab-item-background, #1A1A1A);
    --comp-surface-hover: var(--saved-tab-item-background-hover, #292929);

    --comp-text-primary: var(--main-colors-foreground-f100, #ffffff);
    --comp-text-body: var(--main-colors-foreground-f-500-main, #c9c4ca);
    --comp-text-muted: var(--main-colors-foreground-f700, #85808e);

    --comp-stroke: var(--console-stroke, hsl(0, 0%, 24%));
    --comp-stroke-subtle: var(--transparent-foreground-main-color-10, rgba(201, 196, 202, 0.1));
    --comp-stroke-medium: var(--transparent-foreground-main-color-40, rgba(201, 196, 202, 0.4));

    --comp-green: var(--highlight-green, #50C633);
    --comp-green-subtle: rgba(80, 198, 51, 0.15);
    --comp-green-border: rgba(80, 198, 51, 0.35);

    --comp-shadow-card: none;
    --comp-shadow-raised: none;
    --comp-shadow-modal: none;

    --color-primary: var(--comp-gold);
    --color-success: var(--comp-green);
    --color-error: var(--comp-red);
  }
}

/* --------------------------------------------------------------------------
   2. BASE LAYOUT & WRAPPER
   -------------------------------------------------------------------------- */
body {
  margin: 0;
  padding: 0;
  background-color: var(--comp-bg-body);
  color: var(--comp-text-body);
  font-family: var(--comp-font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-fast, 0.2s ease), color var(--transition-fast, 0.2s ease);
}

.webp-tool-page {
  min-height: calc(100vh - 40px);
  padding: 56px 0px 32px;
  box-sizing: border-box;
}

.webp-tool-container {
  max-width: 1080px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   3. SUBNAV / UTILITY BAR
   -------------------------------------------------------------------------- */
.tool-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 16px;
  border-bottom: 0.5px solid var(--comp-stroke);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tool-subnav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-family: var(--comp-font-sans);
  color: var(--comp-text-muted);
}

.tool-breadcrumb a {
  color: var(--comp-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast, 0.15s ease);
}

.tool-breadcrumb a:hover {
  color: var(--comp-text-primary);
}

.tool-breadcrumb-sep {
  opacity: 0.5;
}

.tool-breadcrumb-current {
  color: var(--comp-text-primary);
  font-weight: 500;
}

.tool-subnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-engine-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--comp-radius-pill);
  background: var(--comp-surface-1);
  border: 0.5px solid var(--comp-stroke);
  font-family: var(--comp-font-mono);
  font-size: 12px;
  color: var(--comp-text-body);
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--comp-green);
  flex-shrink: 0;
  animation: pulseAnimation 2s infinite ease-in-out;
}

@keyframes pulseAnimation {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--comp-radius-md);
  border: 0.5px solid var(--comp-stroke);
  background: var(--comp-surface-1);
  color: var(--comp-text-body);
  cursor: pointer;
  transition: background-color var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}

.theme-toggle-btn:hover {
  background: var(--comp-surface-2);
  color: var(--comp-text-primary);
  border-color: var(--comp-stroke-medium);
}

/* --------------------------------------------------------------------------
   4. HERO HEADER
   -------------------------------------------------------------------------- */
.tool-hero {
  text-align: center;
  margin-bottom: 16px;
}

.tool-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--comp-font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--comp-gold);
  background: var(--comp-gold-subtle);
  border: 0.5px solid var(--comp-gold-border);
  padding: 2px 10px;
  border-radius: var(--comp-radius-pill);
  margin-bottom: 8px;
}

.tool-hero-title {
  margin: 0 0 6px;
}

.tool-hero-desc {
  max-width: 680px;
  margin: 0 auto 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--comp-text-body);
}

.feature-pill-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.feature-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 14px;
  color: var(--comp-text-primary);
  border: 0.5px solid var(--comp-text-primary);
  border-radius: var(--comp-radius-pill);
  font-size: 11px;
  font-family: var(--comp-font-mono);
}

/* --------------------------------------------------------------------------
   5. DROPZONE (Apex File Upload Pattern)
   -------------------------------------------------------------------------- */
.dropzone-wrapper {
  margin-bottom: 16px;
}

.dropzone-box {
  background-color: var(--alternative-background-light-gold);
  border: 1.5px dashed var(--comp-stroke);
  border-radius: var(--comp-radius-card);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.dropzone-box:hover,
.dropzone-box.is-dragging {
  border-color: var(--comp-gold);
  background-color: var(--comp-surface-2);
  transform: translateY(-2px);
}

.dropzone-title {
  font-family: var(--comp-font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--comp-text-primary);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 13px;
  color: var(--comp-text-muted);
  margin-bottom: 12px;
}

.dropzone-hint strong {
  color: var(--comp-text-primary);
  font-weight: 500 !important;
}

.dropzone-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dropzone-actions .cta-large {
  height: 38px;
  padding: 6px 18px;
  font-size: 13.5px;
}

.supported-formats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.format-pill {
  font-family: var(--comp-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--comp-radius-sm);
  background: var(--comp-surface-sunken);
  color: var(--comp-text-muted);
  border: 0.5px solid var(--comp-stroke);
}

/* --------------------------------------------------------------------------
   6. CONTROLS CARD (Sliders & Configuration)
   -------------------------------------------------------------------------- */
.card-container.controls-panel,
.card-container#controls-panel,
.controls-panel {
  background-color: var(--comp-surface-1);
  border: 0.5px solid var(--comp-stroke);
  border-radius: var(--comp-radius-card);
  padding: 14px 20px !important;
  margin-bottom: 64px;
  height: auto !important;
  gap: 0 !important;
}

.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--comp-stroke);
  flex-wrap: wrap;
  gap: 8px;
}

.controls-title {
  font-family: var(--comp-font-serif);
  font-size: 16px;
  font-weight: 400;
  color: var(--comp-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.controls-ratio-badge {
  font-size: 11px;
  font-family: var(--comp-font-mono);
  color: var(--comp-gold);
  background: var(--comp-gold-subtle);
  padding: 2px 8px;
  border-radius: var(--comp-radius-pill);
  border: 0.5px solid var(--comp-gold-border);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.controls-row {
  display: flex;
  align-items: flex-end;
  gap: 64px;
  flex-wrap: wrap;
}

.controls-row .slider-group {
  flex: 1 1 200px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
}

.slider-group-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--comp-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.slider-val-badge {
  padding: 1px 8px;
  border-radius: var(--comp-radius-pill);
  background: var(--comp-gold-subtle);
  color: var(--comp-gold);
  border: 0.5px solid var(--comp-gold-border);
  min-width: 28px;
  text-align: center;
  line-height: 18px;
}

/* Resize Cluster (Max W, Chain Link Icon, Max H) */
.resize-cluster {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1 1 auto;
}

.resize-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

.resize-field-group .slider-group-header {
  justify-content: flex-start;
}

.resize-input-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  background: var(--comp-surface-sunken);
  border: 0.5px solid var(--comp-stroke);
  border-radius: var(--comp-radius-md, 8px);
  padding: 0 8px;
  height: 28px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.resize-input-wrap:focus-within {
  border-color: var(--comp-gold);
  background-color: var(--comp-surface-2);
}

.resize-input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  font-size: 12px;
  color: var(--comp-text-primary);
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.resize-input::-webkit-outer-spin-button,
.resize-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.resize-input::placeholder {
  color: var(--comp-text-muted);
  opacity: 0.65;
}

.resize-unit {
  font-size: 11px;
  color: var(--comp-text-muted);
  margin-left: 2px;
  user-select: none;
}

.resize-link-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--comp-gold);
  height: 28px;
  padding: 0 2px;
  opacity: 0.85;
  user-select: none;
  flex: 0 0 auto;
}


/* --------------------------------------------------------------------------
   7. STATS BANNER
   -------------------------------------------------------------------------- */
.card-container.stats-banner-grid,
.stats-banner-grid {
  background-color: var(--comp-surface-1);
  border: 0.5px solid var(--comp-stroke);
  border-radius: var(--comp-radius-card);
  padding: 12px 18px !important;
  margin-bottom: 14px;
  height: auto !important;
  gap: 12px !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  transition: opacity 0.25s ease;
}

.stats-banner-grid.is-empty {
  opacity: 0.5;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-cell-label {
  font-size: 11px;
  font-family: var(--comp-font-sans);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--comp-text-muted);
}

.stat-cell-value {
  font-family: var(--comp-font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--comp-text-primary);
}

.stat-cell-value.is-savings {
  color: var(--comp-green);
}

.stat-cell-value.is-increase {
  color: #b91c1c;
}

[data-theme="dark"] .stat-cell-value.is-increase {
  color: #f87171;
}

/* --------------------------------------------------------------------------
   8. BATCH TOOLBAR
   -------------------------------------------------------------------------- */
.batch-toolbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
  flex-wrap: wrap;
}


.batch-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-toolbar-actions .cta-large,
.batch-toolbar-actions .secondary-button-large {
  height: 34px;
  padding: 4px 14px;
  font-size: 12.5px;
}

.batch-toolbar-actions svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.batch-toolbar-actions button:disabled,
.batch-toolbar-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
}


/* --------------------------------------------------------------------------
   9. JOB CARDS (Queue List)
   -------------------------------------------------------------------------- */
.jobs-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.card-container.job-card,
.job-card {
  background-color: var(--saved-tab-item-background, #F8F5F0);
  border: 0.5px solid var(--comp-stroke);
  border-radius: var(--comp-radius-md, 8px);
  padding: 8px 14px !important;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: auto !important;
  min-height: unset !important;
  box-sizing: border-box;
  transition: border-color var(--transition-fast, 0.2s ease), background-color var(--transition-fast, 0.2s ease);
}

.job-card:hover {
  border-color: var(--comp-stroke-medium);
}

/* Done states: Reduced size -> Nền xanh */
.job-card.is-reduced {
  background-color: rgba(34, 197, 94, 0.08) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  cursor: pointer;
}

.job-card.is-reduced:hover {
  background-color: rgba(34, 197, 94, 0.15) !important;
  border-color: var(--comp-green, #15803d) !important;
}

[data-theme="dark"] .job-card.is-reduced,
html[data-theme="dark"] .job-card.is-reduced {
  background-color: rgba(74, 222, 128, 0.12) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}

[data-theme="dark"] .job-card.is-reduced:hover,
html[data-theme="dark"] .job-card.is-reduced:hover {
  background-color: rgba(74, 222, 128, 0.2) !important;
  border-color: #4ade80 !important;
}

/* Done states: Increased or unchanged size -> Nền đỏ */
.job-card.is-increased {
  background-color: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  cursor: pointer;
}

.job-card.is-increased:hover {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: var(--comp-red, #dc2626) !important;
}

[data-theme="dark"] .job-card.is-increased,
html[data-theme="dark"] .job-card.is-increased {
  background-color: rgba(248, 113, 113, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

[data-theme="dark"] .job-card.is-increased:hover,
html[data-theme="dark"] .job-card.is-increased:hover {
  background-color: rgba(248, 113, 113, 0.2) !important;
  border-color: #f87171 !important;
}

.job-card.is-increased .job-size-comp {
  color: #b91c1c;
}

[data-theme="dark"] .job-card.is-increased .job-size-comp {
  color: #f87171;
}

.job-thumb-box {
  width: 38px;
  height: 38px;
  border-radius: var(--comp-radius-sm, 4px);
  background-color: var(--comp-surface-sunken);
  border: 0.5px solid var(--comp-stroke);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.job-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.job-card.is-done:hover .job-thumb-img {
  transform: scale(1.08);
}

.job-info-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 140px;
  overflow: hidden;
}

.job-name {
  font-family: var(--comp-font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--comp-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dim-tag {
  font-family: var(--comp-font-mono);
  font-size: 10.5px;
  background: var(--comp-surface-1);
  padding: 1px 6px;
  border-radius: var(--comp-radius-sm, 4px);
  border: 0.5px solid var(--comp-stroke);
  color: var(--comp-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.job-size-col {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--comp-font-mono);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.job-size-orig {
  color: var(--comp-text-muted);
}

.job-size-arrow {
  color: var(--comp-text-muted);
  font-size: 11px;
}

.job-size-comp {
  font-weight: 600;
  color: var(--comp-text-primary);
}

.job-status-col {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 70px;
}

.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--comp-font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--comp-radius-pill, 9999px);
  user-select: none;
}

/* Badge reduced (Green) */
.saved-badge.badge-reduced {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
  border: 0.5px solid rgba(34, 197, 94, 0.4);
}

[data-theme="dark"] .saved-badge.badge-reduced,
html[data-theme="dark"] .saved-badge.badge-reduced {
  background: rgba(74, 222, 128, 0.22);
  color: #4ade80;
  border: 0.5px solid rgba(74, 222, 128, 0.5);
}

/* Badge increased (Red) */
.saved-badge.badge-increased {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border: 0.5px solid rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .saved-badge.badge-increased,
html[data-theme="dark"] .saved-badge.badge-increased {
  background: rgba(248, 113, 113, 0.22);
  color: #f87171;
  border: 0.5px solid rgba(248, 113, 113, 0.5);
}

.job-status-text {
  font-family: var(--comp-font-mono);
  font-size: 12px;
  font-weight: 600;
}

.status-proc {
  color: var(--comp-gold);
}

.status-queued {
  color: var(--comp-text-muted);
}

.status-error {
  color: var(--comp-red);
}

.job-actions-col {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.job-actions-col .cta-small,
.job-actions-col .ghost-button-small {
  height: 28px;
  padding: 2px 10px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

/* --------------------------------------------------------------------------
   10. INTERACTIVE COMPARISON MODAL
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-box {
  background: var(--comp-surface-1);
  border: 0.5px solid var(--comp-stroke);
  border-radius: var(--comp-radius-card);
  width: 100%;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-head {
  padding: 12px 18px;
  border-bottom: 0.5px solid var(--comp-stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--comp-surface-1);
}

.modal-title-group h3 {
  font-family: var(--comp-font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--comp-text-primary);
  margin: 0;
}

.modal-meta-info {
  font-family: var(--comp-font-mono);
  font-size: 11px;
  color: var(--comp-text-muted);
  margin-top: 2px;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--comp-surface-sunken);
  padding: 2px 5px;
  border-radius: var(--comp-radius-md, 8px);
  border: 0.5px solid var(--comp-stroke);
}

.modal-zoom-group button {
  min-width: 26px;
  height: 26px;
  padding: 0 5px !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.zoom-level-text {
  font-family: var(--comp-font-mono);
  font-size: 11px;
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  color: var(--comp-text-primary);
  user-select: none;
}

.modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
}

.compare-wrap {
  position: relative;
  width: 100%;
  height: 85vh;
  background: #000000;
  border-radius: var(--comp-radius-lg);
  overflow: hidden;
  user-select: none;
  border: 0.5px solid var(--comp-stroke);
  cursor: ew-resize;
  touch-action: none;
}

.compare-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
}

.compare-tag {
  position: absolute;
  top: 12px;
  padding: 3px 8px;
  border-radius: var(--comp-radius-sm);
  font-size: 10.5px;
  font-family: var(--comp-font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
}

.tag-orig {
  left: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
}

.tag-webp {
  right: 12px;
  background: var(--comp-green);
  color: #ffffff;
}

.divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  z-index: 20;
}

.handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--comp-gold);
}

/* --------------------------------------------------------------------------
   11. TOOL FOOTER
   -------------------------------------------------------------------------- */
.tool-footer {
  margin-top: 32px;
  padding: 16px 0 10px;
  border-top: 0.5px solid var(--comp-stroke);
  text-align: center;
  font-size: 12.5px;
  color: var(--comp-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tool-footer-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tool-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--comp-font-mono);
  font-size: 11px;
  color: var(--comp-text-muted);
}

.tool-footer-brand {
  font-size: 11.5px;
  color: var(--comp-text-muted);
}

.tool-footer-brand a {
  color: var(--comp-text-primary);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   12. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .webp-tool-page {
    padding: 16px 12px 36px;
  }

  .dropzone-box {
    padding: 16px 12px;
  }

  .card-container.controls-panel,
  .card-container#controls-panel,
  .controls-panel {
    padding: 12px 14px !important;
  }

  .controls-row {
    gap: 32px;
  }

  .controls-row .slider-group {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .resize-cluster {
    width: 100%;
    justify-content: flex-start;
  }

  .resize-field-group {
    flex: 1 1 0;
  }

  .resize-input-wrap {
    width: 100%;
  }

  .compare-wrap {
    height: 320px;
  }

  .card-container.job-card,
  .job-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px !important;
    flex-wrap: wrap;
  }

  .job-thumb-box {
    width: 34px;
    height: 34px;
  }

  .job-info-col {
    min-width: 120px;
  }

  .job-actions-col {
    margin-left: auto;
  }
}

/* Ensure glossy button sheen never blocks pointer events */
.cta-large::after,
.cta-small::after {
  pointer-events: none !important;
}

/* Remove all shadows across the entire page */
*,
*::before,
*::after {
  box-shadow: none !important;
  text-shadow: none !important;
}