/* Custom Stickers CSS */
.custom-stickers-section {
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.custom-stickers-title {
  font-family: "Arial Black", Gadget, sans-serif;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 4rem;
  text-rendering: optimizeLegibility;

  color: rgba(0, 0, 0, 0.6);
  text-shadow: 3px 2px 3px rgba(255, 255, 255, 0.2);
  opacity: 0;
  animation: FadeIn 3s ease-out forwards 1;
  animation-delay: 1s;
}

@keyframes FadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.custom-stickers-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.upload-section {
  flex: 1;
  min-width: 300px;
  background: var(--color-light);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--color-primary);
}

.preview-section {
  flex: 1;
  min-width: 300px;
  background: var(--color-light);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--color-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-section h2,
.preview-section h2 {
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.upload-area {
  border: 2px dashed var(--color-secondary);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: rgba(108, 92, 231, 0.05);
  position: relative;
}

.upload-area:hover,
.upload-area:focus-within {
  border-color: var(--color-primary);
  background-color: rgba(108, 92, 231, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.upload-area i {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.upload-area p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.upload-btn {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 1rem;
  font-weight: bold;
  border: none;
  font-family: "Comic Neue", cursive, sans-serif;
  text-decoration: none;
}

.upload-btn:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

#file-input {
  display: none;
}

.preview-container {
  width: 100%;
  max-width: 400px;
  height: 400px;
  border: 3px solid var(--color-primary);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: var(--color-light);
  box-shadow: var(--shadow-md);
  position: relative;
  background: linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
    linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.preview-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: none;
  object-fit: contain;
  /* REMOVED white border - showing original image only */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: none !important;
}

.preview-placeholder {
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  z-index: 5;
}

.preview-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

.preview-placeholder p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.preview-placeholder .border-note {
  font-size: 0.9rem;
  color: var(--color-primary);
  font-weight: bold;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(108, 92, 231, 0.1);
  border-radius: 8px;
}

.sticker-options {
  width: 100%;
  margin-top: 1.5rem;
}

.option-group {
  margin-bottom: 1.5rem;
}

.option-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: var(--text-primary);
}

.option-group select,
.option-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid var(--color-secondary);
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Comic Neue", cursive, sans-serif;
  background: var(--color-light);
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

.option-group select:focus,
.option-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* Remove Image Button */
.remove-image-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  margin-top: 1rem;
  transition: all var(--transition-normal);
  font-family: "Comic Neue", cursive, sans-serif;
  box-shadow: var(--shadow-sm);
  display: none;
}

.remove-image-btn:hover {
  background: #ff4d8d;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sticker-details {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(108, 92, 231, 0.05);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-secondary);
}

.sticker-details h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.5rem;
  text-align: center;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding: 0.3rem 0;
}

.detail-label {
  font-weight: bold;
  color: var(--text-primary);
}

.detail-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.total-row {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 2px solid var(--color-secondary);
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.add-to-cart-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  width: 100%;
  margin-top: 1.5rem;
  transition: all var(--transition-normal);
  font-family: "Comic Neue", cursive, sans-serif;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn:hover:not(:disabled) {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.add-to-cart-btn:disabled {
  background: var(--color-dark);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.add-to-cart-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-normal);
}

.add-to-cart-btn:hover:not(:disabled)::after {
  opacity: 0.2;
}

.file-info {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 5px;
  text-align: center;
  white-space: pre-line;
}

.file-info.success {
  color: var(--color-success);
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid var(--color-success);
}

.file-info.error {
  color: var(--color-accent);
  background: rgba(253, 121, 168, 0.1);
  border: 1px solid var(--color-accent);
}

.file-info.warning {
  color: #ff9f43;
  background: rgba(255, 159, 67, 0.1);
  border: 1px solid #ff9f43;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for accessibility */
.upload-btn:focus-visible,
.add-to-cart-btn:focus-visible,
.option-group select:focus-visible,
.option-group input:focus-visible,
.remove-image-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Dark mode adjustments */
body.dark-mode .upload-area {
  background: rgba(108, 92, 231, 0.1);
}

body.dark-mode .sticker-details {
  background: rgba(108, 92, 231, 0.1);
}

body.dark-mode .preview-container {
  background: #3d3d3d;
  background-image: linear-gradient(45deg, #555 25%, transparent 25%),
    linear-gradient(-45deg, #555 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #555 75%),
    linear-gradient(-45deg, transparent 75%, #555 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

body.dark-mode .preview-placeholder {
  background: rgba(45, 45, 45, 0.95);
}

body.dark-mode .preview-placeholder .border-note {
  background: rgba(108, 92, 231, 0.2);
  color: var(--color-secondary);
}

body.dark-mode .option-group select,
body.dark-mode .option-group input {
  background: #3d3d3d;
  color: var(--color-dark);
  border-color: #555;
}

/* Responsive design */
@media (max-width: 768px) {
  .custom-stickers-container {
    flex-direction: column;
  }

  .upload-section,
  .preview-section {
    width: 100%;
  }

  .custom-stickers-title {
    font-size: 2rem;
  }

  .preview-container {
    max-width: 350px;
    height: 350px;
  }
}

@media (max-width: 480px) {
  .upload-section,
  .preview-section {
    padding: 1.5rem;
  }

  .upload-area {
    padding: 1.5rem;
  }

  .custom-stickers-title {
    font-size: 1.8rem;
  }

  .preview-container {
    max-width: 300px;
    height: 300px;
  }

  .preview-placeholder i {
    font-size: 3rem;
  }

  .preview-placeholder .border-note {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  @media (max-width: 375px) {
    .custom-stickers-title {
      font-size: 1.6rem;
      width: 450px;
      margin-left: -25%;
      margin-bottom: 1rem;
    }

    .upload-section,
    .preview-section {
      padding: 1rem;
      min-width: 325px;
      margin-left: -5%;
    }

    .upload-section h2 {
      margin-bottom: 1rem;
    }

    .custom-stickers-section {
      padding: 0;
    }
  }
}
