/* Listing Thumbnail Tester - Warm & Friendly Styling */

/* CSS Custom Properties */
:root {
  /* Core Colors - Vibrant pastel base */
  --color-bg: #FFF9FB;
  --color-bg-alt: #FFF0F5;
  --color-card: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-muted: #666666;
  --color-border: #F0D4E0;
  --color-border-light: #FBE8F0;

  /* Accent Colors - Vibrant pink */
  --color-primary: #FF6B9D;
  --color-primary-hover: #FF4785;
  --color-secondary: #6DD4B8;

  /* Semantic Colors - Vibrant pastels */
  --color-critical: #FF6B6B;
  --color-critical-bg: #FFE8E8;
  --color-warning: #FFAA5C;
  --color-warning-bg: #FFF4E6;
  --color-success: #4DD4A0;
  --color-success-bg: #E6FFF5;
  --color-info: #6BB8FF;
  --color-info-bg: #E8F4FF;

  /* Typography */
  --font-heading: 'Bebas Neue', Impact, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Shadows - soft pink tint */
  --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.08);
  --shadow-md: 0 4px 16px rgba(255, 107, 157, 0.1);
  --shadow-lg: 0 8px 32px rgba(255, 107, 157, 0.12);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin: 0 0 1rem 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  text-align: center;
  padding: 2rem 0 3rem;
}

header p {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 0.5rem;
}

header .subheading {
  font-size: 0.95rem;
}

/* Sections */
section {
  background: white;
  margin-bottom: 2rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

section:nth-child(even) {
  background: var(--color-bg-alt);
}

section h2 {
  margin-top: 0;
}

section > p {
  color: var(--color-text-muted);
}

/* Privacy Note */
.privacy-note {
  font-size: 0.875rem;
  color: var(--color-success);
  background: var(--color-success-bg);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* Tool Note */
.tool-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-info-bg);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.tool-note strong {
  color: var(--color-text);
}

.tool-note a {
  color: var(--color-info);
  font-weight: 500;
}

/* Buttons */
button {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

button:not(.remove-btn) {
  background: var(--color-primary);
  color: white;
}

button:not(.remove-btn):hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.remove-btn {
  background: transparent;
  color: var(--color-text-muted);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
}

.remove-btn:hover {
  background: var(--color-critical-bg);
  color: var(--color-critical);
  border-color: var(--color-critical);
}

/* Form Elements */
label {
  font-size: 0.9375rem;
  color: var(--color-text);
}

select {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--color-text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B635A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

select:hover {
  border-color: var(--color-primary);
}

select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Upload Section */
#drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  background: white;
}

#drop-zone:hover {
  border-color: var(--color-primary);
  background: rgba(255, 107, 157, 0.06);
}

#drop-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(255, 107, 157, 0.1);
}

#drop-zone.loading {
  pointer-events: none;
  opacity: 0.7;
}

#drop-zone p {
  color: var(--color-text-muted);
  margin: 0;
}

#file-input {
  display: none;
}

#upload-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 251, 247, 0.95);
  border-radius: var(--radius-md);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Uploaded Images */
#uploaded-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.uploaded-image-item {
  background: white;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 180px;
}

.uploaded-image-item img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.image-info {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  gap: 0.125rem;
}

.image-name {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.image-dimensions,
.image-ratio {
  color: var(--color-text-muted);
}

.image-info .warning {
  color: var(--color-warning);
  font-size: 0.6875rem;
  margin-top: 0.25rem;
}

/* Preview Controls */
#preview-controls,
#adjustment-controls,
#simulation-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Crop Preview Grid */
#crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.crop-preview {
  background: white;
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.crop-preview h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.crop-info {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0 0 0.25rem 0;
}

.crop-description {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

/* Crop Containers */
.crop-container {
  position: relative;
  width: 100%;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.crop-container.square {
  aspect-ratio: 1 / 1;
}

.crop-container.landscape-4-3 {
  aspect-ratio: 4 / 3;
}

.crop-container.landscape-5-4 {
  aspect-ratio: 5 / 4;
}

.crop-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-frame .placeholder {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* Safe Zone Overlay */
.safe-zone-overlay {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(255, 107, 157, 0.6);
  box-shadow: inset 0 0 0 15% rgba(255, 107, 157, 0.1);
  pointer-events: none;
  border-radius: var(--radius-sm);
}

.safe-zone-overlay.hidden {
  display: none;
}

/* Search Grid Simulation */
#search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 800px) {
  #search-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.search-item {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.search-item:hover {
  box-shadow: var(--shadow-md);
}

.search-thumbnail {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--color-bg-alt);
}

.competitor-label {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.your-listing-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--color-primary);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.search-item-info {
  padding: 0.75rem;
  font-size: 0.8125rem;
}

.item-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.item-price {
  color: var(--color-text);
  font-weight: 600;
}

.item-shop {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.free-shipping {
  color: var(--color-success);
  font-size: 0.6875rem;
  font-weight: 500;
}

.user-item {
  box-shadow: 0 0 0 2px var(--color-primary), var(--shadow-md);
}

/* Mobile Search Grid */
#mobile-search-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-width: 400px;
}

.mobile-thumbnail {
  aspect-ratio: 4 / 3 !important;
}

/* Comparison Grid */
#comparison-grid {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.comparison-item {
  text-align: center;
}

.comparison-thumbnail {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.comparison-info {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.comparison-name {
  display: block;
  font-weight: 500;
  color: var(--color-text);
}

.comparison-dimensions {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.no-images {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Readability Check */
#readability-sizes {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.size-preview {
  text-align: center;
}

.size-preview h3 {
  margin-bottom: 0.25rem;
}

.size-info {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.size-container {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.size-container.large {
  width: 300px;
  height: 300px;
}

.size-container.medium {
  width: 200px;
  height: 200px;
}

.size-container.small {
  width: 120px;
  height: 120px;
}

.size-container.tiny {
  width: 70px;
  height: 70px;
}

.size-container .placeholder {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Tips Section */
#tips-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.tips-group {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 3px solid;
}

.tips-group h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin: 0 0 0.625rem 0;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tips-group.critical {
  background: var(--color-critical-bg);
  border-color: var(--color-critical);
}

.tips-group.critical h4 {
  color: var(--color-critical);
}

.tips-group.warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
}

.tips-group.warning h4 {
  color: var(--color-warning);
}

.tips-group.tip {
  background: var(--color-success-bg);
  border-color: var(--color-success);
}

.tips-group.tip h4 {
  color: var(--color-success);
}

.tips-group.info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
}

.tips-group.info h4 {
  color: var(--color-info);
}

.tip-item {
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: var(--color-text);
}

.tip-item:last-child {
  margin-bottom: 0;
}

.tip-item strong {
  color: inherit;
}

/* Crop Adjustment Tool */
#crop-recommendation {
  margin-bottom: 1.25rem;
}

.recommendation {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border-left: 3px solid;
}

.recommendation.success {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.recommendation.warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.recommendation.info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
  color: var(--color-info);
}

/* Crop Tools Grid */
#crop-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.crop-tool-item {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.crop-tool-item h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
}

.crop-tool-context {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem 0;
}

.crop-tool-container {
  display: none;
}

.original-image-wrapper {
  position: relative;
  display: inline-block;
  line-height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  width: 100%;
}

.adjustment-original-image {
  width: 100%;
  display: block;
}

.crop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crop-area {
  position: absolute;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(45, 42, 38, 0.5);
  border: 2px dashed white;
  cursor: move;
  transition: box-shadow 0.15s;
  pointer-events: auto;
}

.crop-area:hover {
  border-color: var(--color-primary);
}

.crop-area.dragging {
  border-color: var(--color-primary);
  border-style: solid;
}

#drag-instructions {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.crop-result-preview {
  margin-top: 0.75rem;
}

.crop-result-preview h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.crop-result-image {
  width: 100%;
  max-width: 150px;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Mobile: stack crop tools vertically */
@media (max-width: 800px) {
  #crop-tools-grid {
    grid-template-columns: 1fr;
  }

  .crop-result-image {
    max-width: 200px;
  }
}

/* FAQ Section */
#faq-section h2 {
  margin-bottom: 1.25rem;
}

details {
  margin-bottom: 0.5rem;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

details summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details summary:hover {
  background: var(--color-bg-alt);
}

details[open] summary {
  border-bottom: 1px solid var(--color-border-light);
}

details p,
details ul {
  padding: 1rem 1.25rem;
  margin: 0;
  color: var(--color-text);
  font-size: 0.9375rem;
}

details ul {
  padding-left: 2.5rem;
}

details li {
  margin-bottom: 0.375rem;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--color-primary);
}

.footer-keywords {
  font-size: 0.6875rem;
  color: var(--color-border);
  margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  section {
    padding: 1.25rem;
  }

  header {
    padding: 1rem 0 2rem;
  }

  header p {
    font-size: 1rem;
  }

  #preview-controls,
  #adjustment-controls,
  #simulation-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  #readability-sizes {
    justify-content: center;
  }

  .size-container.large {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 1;
  }
}
