/* Main page styles */
:root {
  --color-primary: #007bff;
  --color-secondary: #6c757d;
  --color-success: #28a745;
  --color-info: #17a2b8;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-light: #f8f9fa;
  --color-dark: #343a40;
  --color-white: #ffffff;
  --color-gray: #6c757d;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  --border-radius: 0.5rem;
}

/* Message Container */
.message-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: transparent;
  color: #2563eb;
  font-weight: 500;
  z-index: 20;
  text-align: center;
  width: calc(100% - 300px); /* Adjust based on your nav buttons width */
  height: 60px;
}

/* Main Content Layout */
main {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 80px;
}

/* Main content wrapper */
#app {
  min-height: calc(100vh - 60px);
  overflow-x: hidden;
  padding-bottom: 120px;
}

/* Step container styles */
.step {
  display: none;
  min-height: calc(100vh - 80px);
  padding: 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2rem;
}

.step-title {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.75rem;
  color: #1e293b;
  font-weight: 600;
}

/* Quantity Selection Container */
.quantity-selection {
  width: 100%;
  max-width: 400px;
  margin-bottom: 2rem;
}

.quantity-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border: 2px solid #e2e8f0;
}

.quantity-input label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
}

.quantity-input input {
  width: 100%;
  max-width: 200px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.quantity-input input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Grid and Content Layout */
.options-grid {
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

/* Option Card Styles */
.option-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.option-card img {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
}

.option-card h3 {
  margin: 0.5rem 0;
  font-size: 1.25rem;
  color: #1e293b;
}

.option-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  line-height: 1.4;
}

.option-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.1);
}

.option-card.selected {
  border-color: #3b82f6;
  background-color: #f0f7ff;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.15);
}

/* Custom Size and Quantity Container */
.custom-size,
.custom-quantity {
  width: 100%;
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border: 2px solid #e2e8f0;
  position: relative;
  z-index: 1;
  text-align: center;
}

.custom-size label,
.custom-quantity label {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.75rem;
  text-align: center;
}

.custom-input {
  width: 100%;
  max-width: 200px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  background: white;
  margin: 0 auto;
  display: block;
}

/* File Upload Container */
.file-upload {
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  text-align: center;
  position: relative;
}

.file-upload input[type="file"] {
  display: none;
}

.file-upload label {
  cursor: pointer;
  padding: 1rem 2rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.file-upload label:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
}

/* File Preview Styles */
.file-preview {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 300px;
  position: relative;
}

.file-preview img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.remove-file {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  background: #ef4444;
  border: none;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.remove-file:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Instructions textarea */
.instructions-textarea {
  width: 100%;
  max-width: 500px;
  margin: 2rem auto;
  display: block;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  resize: none;
  min-height: 150px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

/* Navigation buttons */
.navigation-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: white;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  z-index: 19;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  border-top: 1px solid #e2e8f0;
}

.nav-button {
  padding: 0.7rem 2rem;
  border: none;
  border-radius: 5px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Design help form styles */
.design-help-form {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.form-group textarea:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Responsive Optimizations */
@media (max-width: 768px) {
  /* Adjust grid for smaller screens */
  .options-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
  }

  /* Make option cards more compact */
  .option-card {
    height: auto;
    min-height: 140px;
    padding: 1rem;
  }

  .option-card img {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem;
  }

  .option-card h3 {
    font-size: 1rem;
    margin: 0.25rem 0;
  }

  .option-card p {
    font-size: 0.875rem;
    line-height: 1.3;
  }

  /* Adjust step title size */
  .step-title {
    font-size: 1.25rem;
    margin: 0.5rem 0;
  }

  /* Make custom inputs more compact */
  .custom-size,
  .custom-quantity {
    padding: 1rem;
    margin: 1rem auto;
  }

  .custom-input {
    padding: 0.5rem;
    font-size: 0.875rem;
  }

  /* Adjust file upload area */
  .file-upload {
    padding: 1rem;
    margin: 1rem auto;
  }

  .file-upload label {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  /* Adjust navigation buttons */
  .navigation-buttons {
    padding: 0 1rem;
  }

  .nav-button {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
  }

  /* Adjust form elements */
  .form-group input[type="text"],
  .form-group textarea {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .step {
    padding: 0.5rem;
  }

  .option-card {
    min-height: 120px;
  }

  .option-card img {
    width: 32px;
    height: 32px;
  }

  .option-card h3 {
    font-size: 0.875rem;
  }

  .option-card p {
    font-size: 0.75rem;
  }

  .nav-button {
    padding: 0.5rem 1rem;
    font-size: 0.813rem;
  }

  .message-container {
    width: calc(100% - 200px); /* Smaller width for mobile */
    font-size: 0.75rem;
    padding: 0.25rem;
  }

  /* Adjust form elements further */
  .form-group label {
    font-size: 0.875rem;
  }

  .form-group input[type="text"],
  .form-group textarea {
    font-size: 0.813rem;
  }
}

/* Color Picker Styles */
.color-picker {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  max-width: 100%;
  margin: 0 auto;
}

.color-spectrum {
  position: relative;
  width: 300px;
  height: 300px;
  border: 2px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  touch-action: none; /* Prevents scrolling while using the color picker on mobile */
}

.color-gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, white 0%, transparent 100%);
}

.color-pointer {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.color-slider {
  width: 300px;
  height: 20px;
  -webkit-appearance: none;
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%
  );
  border-radius: 4px;
  border: 2px solid #ccc;
}

.color-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
}

.color-info {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.color-preview {
  width: 60px;
  height: 60px;
  border: 2px solid #ccc;
  border-radius: 8px;
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.color-value {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.color-value label {
  font-size: 0.875rem;
  color: #666;
}

.color-value input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: monospace;
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
  .color-picker {
    padding: 0.5rem;
  }

  .color-spectrum {
    width: 100%;
    max-width: 300px;
    height: 250px; /* Slightly smaller height on mobile */
    margin: 0 auto;
  }

  .color-slider {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .color-info {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .color-preview {
    width: 50px;
    height: 50px;
  }

  .color-values {
    width: 100%;
  }

  .color-value input {
    width: 100%;
    font-size: 14px; /* Slightly smaller font size on mobile */
  }

  .quantity-selection {
    order: -1; /* Makes it appear at the top only on mobile */
    margin-bottom: 1.5rem;
  }

  .quantity-input {
    padding: 1rem;
  }

  .quantity-input label {
    font-size: 1rem;
  }

  .quantity-input input {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .color-spectrum {
    height: 200px; /* Even smaller height for very small screens */
  }

  .color-preview {
    width: 40px;
    height: 40px;
  }

  .color-value input {
    font-size: 12px;
  }

  .quantity-selection {
    margin-bottom: 1rem;
  }

  .quantity-input {
    padding: 0.75rem;
  }

  .quantity-input label {
    font-size: 0.875rem;
  }

  .quantity-input input {
    padding: 0.5rem;
    font-size: 0.813rem;
  }
}