/* ============================================================
   photo-resizer.css — styles for Photo Resizer tool
   Inherits HSSLab design tokens from ../style.css
   ============================================================ */

/* ---- Hero ---- */
.pr-hero {
  background: linear-gradient(135deg, var(--bg-elevated, #1e2030) 0%, var(--surface, #262840) 100%);
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  padding: 2rem 1.5rem 1.75rem;
}
[data-theme="light"] .pr-hero {
  background: linear-gradient(135deg, #f0f2ff 0%, #e8f4fd 100%);
  border-bottom: 1px solid #e2e8f0;
}

.pr-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.pr-hero-icon {
  font-size: 2.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.pr-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  background: linear-gradient(135deg, #818cf8, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pr-hero-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text2, #94a3b8);
  line-height: 1.5;
}

/* ---- Main wrapper ---- */
.pr-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ---- Settings bar ---- */
.pr-settings-bar {
  background: var(--surface, #1e2030);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 1rem 1.25rem 0.75rem;
  margin-bottom: 1.25rem;
}
[data-theme="light"] .pr-settings-bar {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.pr-settings-inner {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pr-settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pr-setting-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pr-setting-input {
  width: 90px;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: var(--bg, #13141f);
  color: var(--text, #e2e8f0);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}
[data-theme="light"] .pr-setting-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}
.pr-setting-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(129,140,248,0.2);
}

.pr-settings-sep {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text2, #94a3b8);
  padding-bottom: 0.45rem;
  align-self: flex-end;
}
.pr-settings-sep--lg { margin: 0 0.15rem; }

.pr-apply-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  align-self: flex-end;
}
.pr-apply-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.pr-apply-btn:active { transform: translateY(0); }

.pr-settings-error {
  width: 100%;
  margin: 0.25rem 0 0;
  font-size: 0.83rem;
  color: #f87171;
  font-weight: 600;
}

.pr-settings-hint {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--text3, #64748b);
}

/* ---- Drop zone ---- */
.pr-drop-zone {
  border: 2px dashed var(--border, rgba(255,255,255,0.15));
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.25rem;
  background: var(--surface, #1e2030);
}
[data-theme="light"] .pr-drop-zone {
  background: #fafbff;
  border-color: #c7d2fe;
}
.pr-drop-zone:hover,
.pr-drop-zone:focus,
.pr-drop-zone.dragover {
  border-color: #818cf8;
  background: rgba(129,140,248,0.06);
  outline: none;
}

.pr-dz-inner { pointer-events: none; }

.pr-dz-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(129,140,248,0.15), rgba(20,184,166,0.12));
  margin-bottom: 0.85rem;
}
.pr-dz-icon svg {
  width: 28px;
  height: 28px;
  stroke: #818cf8;
}

.pr-dz-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--text, #e2e8f0);
}
[data-theme="light"] .pr-dz-title { color: #1e293b; }

.pr-dz-hint {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text3, #64748b);
}

/* ---- Batch bar ---- */
.pr-batch-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.pr-download-all-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(20,184,166,0.25);
}
.pr-download-all-btn:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.pr-download-all-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pr-download-all-btn.hidden { display: none; }

/* ---- Cards grid ---- */
.pr-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
  gap: 1.25rem;
}

/* ---- Photo Card ---- */
.photo-card {
  background: var(--surface, #1e2030);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
[data-theme="light"] .photo-card {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.photo-card:hover { box-shadow: 0 4px 20px rgba(129,140,248,0.12); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
  background: var(--bg-elevated, rgba(255,255,255,0.03));
}
[data-theme="light"] .card-header {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.card-filename {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text2, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 40px);
}

.card-remove-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text3, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.card-remove-btn svg { width: 15px; height: 15px; }
.card-remove-btn:hover { background: rgba(248,113,113,0.12); color: #f87171; }

.card-body {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  align-items: flex-start;
}

/* ---- Crop column ---- */
.card-crop-col {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text3, #64748b);
  line-height: 1.4;
}

.crop-canvas {
  max-width: 300px;
  max-height: 380px;
  display: block;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  background: #111;
  touch-action: none;
  cursor: crosshair;
}
[data-theme="light"] .crop-canvas {
  border-color: #e2e8f0;
  background: #f1f5f9;
}

.card-warn {
  margin: 0;
  font-size: 0.8rem;
  color: #f59e0b;
  font-weight: 600;
  line-height: 1.4;
}

.card-face-status {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text3, #64748b);
}
.card-face-status.face-ok    { color: #34d399; }
.card-face-status.face-warn  { color: #f59e0b; }
.card-face-status.face-info  { color: #94a3b8; }

/* ---- Preview column ---- */
.card-preview-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 110px;
}

.card-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.card-preview-img {
  display: block;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 6px;
  background: #1a1b2e;
  image-rendering: auto;
  max-width: 150px;
  max-height: 200px;
  width: auto;
  height: auto;
}
[data-theme="light"] .card-preview-img {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.card-preview-caption {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text3, #64748b);
}

.card-size-info {
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 1.2em;
  text-align: center;
  margin: 0;
  color: var(--text2, #94a3b8);
}
.card-size-info.ok  { color: #34d399; }
.card-size-info.bad { color: #f87171; }

.card-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  font-family: inherit;
}
.card-download-btn svg { width: 14px; height: 14px; }
.card-download-btn:hover:not(.disabled) { opacity: 0.85; transform: translateY(-1px); }
.card-download-btn.disabled {
  background: var(--border, rgba(255,255,255,0.08));
  color: var(--text3, #64748b);
  pointer-events: none;
}
[data-theme="light"] .card-download-btn.disabled {
  background: #e2e8f0;
  color: #94a3b8;
}

/* ---- Empty state ---- */
.pr-empty {
  text-align: center;
  padding: 3rem 1rem;
}
.pr-empty-msg {
  color: var(--text3, #64748b);
  font-size: 0.95rem;
}

/* ---- Responsive ---- */
@media (max-width: 660px) {
  .pr-cards-grid {
    grid-template-columns: 1fr;
  }
  .card-body {
    flex-direction: column;
  }
  .card-preview-col {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .pr-hero-icon { font-size: 2rem; }
  .pr-hero-title { font-size: 1.35rem; }
  .pr-settings-inner { gap: 0.6rem; }
  .pr-setting-input { width: 75px; }
}

@media (max-width: 480px) {
  .pr-hero-inner { gap: 0.75rem; }
  .pr-hero-sub { font-size: 0.82rem; }
}
