/* ==========================================================================
   استایل‌های اختصاصی ابزار کاهش حجم و فشرده‌سازی تصویر
   ========================================================================== */

.compress-workspace {
  padding: 24px;
}

.file-input-hidden {
  display: none;
}

/* دراپ‌زون آپلود */
.upload-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  background-color: var(--bg-card);
  transition: var(--transition);
  cursor: pointer;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--success);
  background-color: var(--success-light);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.dropzone-icon-box.bg-green {
  background: #ecfdf5;
  color: #10b981;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.dropzone-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-select-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(25, 75, 251, 0.25);
}

.btn-select-file:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 75, 251, 0.35);
}

/* پنل نتایج پس از انتخاب عکس */
.compress-result-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.file-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-name-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-dim-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-reset-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-reset-tool:hover {
  background: var(--bg-subtle);
  color: var(--danger);
  border-color: #fca5a5;
}

/* کارت آمار مقایسه حجم */
.stats-comparison-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 800;
}

.stat-val.original {
  color: var(--text-main);
}

.stat-val.compressed {
  color: #10b981;
}

.stat-arrow-icon {
  color: var(--text-light);
}

.stat-saving-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #10b981;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.saving-percent {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

.saving-text {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.95;
}

/* کنترل کیفیت و اسلایدر */
.quality-control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quality-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.quality-title-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quality-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.quality-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.quality-value-display {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(25, 75, 251, 0.15);
}

.quality-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: #e2e8f0;
  accent-color: var(--primary);
  cursor: pointer;
}

.preset-buttons-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.preset-btn:hover {
  color: var(--primary);
  border-color: #cbd5e1;
}

.preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* پیش‌نمایش و دانلود */
.preview-and-actions-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}

.preview-container {
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compressed-preview-image {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.actions-container {
  width: 100%;
  max-width: 380px;
}

.btn-download-compressed {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 28px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-download-compressed:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

@media (max-width: 640px) {
  .compress-workspace {
    padding: 16px;
  }
  .stats-comparison-card {
    padding: 14px;
    gap: 12px;
  }
  .stat-val {
    font-size: 1.1rem;
  }
  .saving-percent {
    font-size: 1.2rem;
  }
}
