/* ═══════════════════════════════════════════════
   ItSave — Image Compressor Styles
   ═══════════════════════════════════════════════ */

.compressor-container {
  max-width: 760px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

/* ── Compression Controls ── */
.compression-controls {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quality-control {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quality-control label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quality-control label i {
  color: var(--primary, #6366f1);
}

.quality-control input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 6px;
  /* background: linear-gradient(90deg, #ef4444 0%, #f59e0b 40%, #22c55e 100%); */
  background-color: rgb(189, 196, 255);
  outline: none;
  cursor: pointer;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.quality-control input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted, #9ca3af);
}

.output-format-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.output-format-control label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 6px;
}

.output-format-control label i {
  color: var(--primary, #6366f1);
}

.output-format-control select {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: var(--input-bg, #f9fafb);
  color: var(--text, #111827);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
  font-family: inherit;
}

.output-format-control select:focus {
  outline: none;
  border-color: var(--primary, #6366f1);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border, #d1d5db);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--card-bg, #fff);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.04);
}

.upload-content h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.upload-content p {
  font-size: 0.88rem;
  color: var(--text-muted, #6b7280);
}

.upload-browse {
  color: var(--primary, #6366f1);
  font-weight: 600;
  cursor: pointer;
}

.upload-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(99, 102, 241, 0.05)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.6rem;
  color: var(--primary, #6366f1);
}

.upload-hint {
  display: block;
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--text-muted, #9ca3af);
}

/* ── Files Section ── */
.files-section {
  margin-top: 24px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 24px;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.files-header h3 {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clear {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb);
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-clear:hover {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--input-bg, #f9fafb);
  border-radius: 10px;
  font-size: 0.85rem;
}

.file-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.file-item-info {
  flex: 1;
  min-width: 0;
}

.file-item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: 0.78rem;
  color: var(--text-muted, #9ca3af);
}

.file-item-remove {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s;
  flex-shrink: 0;
}

.file-item-remove:hover {
  background: rgba(239, 68, 68, 0.16);
}

/* ── Compress Button ── */
.compress-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.btn-compress {
  padding: 14px 40px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-compress:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-compress:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Progress ── */
.progress-section {
  margin-top: 24px;
  text-align: center;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--input-bg, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
}

/* ── Results ── */
.results-section {
  margin-top: 28px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 24px;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.results-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #22c55e;
}

.results-summary {
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 8px;
  font-weight: 600;
}

.btn-download-all {
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-download-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--input-bg, #f9fafb);
  border-radius: 12px;
  transition: all 0.2s;
}

.result-item:hover {
  background: rgba(99, 102, 241, 0.04);
}

.result-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted, #9ca3af);
}

.result-savings {
  color: #22c55e;
  font-weight: 700;
}

.result-savings.negative {
  color: #ef4444;
}

.result-download {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.result-download:hover {
  opacity: 0.88;
}

/* ── FAQ ── */
.compressor-faq {
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px;
}

.compressor-faq h2 {
  font-size: 1.2rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.compressor-faq .faq-item {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.compressor-faq .faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

.compressor-faq .faq-item summary::-webkit-details-marker {
  display: none;
}

.compressor-faq .faq-answer {
  padding: 0 20px 16px;
  font-size: 0.88rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .compression-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-item {
    flex-wrap: wrap;
  }

  .result-download {
    width: 100%;
    justify-content: center;
  }
}
