/* ===========================================
   Image Compress Module Styles
   =========================================== */

/* --- Upload Area --- */
#cmp-upload-area {
  margin: 8px 12px;
  padding: 16px 8px;
  border: 1px dashed #2A2A2A;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
#cmp-upload-area:hover {
  border-color: #3A3A3A;
  background: rgba(255,255,255,0.01);
}
#cmp-upload-area span {
  font-size: 11px;
  color: #666;
}
#cmp-upload-area input[type="file"] {
  display: none;
}

/* --- Image List --- */
#cmp-image-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}
#cmp-image-list .img-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
}
#cmp-image-list .img-list-item:hover {
  background: rgba(255,255,255,0.03);
}
#cmp-image-list .img-list-item.active {
  border: 0.5px solid rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.05);
}
#cmp-image-list .img-list-item.selected {
  background: rgba(0,212,255,0.08);
}
#cmp-image-list .img-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #111;
}
#cmp-image-list .img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#cmp-image-list .img-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#cmp-image-list .img-name {
  font-size: 11px;
  color: #E8E8E8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#cmp-image-list .img-meta {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
  display: flex;
  gap: 6px;
  align-items: center;
}
#cmp-image-list .img-meta .compress-rate {
  color: #00D4FF;
  font-weight: 500;
}
#cmp-image-list .img-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #1A1A1A;
  border: 0.5px solid #2A2A2A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
#cmp-image-list .img-list-item.selected .img-checkbox {
  background: #00D4FF;
  border-color: #00D4FF;
}

/* --- List Footer --- */
#cmp-list-footer {
  padding: 8px 12px;
  border-top: 0.5px solid #2A2A2A;
  font-size: 11px;
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#cmp-list-footer .footer-value {
  color: #AAA;
}
#cmp-list-footer .footer-value.saved {
  color: #00D4FF;
}

/* --- Preview Area --- */
#cmp-preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}
#cmp-preview-area .preview-row {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 700px;
  align-items: flex-start;
  justify-content: center;
}
#cmp-preview-area .preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 320px;
}
#cmp-preview-area .preview-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}
#cmp-preview-area .preview-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  max-height: 280px;
  border-radius: 8px;
  overflow: hidden;
  background: #1A1A1A;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid #2A2A2A;
}
#cmp-preview-area .preview-img-wrap.checkerboard {
  background-image:
    linear-gradient(45deg, #1A1A1A 25%, transparent 25%),
    linear-gradient(-45deg, #1A1A1A 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1A1A1A 75%),
    linear-gradient(-45deg, transparent 75%, #1A1A1A 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #222;
}
#cmp-preview-area .preview-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#cmp-preview-area .preview-info {
  font-size: 11px;
  color: #666;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
#cmp-preview-area .preview-info .saved {
  color: #00D4FF;
  font-weight: 500;
}

/* --- Slider Compare --- */
#cmp-slider-compare {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 360px;
  border-radius: 8px;
  overflow: hidden;
  border: 0.5px solid #2A2A2A;
  display: none;
}
#cmp-slider-compare.active {
  display: block;
}
#cmp-slider-original,
#cmp-slider-compressed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1A1A1A;
}
#cmp-slider-original {
  z-index: 1;
}
#cmp-slider-compressed {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}
#cmp-slider-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #00D4FF;
  z-index: 3;
  cursor: ew-resize;
  box-shadow: 0 0 8px rgba(0,212,255,0.4);
}
#cmp-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #00D4FF;
  border-radius: 50%;
  z-index: 4;
  cursor: ew-resize;
  box-shadow: 0 0 12px rgba(0,212,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
#cmp-slider-handle svg {
  width: 12px;
  height: 12px;
}
#cmp-slider-labels {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
  z-index: 5;
}
#cmp-slider-labels .slider-label {
  font-size: 11px;
  color: #AAA;
  background: rgba(0,0,0,0.6);
  padding: 2px 8px;
  border-radius: 4px;
}

/* --- Empty State --- */
#cmp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #555;
}
#cmp-empty-state.hidden {
  display: none;
}
#cmp-empty-state p {
  font-size: 13px;
}

/* --- Mode Tabs --- */
#cmp-mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
#cmp-mode-tabs .tab {
  flex: 1;
  padding: 5px 0;
  font-size: 11px;
  text-align: center;
  background: #1A1A1A;
  color: #888;
  border-radius: 4px;
  border: 0.5px solid #2A2A2A;
  cursor: pointer;
  transition: all 0.2s;
}
#cmp-mode-tabs .tab:hover {
  border-color: #3A3A3A;
}
#cmp-mode-tabs .tab.active {
  background: rgba(0,212,255,0.1);
  color: #00D4FF;
  border-color: rgba(0,212,255,0.3);
  font-weight: 500;
}

/* --- Quality Hint --- */
#cmp-quality-hint {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}
#cmp-quality-hint .hint-good {
  color: #4ADE80;
}
#cmp-quality-hint .hint-warn {
  color: #FBBF24;
}
#cmp-quality-hint .hint-bad {
  color: #F87171;
}

/* --- PNG Warning --- */
#cmp-png-warning {
  font-size: 11px;
  color: #FBBF24;
  background: rgba(251,191,36,0.08);
  border: 0.5px solid rgba(251,191,36,0.2);
  border-radius: 4px;
  padding: 8px 10px;
  margin-top: 8px;
  line-height: 1.5;
}
#cmp-png-warning.hidden {
  display: none;
}

/* --- Smart Result --- */
#cmp-smart-result {
  font-size: 11px;
  color: #AAA;
  background: rgba(0,212,255,0.05);
  border: 0.5px solid rgba(0,212,255,0.15);
  border-radius: 4px;
  padding: 10px;
  margin-top: 8px;
  line-height: 1.6;
}
#cmp-smart-result.hidden {
  display: none;
}
#cmp-smart-result .smart-title {
  color: #00D4FF;
  font-weight: 500;
  margin-bottom: 4px;
}

/* --- Progress Bar --- */
#cmp-progress-bar {
  height: 6px;
  background: #1A1A1A;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
#cmp-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #00D4FF, #7B2FFF);
  border-radius: 3px;
  transition: width 0.3s;
}
#cmp-progress-text {
  font-size: 11px;
  color: #888;
  text-align: center;
}

/* --- Range Input --- */
#cmp-input-quality {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #2A2A2A;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#cmp-input-quality::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00D4FF;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,212,255,0.3);
}
#cmp-input-quality::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00D4FF;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(0,212,255,0.3);
}

/* --- Color Input --- */
#cmp-bg-color {
  width: 36px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}
#cmp-bg-color::-webkit-color-swatch-wrapper {
  padding: 0;
}
#cmp-bg-color::-webkit-color-swatch {
  border: 0.5px solid #2A2A2A;
  border-radius: 4px;
}
