/**
 * ONE RESIZER — Tool 06: Image Enhancer Stylesheet
 * Real-Time Visual Filters (Brightness, Contrast, Saturation, Sharpness)
 * Side-by-Side Before/After Comparison, Dynamic Numerical Sliders,
 * Quality Controls, and Responsive Studio Layout.
 */

/* ========================================================
   CONTAINER & WORKSPACE VIEWS
   ======================================================== */
.enh-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.enh-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.enh-view.hidden {
  display: none !important;
}

/* ========================================================
   INITIAL UPLOAD HERO SCREEN
   ======================================================== */
.upload-hero-card {
  background: var(--bg-card);
  border: 2px dashed var(--primary-cyan);
  border-radius: var(--radius-xl);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.upload-hero-card:hover, .upload-hero-card.dragover {
  background: rgba(22, 135, 245, 0.08);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.upload-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: rgba(22, 135, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
}
.upload-icon-wrapper svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  fill: none;
}

.upload-heading {
  font-size: 20px;
  font-weight: 850;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.upload-subheading {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.upload-btn-fake {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-cyan);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 9px 22px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px var(--primary-glow);
  margin-bottom: 14px;
}
.upload-formats-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  max-width: 100%;
}

/* ========================================================
   STUDIO LAYOUT: PREVIEWS (LEFT) + CONTROLS (RIGHT)
   ======================================================== */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 24px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* LEFT COLUMN: SIDE-BY-SIDE PREVIEWS PANEL */
.previews-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.preview-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
  flex-wrap: wrap;
}
.file-info-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.file-info-badge .file-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-info-badge .file-size-orig {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

/* DUAL PREVIEW COMPARISON GRID */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.compare-card {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.compare-header .tag {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 10.5px;
}
.compare-header .tag-orig {
  background: var(--bg-card);
  color: var(--text-muted);
}
.compare-header .tag-enh {
  background: rgba(22, 135, 245, 0.15);
  color: var(--primary-cyan);
}

.compare-stage {
  position: relative;
  width: 100%;
  height: 260px;
  background-color: var(--bg-card);
  background-image: 
    linear-gradient(45deg, rgba(0,0,0,0.06) 25%, transparent 25%), 
    linear-gradient(-45deg, rgba(0,0,0,0.06) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.06) 75%), 
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.06) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
  box-sizing: border-box;
}
html[data-theme="dark"] .compare-stage {
  background-image: 
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%), 
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.04) 75%), 
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%);
}

.compare-stage img, .compare-stage canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-xs);
}

.compare-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text-muted);
}
.compare-meta strong {
  font-size: 13px;
  font-weight: 850;
  color: var(--text-heading);
}

/* RIGHT COLUMN: CONTROLS PANEL */
.controls-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
}

.control-section-header {
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

/* SLIDERS LIST */
.sliders-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-sizing: border-box;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-heading);
}
.slider-val-badge {
  font-size: 12px;
  font-weight: 850;
  color: var(--primary-cyan);
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  min-width: 38px;
  text-align: center;
}

.enh-slider {
  width: 100%;
  accent-color: var(--primary-cyan);
  cursor: pointer;
}

/* 4-FORMAT GRID */
.format-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}
.format-btn {
  background: var(--bg-subtle);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 9px 2px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.format-btn:hover {
  border-color: var(--primary-cyan);
}
.format-btn.active {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: #fff;
  box-shadow: 0 3px 10px var(--primary-glow);
}

/* JPG QUALITY CONTAINER */
.jpg-quality-box {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ACTION BUTTONS */
.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
}
.btn-download-execute {
  width: 100%;
  height: 48px;
  background: #10a858;
  border: 0;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 168, 88, 0.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-download-execute:hover:not(:disabled) {
  background: #0d8a47;
  transform: translateY(-1px);
}

.btn-secondary-action {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  padding: 6px 10px;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-secondary-action:hover {
  background: var(--bg-subtle);
  color: var(--text-heading);
  border-color: var(--line-light);
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES
   ======================================================== */
@media (max-width: 992px) {
  .editor-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
@media (max-width: 768px) {
  .previews-panel, .controls-panel {
    padding: 16px 14px;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .compare-stage {
    height: 220px;
  }
}
@media (max-width: 480px) {
  .format-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
