/* ==========================================================================
   TulBD Image Compressor Suite - Ultra-Fast Client-Side CSS
   Supports light/dark theme, responsive comparison grid, switcher pills, stats
   ========================================================================== */

.img-comp-card {
  background: var(--tb-card, #ffffff);
  border: 1px solid var(--tb-border, #e2e8f0);
  border-radius: var(--tb-radius-lg, 16px);
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  margin: 0 0 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  font-family: inherit;
}

[data-theme="dark"] .img-comp-card,
body.dark-theme .img-comp-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

.img-comp-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #06b6d4, #0891b2, #ea580c, #10b981);
}

/* Header */
.img-comp-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.img-comp-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(6, 182, 212, 0.25));
  transition: transform 0.3s ease;
}

.img-comp-icon-box:hover {
  transform: scale(1.05) rotate(-2deg);
}

.img-comp-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: var(--tb-text, #0f172a);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

[data-theme="dark"] .img-comp-title,
body.dark-theme .img-comp-title {
  color: #f8fafc;
}

.img-comp-lead {
  font-size: 14.5px;
  color: var(--tb-text-secondary, #64748b);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
}

[data-theme="dark"] .img-comp-lead,
body.dark-theme .img-comp-lead {
  color: #94a3b8;
}

.img-comp-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.img-comp-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

[data-theme="dark"] .img-comp-pill-badge,
body.dark-theme .img-comp-pill-badge {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.3);
}

/* Quick Size Switcher */
.img-comp-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--tb-border, rgba(0, 0, 0, 0.08));
}

[data-theme="dark"] .img-comp-switcher,
body.dark-theme .img-comp-switcher,
.dark-theme .img-comp-switcher {
  border-bottom-color: #273549 !important;
  background: transparent !important;
}

.img-comp-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-width: max-content;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  background: var(--tb-surface, #f8fafc);
  color: var(--tb-text-secondary, #475569);
  border: 1px solid var(--tb-border, #e2e8f0);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

[data-theme="dark"] .img-comp-pill,
body.dark-theme .img-comp-pill,
.dark-theme .img-comp-pill {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
}

.img-comp-pill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}

[data-theme="dark"] .img-comp-pill:hover,
body.dark-theme .img-comp-pill:hover,
.dark-theme .img-comp-pill:hover {
  background: #1e293b !important;
  color: #38bdf8 !important;
  border-color: #2563eb !important;
}

.img-comp-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

[data-theme="dark"] .img-comp-pill.active,
body.dark-theme .img-comp-pill.active,
.dark-theme .img-comp-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.45) !important;
}

/* Dropzone */
.img-comp-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 16px;
  padding: 38px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

[data-theme="dark"] .img-comp-dropzone,
body.dark-theme .img-comp-dropzone {
  border-color: #475569;
  background: rgba(15, 23, 42, 0.6);
}

.img-comp-dropzone:hover,
.img-comp-dropzone:focus-visible {
  border-color: #0891b2;
  background: rgba(6, 182, 212, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.1);
}

.img-comp-dropzone.dragover {
  border-color: #0891b2;
  border-style: solid;
  background: rgba(6, 182, 212, 0.12);
  transform: scale(1.01);
}

.img-comp-drop-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(8, 145, 178, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  transition: transform 0.2s ease;
}

.img-comp-dropzone:hover .img-comp-drop-icon {
  transform: translateY(-3px) scale(1.05);
}

.img-comp-drop-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--tb-text, #0f172a);
}

[data-theme="dark"] .img-comp-drop-title,
body.dark-theme .img-comp-drop-title {
  color: #f1f5f9;
}

.img-comp-drop-sub {
  font-size: 13px;
  color: var(--tb-text-secondary, #64748b);
  max-width: 500px;
  line-height: 1.5;
}

[data-theme="dark"] .img-comp-drop-sub,
body.dark-theme .img-comp-drop-sub {
  color: #94a3b8;
}

.img-comp-browse-btn {
  margin-top: 6px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #0891b2, #0284c7);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

.img-comp-browse-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.35);
  transform: translateY(-1px);
}

/* Target Control Bar */
.img-comp-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-top: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

[data-theme="dark"] .img-comp-controls-bar,
body.dark-theme .img-comp-controls-bar {
  background: #0f172a;
  border-color: #334155;
}

.img-comp-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
}

.img-comp-control-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tb-text, #334155);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .img-comp-control-group label,
body.dark-theme .img-comp-control-group label {
  color: #cbd5e1;
}

.img-comp-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

[data-theme="dark"] .img-comp-input-wrap,
body.dark-theme .img-comp-input-wrap {
  border-color: #475569;
  background: #1e293b;
}

.img-comp-target-val {
  flex: 1;
  border: none;
  padding: 8px 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tb-text, #0f172a);
  background: transparent;
  outline: none;
  min-width: 0;
}

[data-theme="dark"] .img-comp-target-val,
body.dark-theme .img-comp-target-val {
  color: #f8fafc;
}

.img-comp-target-unit,
.img-comp-out-fmt,
.img-comp-resize-mode {
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--tb-text, #0f172a);
  outline: none;
  cursor: pointer;
}

[data-theme="dark"] .img-comp-target-unit,
[data-theme="dark"] .img-comp-out-fmt,
[data-theme="dark"] .img-comp-resize-mode,
body.dark-theme .img-comp-target-unit,
body.dark-theme .img-comp-out-fmt,
body.dark-theme .img-comp-resize-mode {
  border-color: #475569;
  background: #1e293b;
  color: #f8fafc;
}

.img-comp-input-wrap .img-comp-target-unit {
  border: none;
  border-left: 1px solid #cbd5e1;
  border-radius: 0;
  background: #f1f5f9;
}

[data-theme="dark"] .img-comp-input-wrap .img-comp-target-unit,
body.dark-theme .img-comp-input-wrap .img-comp-target-unit {
  border-color: #475569;
  background: #334155;
}

.img-comp-action-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.img-comp-btn-action {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.img-comp-btn-compress {
  background: linear-gradient(135deg, #0891b2, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

.img-comp-btn-compress:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.img-comp-btn-reset {
  background: #e2e8f0;
  color: #475569;
}

[data-theme="dark"] .img-comp-btn-reset,
body.dark-theme .img-comp-btn-reset {
  background: #334155;
  color: #cbd5e1;
}

.img-comp-btn-reset:hover {
  background: #cbd5e1;
  color: #1e293b;
}

[data-theme="dark"] .img-comp-btn-reset:hover,
body.dark-theme .img-comp-btn-reset:hover {
  background: #475569;
  color: #ffffff;
}

/* Custom Dim Row */
.img-comp-custom-dim-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 8px;
}

[data-theme="dark"] .img-comp-custom-dim-row,
body.dark-theme .img-comp-custom-dim-row {
  background: #0f172a;
}

.img-dim-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.img-dim-field label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.img-dim-field input {
  width: 90px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.img-comp-aspect-lock {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
}

.img-comp-aspect-lock.active {
  background: #0891b2;
  color: #ffffff;
  border-color: #0891b2;
}

/* Progress Bar */
.img-comp-progress-wrap {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-align: center;
}

[data-theme="dark"] .img-comp-progress-wrap,
body.dark-theme .img-comp-progress-wrap {
  background: #0f172a;
  border-color: #334155;
}

.img-comp-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .img-comp-progress-bar,
body.dark-theme .img-comp-progress-bar {
  background: #334155;
}

.img-comp-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #0891b2, #ea580c);
  transition: width 0.25s ease;
}

.img-comp-progress-status {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0891b2;
}

/* Side-by-Side Comparison Workspace */
.img-comp-workspace {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.img-comp-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .img-comp-compare-grid {
    grid-template-columns: 1fr;
  }
}

.img-comp-card-side {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .img-comp-card-side,
body.dark-theme .img-comp-card-side {
  background: #0f172a;
  border-color: #334155;
}

.img-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.img-side-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tb-text, #0f172a);
}

[data-theme="dark"] .img-side-title,
body.dark-theme .img-side-title {
  color: #f1f5f9;
}

.img-side-size {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
}

[data-theme="dark"] .img-side-size,
body.dark-theme .img-side-size {
  background: #334155;
  color: #cbd5e1;
}

.comp-size-badge {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.img-side-preview-wrap {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%),
                    linear-gradient(-45deg, #eee 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #eee 75%),
                    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

[data-theme="dark"] .img-side-preview-wrap,
body.dark-theme .img-side-preview-wrap {
  background-color: #1e293b;
  border-color: #334155;
  background-image: linear-gradient(45deg, #0f172a 25%, transparent 25%),
                    linear-gradient(-45deg, #0f172a 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #0f172a 75%),
                    linear-gradient(-45deg, transparent 75%, #0f172a 75%);
}

.img-side-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.img-side-meta {
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
}

[data-theme="dark"] .img-side-meta,
body.dark-theme .img-side-meta {
  color: #94a3b8;
}

/* Stats Banner */
.img-comp-stats-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  padding: 14px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

[data-theme="dark"] .img-comp-stats-banner,
body.dark-theme .img-comp-stats-banner {
  background: #0f172a;
  border-color: #334155;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
}

.stat-label {
  color: #64748b;
  font-weight: 500;
}

[data-theme="dark"] .stat-label,
body.dark-theme .stat-label {
  color: #94a3b8;
}

.stat-arrow {
  color: #94a3b8;
  font-size: 16px;
}

.text-success {
  color: #10b981 !important;
  font-weight: 700;
}

.text-warning {
  color: #ea580c !important;
  font-weight: 700;
}

.text-info {
  color: #0891b2 !important;
  font-weight: 700;
}

/* Download Action */
.img-comp-download-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.img-comp-btn-download {
  width: 100%;
  max-width: 440px;
  padding: 15px 28px;
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.img-comp-btn-download:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.img-comp-download-note {
  font-size: 12.5px;
  color: #64748b;
  text-align: center;
}

[data-theme="dark"] .img-comp-download-note,
body.dark-theme .img-comp-download-note {
  color: #94a3b8;
}

/* File Banner (Selected Image Info) */
.img-comp-file-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-top: 20px;
}

.img-comp-file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.img-comp-file-thumb-wrap {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
}

.img-comp-file-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-comp-file-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.img-comp-file-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.img-comp-file-specs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.img-badge-spec {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.img-comp-btn-change-file {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #0891b2;
  background: #ffffff;
  border: 1px solid #0891b2;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.img-comp-btn-change-file:hover {
  background: #0891b2;
  color: #ffffff;
}

/* Advanced Options Modular Panel */
.img-comp-options-box {
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.img-comp-options-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.img-comp-opt-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.img-comp-opt-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(8, 145, 178, 0.1);
  color: #0891b2;
}

.img-comp-grid-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.img-comp-extra-row {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.img-comp-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.img-comp-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0891b2;
  cursor: pointer;
}

.img-comp-quality-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.img-comp-quality-range {
  flex: 1;
  accent-color: #0891b2;
  cursor: pointer;
}

.img-comp-quality-val {
  font-size: 13px;
  font-weight: 700;
  color: #0891b2;
  min-width: 40px;
  text-align: right;
}

/* Action Center (Centered with generous spacing from top section) */
.img-comp-action-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  margin-bottom: 30px;
  padding: 6px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.img-comp-action-center .img-comp-btn-compress {
  padding: 15px 36px;
  font-size: 16.5px;
  font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(135deg, #0891b2, #0284c7);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 220px;
  box-sizing: border-box;
}

.img-comp-action-center .img-comp-btn-compress:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(8, 145, 178, 0.45);
  filter: brightness(1.08);
}

.img-comp-action-center .img-comp-btn-reset {
  padding: 15px 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.img-comp-action-center .img-comp-btn-reset:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Comparison Table Styling (Fixes user feedback: spacious 3 sections) */
.img-compressor-seo-article .table-responsive {
  margin: 32px 0;
  overflow-x: auto;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
}

.comp-table th {
  background: #f1f5f9;
  color: #0f172a;
  padding: 18px 24px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 2px solid #cbd5e1;
  letter-spacing: 0.02em;
}

.comp-table th:nth-child(2) {
  background: #e0f2fe;
  color: #0284c7;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
}

.comp-table td {
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.comp-table tr:last-child td {
  border-bottom: none;
}

.comp-table tr:hover td {
  background: #f8fafc;
}

.comp-table td:nth-child(2) {
  background: rgba(16, 185, 129, 0.04);
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.comp-table tr:hover td:nth-child(2) {
  background: rgba(16, 185, 129, 0.08);
}

.table-badge-good {
  display: inline-block;
  padding: 2px 8px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  margin-right: 4px;
}

.table-badge-bad {
  display: inline-block;
  padding: 2px 8px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  margin-right: 4px;
}

/* Dark Theme Support */
[data-theme="dark"] .img-comp-file-banner,
body.dark-theme .img-comp-file-banner {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .img-comp-file-name,
body.dark-theme .img-comp-file-name {
  color: #f1f5f9;
}

[data-theme="dark"] .img-comp-options-box,
body.dark-theme .img-comp-options-box {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .img-comp-opt-title,
body.dark-theme .img-comp-opt-title {
  color: #f1f5f9;
}

[data-theme="dark"] .img-comp-options-header,
body.dark-theme .img-comp-options-header {
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .img-comp-extra-row,
body.dark-theme .img-comp-extra-row {
  border-top-color: #334155;
}

[data-theme="dark"] .img-comp-checkbox-label,
body.dark-theme .img-comp-checkbox-label {
  color: #cbd5e1;
}

[data-theme="dark"] .img-comp-action-center .img-comp-btn-reset,
body.dark-theme .img-comp-action-center .img-comp-btn-reset {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .img-compressor-seo-article .table-responsive,
body.dark-theme .img-compressor-seo-article .table-responsive {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .comp-table th,
body.dark-theme .comp-table th {
  background: #1e293b;
  color: #f8fafc;
  border-bottom-color: #334155;
}

[data-theme="dark"] .comp-table th:nth-child(2),
body.dark-theme .comp-table th:nth-child(2) {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border-left-color: #334155;
  border-right-color: #334155;
}

[data-theme="dark"] .comp-table td,
body.dark-theme .comp-table td {
  border-bottom-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .comp-table td:nth-child(2),
body.dark-theme .comp-table td:nth-child(2) {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: #334155;
  border-right-color: #334155;
}

[data-theme="dark"] .comp-table tr:hover td,
body.dark-theme .comp-table tr:hover td {
  background: #1e293b;
}

[data-theme="dark"] .table-badge-good,
body.dark-theme .table-badge-good {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .table-badge-bad,
body.dark-theme .table-badge-bad {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Mobile Responsive Optimization: Fits all 3 parts fully on mobile screen */
@media (max-width: 680px) {
  .img-comp-card {
    padding: 18px 14px;
    border-radius: 14px;
  }
  .img-comp-dropzone {
    padding: 28px 14px;
    border-radius: 12px;
  }
  .img-comp-action-center {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 0 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .img-comp-action-center .img-comp-btn-compress {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 100%;
    padding: 13px 18px;
    font-size: 15px;
    border-radius: 11px;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.3);
  }
  .img-comp-action-center .img-comp-btn-reset {
    flex: 0 1 auto;
    min-width: 0;
    padding: 13px 20px;
    font-size: 14px;
    border-radius: 11px;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .img-comp-compare-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .img-side-preview-wrap {
    height: 200px !important;
  }
  .img-side-preview-wrap img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
  }
  .img-comp-stats-banner {
    padding: 12px 10px;
    gap: 8px;
    justify-content: center;
  }
  .stat-box {
    font-size: 12px;
  }
  .img-compressor-seo-article .table-responsive {
    margin: 18px 0;
    border-radius: 10px;
    width: 100%;
  }
  .comp-table {
    font-size: 11.5px;
    line-height: 1.38;
    table-layout: auto;
    width: 100%;
  }
  .comp-table th {
    padding: 9px 5px !important;
    font-size: 11px !important;
    white-space: normal;
  }
  .comp-table td {
    padding: 8px 5px !important;
    font-size: 11px !important;
    white-space: normal;
    word-break: break-word;
  }
  .comp-table th:first-child,
  .comp-table td:first-child {
    width: 28% !important;
    min-width: 78px;
  }
  .comp-table th:nth-child(2),
  .comp-table td:nth-child(2) {
    width: 36% !important;
    min-width: 98px;
  }
  .comp-table th:nth-child(3),
  .comp-table td:nth-child(3) {
    width: 36% !important;
    min-width: 98px;
  }
  .table-badge-good,
  .table-badge-bad {
    display: inline-block;
    padding: 1px 4px;
    font-size: 9.5px;
    border-radius: 4px;
    margin-right: 2px;
    margin-bottom: 2px;
  }
}

@media (max-width: 400px) {
  .comp-table {
    font-size: 10.5px;
  }
  .comp-table th {
    padding: 7px 4px !important;
    font-size: 10.5px !important;
  }
  .comp-table td {
    padding: 6px 4px !important;
    font-size: 10.5px !important;
  }
  .comp-table th:first-child,
  .comp-table td:first-child {
    min-width: 70px;
  }
  .comp-table th:nth-child(2),
  .comp-table td:nth-child(2) {
    min-width: 88px;
  }
  .comp-table th:nth-child(3),
  .comp-table td:nth-child(3) {
    min-width: 88px;
  }
}

@media (max-width: 640px) {
  .img-comp-card {
    padding: 16px 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .img-comp-header {
    margin-bottom: 14px;
    width: 100%;
  }
  .img-comp-switcher {
    padding: 8px 10px;
    gap: 6px;
    margin-bottom: 16px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
  }
  .img-comp-pill {
    padding: 5px 10px;
    font-size: 11.5px;
  }
  .img-comp-dropzone {
    padding: 22px 10px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-sizing: border-box;
  }
  .img-comp-drop-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 6px;
  }
  .img-comp-drop-icon svg {
    width: 30px;
    height: 30px;
  }
  .img-comp-drop-title {
    font-size: 15px;
    line-height: 1.35;
  }
  .img-comp-drop-sub {
    font-size: 12px;
  }
  .img-comp-browse-btn {
    width: 100%;
    max-width: 260px;
    min-height: 42px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  .img-comp-file-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    margin-top: 14px;
    box-sizing: border-box;
  }
  .img-comp-file-info {
    width: 100%;
  }
  .img-comp-file-name {
    max-width: 220px;
    font-size: 13.5px;
  }
  .img-comp-btn-change-file {
    width: 100%;
    text-align: center;
    justify-content: center;
    min-height: 40px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }
  .img-comp-options-box {
    padding: 16px 12px;
    border-radius: 12px;
    margin-top: 16px;
    box-sizing: border-box;
  }
  .img-comp-options-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 14px;
  }
  .img-comp-grid-controls {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .img-comp-action-center {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 18px 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .img-comp-action-center .img-comp-btn-compress {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    min-height: 46px;
    padding: 13px 16px;
    font-size: 15px;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }
  .img-comp-action-center .img-comp-btn-reset {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    min-height: 40px;
    padding: 11px 16px;
    font-size: 13.5px;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }
  .img-comp-compare-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .img-side-preview-wrap {
    height: 190px;
  }
  .img-comp-stats-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    box-sizing: border-box;
  }
  .img-comp-download-wrap {
    width: 100%;
    box-sizing: border-box;
  }
  .img-comp-btn-download {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    font-size: 15.5px;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }
}

@media (max-width: 380px) {
  .img-comp-card {
    padding: 12px 8px;
  }
  .img-comp-pill {
    padding: 4px 8px;
    font-size: 11px;
  }
  .img-comp-file-name {
    max-width: 180px;
    font-size: 13px;
  }
}
