/* ══════════════════════════════════════════════════
   ResizeKit — Dedicated Target KB Resizer Styles
   Clean, responsive, mobile-first design system
══════════════════════════════════════════════════ */

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

.tool-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0.75rem;
}
@media (min-width: 640px) {
  .tool-container {
    padding: 1.5rem 1rem;
  }
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
}
@media (min-width: 860px) {
  .tool-layout {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: start;
  }
}

.tool-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 1.15rem 1rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  width: 100%;
  min-width: 0;
  transform: none !important;
  transition: none !important;
}
.tool-layout .tool-card:hover {
  transform: none !important;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05)) !important;
}
.tool-layout .tool-card::before {
  display: none !important;
}
@media (min-width: 640px) {
  .tool-card {
    padding: 1.5rem;
  }
}

.tool-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ─── Privacy Badge ─── */
.privacy-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.45;
  width: 100%;
}
.privacy-badge span:first-child {
  font-size: 1rem;
  line-height: 1.2;
}

/* ─── Compact Upload Area ─── */
.upload-dropzone {
  position: relative;
  background: var(--card-bg, #ffffff);
  border: 2px dashed var(--primary, #6366f1);
  border-radius: var(--radius, 12px);
  padding: 1.25rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.85rem;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--primary-dark, #4f46e5);
}
.upload-dropzone .upload-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
  pointer-events: none;
}
.upload-dropzone h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.2rem;
  pointer-events: none;
}
.upload-dropzone p {
  font-size: 0.8rem;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.4rem;
  pointer-events: none;
}
.upload-cta-badge {
  display: inline-block;
  background: var(--primary, #6366f1);
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-sm, 8px);
  pointer-events: none;
}
.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

/* ─── Compact Post-Upload Bar ─── */
.upload-compact-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary, #f8fafc);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.85rem;
  gap: 0.65rem;
  width: 100%;
}
.upload-compact-bar.show {
  display: flex;
}
.upload-compact-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}
.upload-compact-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.upload-compact-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.upload-compact-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-compact-meta {
  font-size: 0.72rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-change-image {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text-primary, #0f172a);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-change-image:hover {
  background: var(--bg-tertiary, #f1f5f9);
  border-color: var(--primary-light, #818cf8);
}

/* ─── Hero Image Preview Container ─── */
.preview-wrapper {
  position: relative;
  background: #18181b;
  background-image: 
    linear-gradient(45deg, #27272a 25%, transparent 25%), 
    linear-gradient(-45deg, #27272a 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #27272a 75%), 
    linear-gradient(-45deg, transparent 75%, #27272a 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  border-radius: var(--radius-sm, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 200px;
  max-height: 380px;
  padding: 0.75rem;
  border: 1px solid var(--border, #e2e8f0);
  margin-bottom: 0.85rem;
  width: 100%;
}
.preview-wrapper img {
  max-width: 100%;
  max-height: 360px;
  height: auto;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border-radius: 4px;
  display: block;
}
.preview-empty-state {
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 1rem;
}

/* ─── Prominent Target & Comparison Cards ─── */
.target-highlight-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.02) 100%);
  border: 1.5px solid var(--primary-light, #818cf8);
  border-radius: var(--radius-sm, 8px);
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.target-highlight-left {
  display: flex;
  flex-direction: column;
}
.target-highlight-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-dark, #4f46e5);
}
.target-highlight-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}
.target-badge-pill {
  background: var(--primary, #6366f1);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ─── Before & After Results Card ─── */
.result-card {
  display: none;
  background: var(--bg-secondary, #f8fafc);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm, 8px);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  width: 100%;
}
.result-card.show {
  display: block;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}
.result-header h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #065f46;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.result-comparison-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 0.6rem 0.75rem;
}
.result-stat-box {
  display: flex;
  flex-direction: column;
}
.result-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary, #94a3b8);
}
.result-stat-value {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-top: 0.1rem;
}
.result-stat-value.success {
  color: #059669;
}
.result-arrow {
  color: var(--primary, #6366f1);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}
.result-meta-row {
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* ─── Advanced Options Accordion ─── */
.advanced-accordion {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-secondary, #f8fafc);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.advanced-toggle {
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  min-height: 44px;
}
.advanced-toggle span.caret {
  color: var(--primary, #6366f1);
  font-size: 0.75rem;
  transition: transform 0.2s;
}
.advanced-accordion.open .advanced-toggle span.caret {
  transform: rotate(180deg);
}
.advanced-body {
  display: none;
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--border-light, #f1f5f9);
}
.advanced-accordion.open .advanced-body {
  display: block;
}
.advanced-control-group {
  margin-top: 0.75rem;
}
.advanced-control-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.3rem;
}
.advanced-control-group select, .advanced-control-group input[type="number"] {
  width: 100%;
  min-height: 40px;
}

/* ─── Primary Download & Action Buttons ─── */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
  width: 100%;
  position: relative;
  z-index: 10;
}
@media (min-width: 480px) {
  .action-buttons {
    flex-direction: row;
  }
}
.btn-download-hero {
  flex: 2;
  background: var(--primary, #6366f1);
  color: #ffffff !important;
  text-decoration: none !important;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  user-select: none;
  position: relative;
  z-index: 11;
}
.btn-download-hero * {
  pointer-events: none;
}
.btn-download-hero:hover:not(.disabled):not([disabled]) {
  background: var(--primary-dark, #4f46e5);
  transform: translateY(-1px);
  color: #ffffff !important;
}
.btn-download-hero.disabled, .btn-download-hero[disabled], .btn-download-hero[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}
.btn-reset-secondary {
  flex: 1;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text-secondary, #64748b);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.btn-reset-secondary:hover {
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--text-primary, #0f172a);
}

/* ─── Progress Container ─── */
.progress-container {
  display: none;
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary, #f1f5f9);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.progress-container.show {
  display: block;
}
.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #6366f1) 0%, var(--primary-light, #818cf8) 100%);
  transition: width 0.2s ease;
}

/* ─── Target Presets Navigation (Compact on Mobile) ─── */
.target-presets-section {
  margin-top: 2rem;
  padding: 1.25rem 1rem;
  background: var(--bg-secondary, #f8fafc);
  border-radius: var(--radius, 12px);
  border: 1px solid var(--border, #e2e8f0);
  width: 100%;
}
@media (min-width: 640px) {
  .target-presets-section {
    padding: 1.5rem;
  }
}
.target-presets-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.35rem;
}
.target-presets-section p {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin-bottom: 1rem;
}
.quick-sizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.quick-size-chip {
  display: block;
  padding: 0.55rem 0.65rem;
  text-align: center;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  color: var(--text-primary, #0f172a);
  background: var(--card-bg, #ffffff);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-size-chip:hover {
  border-color: var(--primary, #6366f1);
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--primary, #6366f1);
}
.quick-size-chip.active {
  background: var(--primary, #6366f1);
  color: #ffffff;
  border-color: var(--primary, #6366f1);
}
.more-sizes-collapse {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.more-sizes-collapse.open {
  display: grid;
}
.btn-toggle-more-sizes {
  display: inline-block;
  margin-top: 0.85rem;
  background: transparent;
  border: 1px solid var(--border, #e2e8f0);
  color: var(--primary, #6366f1);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  min-height: 40px;
}
.btn-toggle-more-sizes:hover {
  background: var(--bg-tertiary, #f1f5f9);
}
