/* ── HEIC to JPG Converter – WordPress Plugin Styles ── */
/* All rules scoped under #heic-converter to avoid theme conflicts */

#heic-converter {
  --hc-surface:   #ffffff;
  --hc-surface-2: #f0efe9;
  --hc-border:    #e2e0d8;
  --hc-border-strong: #c8c5ba;
  --hc-text:      #1a1916;
  --hc-text-2:    #6b6860;
  --hc-text-muted:#a09e98;
  --hc-accent:    #2563eb;
  --hc-accent-lt: #eff4ff;
  --hc-accent-hv: #1d4ed8;
  --hc-success:   #16a34a;
  --hc-success-lt:#f0fdf4;
  --hc-error:     #dc2626;
  --hc-error-lt:  #fef2f2;
  --hc-warning:   #d97706;
  --hc-warning-lt:#fffbeb;
  --hc-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --hc-shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --hc-radius:    12px;
  --hc-radius-sm: 8px;
  --hc-radius-lg: 16px;

  font-family: 'DM Sans', sans-serif;
  color: var(--hc-text);
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  box-sizing: border-box;
}

#heic-converter *, #heic-converter *::before, #heic-converter *::after {
  box-sizing: border-box;
}

/* Hero */
#heic-converter .hc-hero {
  text-align: center;
  margin-bottom: 24px;
  animation: hcFadeUp .5s ease both;
}
#heic-converter .hc-heading {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0 0 8px;
  padding: 0;
  border: none;
  color: var(--hc-text);
}
#heic-converter .hc-arrow { color: var(--hc-accent); font-weight: 300; }
#heic-converter .hc-sub {
  font-size: 13px;
  color: var(--hc-text-2);
  line-height: 1.6;
  max-width: 460px;
  margin: 0 auto;
}

/* Library status */
#heic-converter #hc-lib-status {
  display: none;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--hc-radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
#heic-converter #hc-lib-status.hc-status-loading {
  display: block;
  background: var(--hc-warning-lt);
  border: 1px solid #fde68a;
  color: var(--hc-warning);
}
#heic-converter #hc-lib-status.hc-status-ready  { display: none; }
#heic-converter #hc-lib-status.hc-status-error  {
  display: block;
  background: var(--hc-error-lt);
  border: 1px solid #fecaca;
  color: var(--hc-error);
}

/* Dropzone */
#heic-converter .hc-dropzone {
  background: var(--hc-surface);
  border: 2px dashed var(--hc-border-strong);
  border-radius: var(--hc-radius-lg);
  padding: 52px 40px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
#heic-converter .hc-dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--hc-accent-lt) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}
#heic-converter .hc-dropzone:hover,
#heic-converter .hc-dropzone.hc-drag-over {
  border-color: var(--hc-accent);
  background: var(--hc-accent-lt);
  box-shadow: var(--hc-shadow-md);
}
#heic-converter .hc-dropzone:hover::before,
#heic-converter .hc-dropzone.hc-drag-over::before { opacity: 1; }
#heic-converter .hc-dropzone.hc-drag-over { transform: scale(1.01); }

#heic-converter .hc-dz-icon {
  width: 56px; height: 56px;
  background: var(--hc-surface-2);
  border: 1px solid var(--hc-border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  transition: all .2s;
  position: relative; z-index: 1;
}
#heic-converter .hc-dropzone:hover .hc-dz-icon { background: var(--hc-accent); border-color: var(--hc-accent); }
#heic-converter .hc-dropzone:hover .hc-dz-icon svg { color: white; }
#heic-converter .hc-dz-icon svg { width: 24px; height: 24px; color: var(--hc-text-2); transition: color .2s; }
#heic-converter .hc-dz-title { font-size: 16px; font-weight: 500; margin-bottom: 6px; position: relative; z-index: 1; }
#heic-converter .hc-dz-sub { font-size: 13px; color: var(--hc-text-muted); position: relative; z-index: 1; }
#heic-converter .hc-dz-formats { display: flex; justify-content: center; gap: 8px; margin-top: 20px; position: relative; z-index: 1; }
#heic-converter .hc-chip {
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 500;
  padding: 4px 10px; border-radius: 6px;
  background: var(--hc-surface-2);
  border: 1px solid var(--hc-border);
  color: var(--hc-text-2);
}

/* Settings panel */
#heic-converter .hc-settings {
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius);
  padding: 20px 24px;
  margin-top: 16px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  box-shadow: var(--hc-shadow-sm);
}
#heic-converter .hc-setting-group { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
#heic-converter .hc-setting-label { font-size: 13px; font-weight: 500; color: var(--hc-text-2); white-space: nowrap; }
#heic-converter .hc-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; background: var(--hc-border); border-radius: 4px; outline: none; cursor: pointer;
}
#heic-converter .hc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--hc-accent); cursor: pointer;
  border: 2px solid white; box-shadow: 0 1px 4px rgba(37,99,235,.4);
  transition: transform .1s;
}
#heic-converter .hc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
#heic-converter .hc-quality-val {
  font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500;
  color: var(--hc-accent); background: var(--hc-accent-lt);
  border: 1px solid #bfdbfe; padding: 3px 8px; border-radius: 6px;
  min-width: 42px; text-align: center;
}
#heic-converter .hc-divider { width: 1px; height: 32px; background: var(--hc-border); }
#heic-converter .hc-btn-convert {
  display: flex; align-items: center; gap: 8px;
  background: var(--hc-text); color: white; border: none;
  padding: 10px 20px; border-radius: var(--hc-radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
#heic-converter .hc-btn-convert:hover:not(:disabled) { background: #2d2b28; transform: translateY(-1px); box-shadow: var(--hc-shadow-md); }
#heic-converter .hc-btn-convert:disabled { background: var(--hc-border-strong); cursor: not-allowed; }
#heic-converter .hc-btn-convert svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Summary bar */
#heic-converter #hc-summary {
  display: none;
  background: var(--hc-surface); border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius); padding: 14px 20px; margin-top: 12px;
  align-items: center; justify-content: space-between;
  box-shadow: var(--hc-shadow-sm); flex-wrap: wrap; gap: 12px;
}
#heic-converter #hc-summary.hc-visible { display: flex; }
#heic-converter .hc-stats { display: flex; align-items: center; gap: 20px; }
#heic-converter .hc-stat { text-align: center; }
#heic-converter .hc-stat-val { font-family: 'DM Mono', monospace; font-size: 18px; font-weight: 500; line-height: 1; }
#heic-converter .hc-stat-lbl { font-size: 11px; color: var(--hc-text-muted); margin-top: 3px; }
#heic-converter .hc-stat-div { width: 1px; height: 30px; background: var(--hc-border); }
#heic-converter .hc-btn-dl-all {
  display: flex; align-items: center; gap: 8px;
  background: var(--hc-accent); color: white; border: none;
  padding: 10px 20px; border-radius: var(--hc-radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .2s;
}
#heic-converter .hc-btn-dl-all:hover:not(:disabled) { background: var(--hc-accent-hv); transform: translateY(-1px); }
#heic-converter .hc-btn-dl-all:disabled { background: var(--hc-border-strong); cursor: not-allowed; }
#heic-converter .hc-btn-dl-all svg { width: 14px; height: 14px; }

/* Queue */
#heic-converter #hc-queue-wrap { margin-top: 20px; }
#heic-converter .hc-queue-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#heic-converter .hc-queue-label { font-size: 13px; font-weight: 500; color: var(--hc-text-2); }
#heic-converter .hc-queue-count { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--hc-text-muted); }
#heic-converter .hc-btn-clear {
  font-size: 12px; color: var(--hc-error); background: none; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  font-family: 'DM Sans', sans-serif; transition: background .15s;
}
#heic-converter .hc-btn-clear:hover { background: var(--hc-error-lt); }
#heic-converter #hc-queue-list { display: flex; flex-direction: column; gap: 8px; }

/* File card */
#heic-converter .hc-card {
  background: var(--hc-surface); border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--hc-shadow-sm); transition: all .2s;
  animation: hcSlideIn .25s ease both;
}
#heic-converter .hc-card:hover { box-shadow: var(--hc-shadow-md); border-color: var(--hc-border-strong); }
#heic-converter .hc-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--hc-surface-2); border: 1px solid var(--hc-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
#heic-converter .hc-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
#heic-converter .hc-thumb svg { width: 20px; height: 20px; color: var(--hc-text-muted); }
#heic-converter .hc-finfo { flex: 1; min-width: 0; }
#heic-converter .hc-fname { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#heic-converter .hc-fmeta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
#heic-converter .hc-fsize { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--hc-text-muted); }

/* Badges */
#heic-converter .hc-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; }
#heic-converter .hc-badge.pending    { background: var(--hc-surface-2); color: var(--hc-text-muted); border: 1px solid var(--hc-border); }
#heic-converter .hc-badge.converting { background: var(--hc-warning-lt); color: var(--hc-warning); border: 1px solid #fde68a; }
#heic-converter .hc-badge.done       { background: var(--hc-success-lt); color: var(--hc-success); border: 1px solid #bbf7d0; }
#heic-converter .hc-badge.error      { background: var(--hc-error-lt); color: var(--hc-error); border: 1px solid #fecaca; }
#heic-converter .hc-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#heic-converter .hc-badge.converting .dot { animation: hcPulse 1s infinite; }

/* Progress */
#heic-converter .hc-prog { height: 2px; background: var(--hc-border); border-radius: 2px; margin-top: 6px; overflow: hidden; display: none; }
#heic-converter .hc-prog-bar { height: 100%; background: var(--hc-accent); border-radius: 2px; width: 0%; transition: width .3s ease; }

/* Action buttons */
#heic-converter .hc-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#heic-converter .hc-act {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--hc-border);
  background: var(--hc-surface-2); cursor: pointer; transition: all .15s;
  text-decoration: none; color: var(--hc-text-2);
  font-size: 16px; line-height: 1; font-family: sans-serif;
}
#heic-converter .hc-act:hover { background: var(--hc-accent); border-color: var(--hc-accent); color: white; }
#heic-converter .hc-act.danger:hover { background: var(--hc-error); border-color: var(--hc-error); color: white; }
#heic-converter .hc-act svg { width: 14px; height: 14px; }

/* Spin */
#heic-converter .hc-spin { animation: hcSpin .8s linear infinite; display: inline-block; }

/* Animations */
@keyframes hcFadeUp  { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes hcSlideIn { from{opacity:0;transform:translateX(-8px)} to{opacity:1;transform:translateX(0)} }
@keyframes hcPulse   { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes hcSpin    { to{transform:rotate(360deg)} }

/* Responsive */
@media (max-width: 640px) {
  #heic-converter .hc-settings { flex-direction: column; align-items: stretch; }
  #heic-converter .hc-divider  { display: none; }
  #heic-converter .hc-dropzone { padding: 36px 24px; }
}
