/* Background Remover Styles */

/* Main Section */
.page {
  /* expose shared section padding so global title offset calculation works */
  --section-padding-top: 2.25rem;
  padding: var(--section-padding-top) 1rem;
  min-height: calc(100vh - 200px);
}

.content {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.highlights-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.highlight-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(8, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 20, 0.08);
  transition:
    transform 0.35s ease,
    border-color 0.35s ease;
  backdrop-filter: blur(18px);
}

.highlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(57, 255, 20, 0.35),
    rgba(0, 240, 255, 0.35)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.highlight-card:hover {
  transform: translateY(-6px);
}

.highlight-card:hover::after {
  opacity: 1;
}

.highlight-card__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.6);
}

.highlight-card__title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.2rem;
  color: #e0ffef;
}

.highlight-card__text {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.helper-card {
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(5, 12, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.helper-card__header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.helper-card__icon {
  width: 48px;
  height: 48px;
}

.helper-card__eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.helper-card__title {
  margin: 0.1rem 0 0;
  font-size: 1.35rem;
  color: #f5fff4;
}

.helper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.helper-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  position: relative;
  padding-left: 1.25rem;
}

.helper-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39ff14;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.45);
}

.helper-status {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.25);
}

.helper-status__pill {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #39ff14;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: rgba(57, 255, 20, 0.15);
}

.helper-status__text {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Upload Area */
.upload-area {
  border: 2px dashed rgba(57, 255, 20, 0.35);
  border-radius: 20px;
  padding: clamp(2rem, 4vw, 3.5rem) 2rem;
  text-align: center;
  background: rgba(7, 13, 25, 0.85);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(0, 240, 255, 0.08),
    0 20px 45px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: rgba(57, 255, 20, 0.75);
  background: rgba(57, 255, 20, 0.05);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 25px 55px rgba(57, 255, 20, 0.2);
}

.upload-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  opacity: 0.8;
}

.upload-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
}

.upload-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.upload-formats {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
}

#fileInput {
  display: none;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  background: #39ff14;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(57, 255, 20, 0.3);
}

.upload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(57, 255, 20, 0.4);
}

.upload-button:active {
  transform: translateY(0);
}

.button-icon {
  width: 20px;
  height: 20px;
}

/* Processing Status */
.processing-status {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-top: 2rem;
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  border: 4px solid rgba(57, 255, 20, 0.2);
  border-top-color: #39ff14;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.processing-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.processing-subtext {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Preview Area */
.preview-area {
  margin-top: 2rem;
  background: rgba(3, 6, 15, 0.85);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.35);
}

.workspace-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.58fr) minmax(0, 0.42fr);
  gap: 1.5rem;
  align-items: start;
}

.workspace-visuals {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.workspace-visuals > * {
  margin: 0;
}

.workspace-panel .tip-banner,
.workspace-panel .download-options {
  margin-bottom: 0;
}

/* Controls Area */
.controls-area {
  background: rgba(5, 12, 24, 0.85);
  border: 1px solid rgba(57, 255, 20, 0.15);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

/* Control Sections */
.control-section {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-section__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.control-section__icon {
  width: 20px;
  height: 20px;
  color: #39ff14;
}

.control-section__title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.control-section__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-section__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .control-section__row {
    grid-template-columns: 1fr;
  }
}

.control-group {
  margin-bottom: 0;
}

.control-group:last-of-type {
  margin-bottom: 0;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e0ffef;
  margin-bottom: 0.5rem;
}

.control-label span:first-child {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.control-label-icon {
  width: 16px;
  height: 16px;
  color: #00f0ff;
  opacity: 0.8;
}

.control-value {
  background: linear-gradient(
    135deg,
    rgba(57, 255, 20, 0.25),
    rgba(0, 240, 255, 0.15)
  );
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #39ff14;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  min-width: 36px;
  text-align: center;
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.control-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
}

.control-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(57, 255, 20, 0.25);
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #39ff14;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(57, 255, 20, 0.5);
  transition: all 0.2s ease;
  margin-top: -6px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.control-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 15px rgba(57, 255, 20, 0.7);
}

.control-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(57, 255, 20, 0.25);
}

.control-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #39ff14;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 10px rgba(57, 255, 20, 0.5);
  transition: all 0.2s ease;
}

.control-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 15px rgba(57, 255, 20, 0.7);
}

.control-slider:focus {
  outline: none;
}

.control-slider:focus::-webkit-slider-thumb {
  box-shadow:
    0 0 0 3px rgba(57, 255, 20, 0.2),
    0 2px 10px rgba(57, 255, 20, 0.5);
}

.control-hint {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0.35rem 0 0 0;
  font-style: italic;
}

/* Mode Buttons */
.mode-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mode-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(57, 255, 20, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mode-btn:hover {
  border-color: rgba(57, 255, 20, 0.4);
  color: #fff;
  transform: translateY(-2px);
}

.mode-btn:hover::before {
  opacity: 1;
}

.mode-btn.active {
  background: rgba(57, 255, 20, 0.15);
  border-color: #39ff14;
  color: #39ff14;
  box-shadow:
    0 0 20px rgba(57, 255, 20, 0.2),
    inset 0 0 0 1px rgba(57, 255, 20, 0.1);
}

.mode-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background: #39ff14;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.mode-btn svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.mode-btn span {
  position: relative;
  z-index: 1;
}

.mode-btn__hint {
  font-size: 0.65rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
  margin-top: 0.15rem;
}

.mode-btn.active .mode-btn__hint {
  color: rgba(57, 255, 20, 0.7);
}

@media (max-width: 640px) {
  .mode-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .mode-buttons {
    grid-template-columns: 1fr;
  }

  .mode-btn {
    flex-direction: row;
    padding: 0.75rem 1rem;
  }

  .mode-btn__hint {
    display: none;
  }
}

/* Color Picker */
.color-picker-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-input {
  width: 50px;
  height: 40px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-input::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

.eyedropper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.eyedropper-btn:hover,
.eyedropper-btn.active {
  background: rgba(57, 255, 20, 0.2);
  border-color: #39ff14;
  color: #39ff14;
}

.color-value {
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  min-width: 80px;
  text-align: center;
}

/* Advanced Toggle */
.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(176, 38, 255, 0.08);
  border: 1px solid rgba(176, 38, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.advanced-toggle:hover {
  background: rgba(176, 38, 255, 0.15);
  border-color: rgba(176, 38, 255, 0.4);
  color: #fff;
}

.advanced-toggle svg:first-child {
  color: #b026ff;
}

.advanced-toggle .chevron {
  margin-left: auto;
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
}

.advanced-toggle.open {
  background: rgba(176, 38, 255, 0.12);
  border-color: rgba(176, 38, 255, 0.35);
  color: #fff;
}

.advanced-toggle.open .chevron {
  transform: rotate(180deg);
  color: #b026ff;
}

/* Advanced Options Panel */
.advanced-options {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  border: 1px solid rgba(176, 38, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: slideDown 0.3s ease;
}

.advanced-options__section {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.control-label--section {
  margin-bottom: 0.75rem;
  color: #00f0ff;
}

/* Output Background Options */
.output-bg-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.output-bg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.output-bg-btn:hover {
  border-color: rgba(57, 255, 20, 0.4);
  color: #fff;
}

.output-bg-btn.active {
  background: rgba(57, 255, 20, 0.1);
  border-color: #39ff14;
  color: #39ff14;
}

.output-bg-btn__preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.output-bg-btn__preview--checkered {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.3) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.3) 75%);
  background-size: 8px 8px;
  background-position:
    0 0,
    0 4px,
    4px -4px,
    -4px 0px;
  background-color: rgba(128, 128, 128, 0.3);
}

.output-bg-color-input {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.output-bg-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.output-bg-color-input::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

@media (max-width: 480px) {
  .output-bg-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.advanced-options__sliders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.advanced-options__checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.advanced-options .control-group--checkbox {
  grid-column: span 1;
}

@media (max-width: 900px) {
  .advanced-options__sliders {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .advanced-options__sliders {
    grid-template-columns: 1fr;
  }

  .advanced-options__checkboxes {
    grid-template-columns: 1fr;
  }
}

/* Control Group Modifiers */
.control-group--full {
  grid-column: 1 / -1;
}

.control-group--color {
  grid-column: 1 / -1;
}

/* Checkbox Styles */
.control-group--checkbox {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
  min-height: auto;
}

.control-group--checkbox:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(57, 255, 20, 0.15);
}

.control-group--checkbox .control-hint {
  margin-left: 0;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.checkbox-label:hover .checkbox-custom {
  border-color: rgba(57, 255, 20, 0.5);
  background: rgba(57, 255, 20, 0.05);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: #39ff14;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(57, 255, 20, 0.4);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #000;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Tip Banner */
.tip-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(0, 240, 255, 0.1),
    rgba(57, 255, 20, 0.1)
  );
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  animation: tipFadeIn 0.3s ease;
}

@keyframes tipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tip-icon {
  flex-shrink: 0;
  color: #00f0ff;
}

.tip-text {
  flex: 1;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.tip-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tip-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 0;
}

.preview-card {
  background: rgba(5, 12, 24, 0.7);
  border-radius: 18px;
  padding: 1.25rem;
  border: 1px solid rgba(57, 255, 20, 0.18);
  backdrop-filter: blur(15px);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
  min-height: 100%;
}

.preview-download {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
}

.preview-download .download-button {
  width: auto;
  padding: 0.65rem 1rem;
}

.preview-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #00f0ff;
  text-align: center;
}

.preview-image-container {
  position: relative;
  width: 100%;
  min-height: clamp(100px, 15vw, 180px);
  max-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.preview-image-container--checkered {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0px;
  background-color: rgba(0, 0, 0, 0.3);
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.preview-info {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Download Options */
.download-options {
  display: flex;
  gap: 0.75rem;
  margin-top: 0;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    rgba(5, 12, 24, 0.95),
    rgba(10, 20, 35, 0.9)
  );
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(57, 255, 20, 0.1);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.download-button,
.reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.download-button {
  color: #000;
  background: #39ff14;
  box-shadow: 0 4px 20px rgba(57, 255, 20, 0.35);
}

.download-button:hover {
  transform: translateY(-3px);
  background: #4dff2e;
  box-shadow: 0 8px 25px rgba(57, 255, 20, 0.5);
}

.download-button:active {
  transform: translateY(-1px);
}
.reset-button {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.reset-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.15);
}

/* Icon-only buttons */
.icon-only {
  padding: 0.85rem;
  width: 48px;
  height: 48px;
}

.icon-only .button-icon {
  width: 22px;
  height: 22px;
}

@media (max-width: 480px) {
  .download-options {
    flex-wrap: wrap;
  }
}

/* Error Message */
.error-message {
  background: rgba(255, 16, 240, 0.1);
  border: 1px solid rgba(255, 16, 240, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.error-icon {
  width: 32px;
  height: 32px;
  color: #ff10f0;
  flex-shrink: 0;
}

.error-text {
  color: #fff;
  margin: 0;
  flex: 1;
}

/* Features Section */
.features-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(57, 255, 20, 0.2);
}

.features-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(5, 12, 24, 0.75);
  border: 1px solid rgba(57, 255, 20, 0.18);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}

.feature-card:hover {
  border-color: #39ff14;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(57, 255, 20, 0.2);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #00f0ff;
}

.feature-description {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

/* How to Use Section */
.howto-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(57, 255, 20, 0.2);
}

.howto-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #fff;
}

.howto-list {
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
  counter-reset: howto-counter;
}

.howto-item {
  position: relative;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  counter-increment: howto-counter;
}

.howto-item::before {
  content: counter(howto-counter);
  position: absolute;
  left: -2rem;
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #39ff14;
  color: #000;
  font-weight: 700;
  border-radius: 50%;
  font-size: 0.875rem;
}

.howto-item strong {
  color: #00f0ff;
  font-weight: 600;
}

/* FAQ Section */
.faq-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(57, 255, 20, 0.2);
  margin-bottom: 2rem;
}

.faq-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #fff;
}

.faq-list {
  max-width: 900px;
  margin: 0 auto;
}

.faq-item {
  background: rgba(5, 12, 24, 0.75);
  border: 1px solid rgba(57, 255, 20, 0.18);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
}

.faq-item:hover {
  border-color: #39ff14;
  background: rgba(57, 255, 20, 0.05);
}

.faq-question {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #00f0ff;
}

.faq-answer {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .workspace-panel {
    grid-template-columns: 1fr;
  }

  .workspace-visuals {
    position: static;
  }

  .preview-area {
    padding: 1.5rem 1rem;
  }

  .controls-area {
    margin-bottom: 1rem;
  }
}

@media (max-width: 900px) {
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 2rem 1rem;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .helper-card {
    order: initial;
  }

  .upload-area {
    padding: 2rem 1rem;
  }

  .upload-icon {
    width: 60px;
    height: 60px;
  }

  .upload-title {
    font-size: 1.25rem;
  }

  .preview-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .download-options {
    flex-wrap: wrap;
  }

  .control-section__row {
    grid-template-columns: 1fr;
  }

  .howto-list {
    padding-left: 1rem;
  }

  .howto-item {
    padding-left: 1rem;
  }

  .howto-item::before {
    left: -1.5rem;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .upload-button {
    width: 100%;
    justify-content: center;
  }

  .color-picker-container {
    flex-wrap: wrap;
  }
}

/* Extra small devices improvements for phones */
@media (max-width: 420px) {
  .page {
    padding: 1.25rem 0.75rem;
  }

  .page__title {
    font-size: calc(var(--h1-size) * 0.9) !important;
    margin-bottom: calc(var(--h1-gap) * 0.9) !important;
  }

  .main-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .helper-card {
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
  }

  .upload-area {
    padding: 1.25rem 1rem;
    border-radius: 14px;
  }

  .upload-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
  }

  .upload-title {
    font-size: 1.1rem;
  }

  .preview-area {
    padding: 1rem;
  }

  .workspace-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .workspace-visuals {
    position: static;
    top: auto;
  }

  .preview-image-container {
    min-height: 120px;
    max-height: 180px;
  }

  .download-options {
    flex-direction: column;
    gap: 0.6rem;
  }

  .download-button,
  .reset-button {
    width: 100%;
  }

  .mode-buttons {
    grid-template-columns: 1fr;
  }

  .mode-btn {
    padding: 0.75rem 0.9rem;
  }

  .controls-area {
    padding: 1rem;
  }

  .preview-card {
    padding: 0.9rem;
  }

  .feature-card {
    padding: 1rem;
  }

  .howto-list {
    padding-left: 0.75rem;
  }

  .howto-item::before {
    left: -1.25rem;
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }
}

/* Additional mobile-friendly tweaks to improve usability on phones */
@media (max-width: 768px) {
  /* Make primary actions full width and easier to tap */
  .upload-button {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1.03rem;
    border-radius: 10px;
  }

  /* Ensure helper card sits below main upload area and uses compact spacing */
  .helper-card {
    order: 2;
    padding: 0.9rem;
    border-radius: 12px;
    font-size: 0.98rem;
  }

  /* Make preview images larger and more usable on small screens */
  .preview-image-container {
    min-height: 180px;
    max-height: 420px;
  }

  /* Stack workspace areas vertically and remove sticky behavior */
  .workspace-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .workspace-visuals {
    position: static;
    top: auto;
  }

  /* Make control area easier to interact with */
  .controls-area {
    padding: 1rem;
    gap: 1rem;
  }

  /* Make download/reset/donate buttons full width for easier tapping */
  .download-options {
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
  }

  .download-button,
  .reset-button {
    width: 100%;
  }

  .preview-download .download-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  /* Extra-small phones: slightly larger preview area and reduced paddings */
  .preview-image-container {
    min-height: 200px;
    max-height: 380px;
  }

  .upload-icon {
    width: 48px;
    height: 48px;
  }

  .upload-title {
    font-size: 1.05rem;
  }

  .helper-card__header {
    gap: 0.6rem;
  }
}

/* visual cue used when scrolling processed preview into view on mobile */
.mobile-highlight {
  box-shadow:
    0 0 0 3px rgba(57, 255, 20, 0.12),
    0 10px 30px rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  transition:
    box-shadow 0.35s ease,
    transform 0.25s ease;
  transform: translateY(-2px);
}
