/* Create Page Styles */

/* Main Layout */
.create-container {
  max-width: 42rem; /* max-w-2xl */
  margin: 0 auto;
  padding: 1rem;
}

/* Section Styling */
.create-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

/* Autocomplete dropdown positioning - fixed positioning to escape stacking contexts */
[data-address-autocomplete-target="suggestions"] {
  position: fixed !important;
  z-index: 99999 !important;
  background: white !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
  max-height: 300px !important;
  overflow-y: auto !important;
}

.create-section:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Section Headers */
.create-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

/* Form Elements */
.create-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  background-color: #ffffff;
  color: #374151;
}

.create-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.create-input:read-only {
  background-color: #f9fafb;
  color: #6b7280;
}

/* Select dropdown specific styling */
.create-input[type="select"],
select.create-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
  cursor: pointer;
}

/* Placeholder styling for select - make it more prominent */
select.create-input option[value=""] {
  color: #6b7280;
  font-style: italic;
}

/* Make sure the selected option has proper color */
select.create-input:not(:invalid) {
  color: #374151;
}

/* When select has placeholder value selected, make it more visible but still distinguishable */
select.create-input:invalid {
  color: #6b7280;
  background-color: #fefefe;
  border-color: #d1d5db;
}

/* Required field indicator enhancement */
select.create-input:invalid:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Hover state for better interactivity feedback */
select.create-input:hover:not(:focus) {
  border-color: #9ca3af;
  background-color: #fefefe;
}

/* Grid Layouts */
.create-grid-2:not(.hidden) {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Image Upload Area */
.create-image-upload {
  min-height: 200px;
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.create-image-upload:hover {
  border-color: #9ca3af;
}

.create-image-upload.drag-over {
  border-color: #4f46e5;
  background-color: #eef2ff;
}

/* Results Area */
.create-results {
  min-height: 100px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.create-results.has-content {
  background: #ffffff;
  border: 2px solid #d1d5db;
}

/* Validation Messages */
.validation-message {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: #dc2626;
}

.validation-message.hidden {
  display: none;
}

/* Radio Button Groups */
.create-section input[type="radio"] {
  margin-right: 0.5rem;
}

.create-section label:has(input[type="radio"]) {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.create-section label:has(input[type="radio"]):hover {
  background-color: #f3f4f6;
}

/* Checkbox Groups */
.create-section input[type="checkbox"] {
  margin-right: 0.5rem;
}

.create-section label:has(input[type="checkbox"]) {
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.15s ease;
}

.create-section label:has(input[type="checkbox"]):hover {
  background-color: #f3f4f6;
}

/* Button Styles */
.create-button {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.create-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.create-button-primary {
  background-color: #4f46e5;
  color: white;
  border: none;
}

.create-button-primary:hover:not(:disabled) {
  background-color: #4338ca;
}

.create-button-secondary {
  background-color: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.create-button-secondary:hover {
  background-color: #f9fafb;
}

/* Action Buttons */
.action-button {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Image Preview Styling */
.image-preview {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 0.375rem;
  transition: transform 0.2s ease;
}

.image-preview:hover {
  transform: scale(1.02);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Loading States */
.loading-spinner {
  animation: spin 1s linear infinite;
}

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

/* Notifications */
.create-notification {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Focus States */
.create-section input:focus,
.create-section select:focus,
.create-section textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .create-container {
    padding: 0.5rem;
  }
  
  .create-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .create-grid-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .create-section h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .create-image-upload {
    min-height: 150px;
    padding: 0.75rem;
  }
  
  .create-results {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .create-container {
    padding: 0.25rem;
  }
  
  .create-section {
    padding: 0.75rem;
    border-radius: 0.25rem;
  }
  
  .action-button {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .create-section {
    border-color: #000000;
    border-width: 2px;
  }
  
  .create-input {
    border-color: #000000;
    border-width: 2px;
  }
  
  .validation-message {
    color: #000000;
    font-weight: 600;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .create-section,
  .create-input,
  .action-button,
  .image-preview,
  .create-notification {
    transition: none;
    animation: none;
  }
  
  .loading-spinner {
    animation: none;
  }
}

/* Print Styles */
@media print {
  .create-container {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  
  .create-section {
    box-shadow: none;
    border: 1px solid #000000;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  .action-button,
  .create-button {
    display: none;
  }
  
  .create-notification {
    display: none;
  }
}

/* Additional Utility Classes */
.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;
}

.text-required {
  color: #dc2626;
}

.text-optional {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar for Image Upload Area */
.create-image-upload::-webkit-scrollbar {
  width: 6px;
}

.create-image-upload::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.create-image-upload::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.create-image-upload::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}