/* Recipe Edit Styles */
.recipe-edit {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header */
.recipe-edit-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.recipe-edit-header h1 {
  margin: 15px 0 0 0;
  font-size: 2.2em;
  font-weight: 700;
  color: #333;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
}

.breadcrumb-link {
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #999;
  font-weight: bold;
}

.breadcrumb-current {
  color: #333;
  font-weight: 500;
}

/* Messages */
.message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-weight: 500;
}

.message-icon {
  font-size: 18px;
}

.error-message {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

/* Form Layout */
.recipe-form {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.form-section h3 {
  margin: 0 0 25px 0;
  font-size: 1.4em;
  font-weight: 600;
  color: #333;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
  display: inline-block;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group label.required::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* Form Inputs */
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input:invalid,
.form-group textarea:invalid {
  border-color: #dc3545;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-group select {
  cursor: pointer;
  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 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
}

.form-hint {
  margin-top: 5px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.cancel-button,
.save-button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: center;
}

.cancel-button {
  background: #6c757d;
  color: white;
}

.cancel-button:hover:not(:disabled) {
  background: #545b62;
  transform: translateY(-1px);
}

.save-button {
  background: #28a745;
  color: white;
}

.save-button:hover:not(:disabled) {
  background: #218838;
  transform: translateY(-1px);
}

.cancel-button:disabled,
.save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Error States */
.error {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error h3 {
  color: #dc3545;
  margin-bottom: 15px;
}

.error-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.retry-button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.retry-button:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.back-button {
  background: #6c757d;
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.back-button:hover {
  background: #545b62;
  transform: translateY(-1px);
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
  font-size: 1.2em;
  color: #666;
}

/* Character Counter */
.form-group[data-maxlength]::after {
  content: attr(data-current) "/" attr(data-maxlength);
  font-size: 12px;
  color: #666;
  float: right;
  margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .recipe-edit {
    padding: 15px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .recipe-form {
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column-reverse;
  }
  
  .cancel-button,
  .save-button {
    width: 100%;
  }
  
  .recipe-edit-header h1 {
    font-size: 1.8em;
  }
}

@media (max-width: 480px) {
  .breadcrumb {
    flex-wrap: wrap;
  }
  
  .form-section h3 {
    font-size: 1.2em;
  }
  
  .message {
    padding: 12px 15px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 10px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Upload Progress in Forms */
.form-group .upload-progress {
  margin-top: 10px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  height: 6px;
  position: relative;
}

.form-group .upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  transition: width 0.3s ease;
  border-radius: 10px;
}

.upload-progress-text {
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
  display: block;
}

.form-hint {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .form-group input,
  .form-group textarea,
  .form-group select {
    border-width: 3px;
  }
  
  .form-group input:focus,
  .form-group textarea:focus,
  .form-group select:focus {
    border-color: #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .form-group input,
  .form-group textarea,
  .form-group select,
  .cancel-button,
  .save-button,
  .breadcrumb-link {
    transition: none;
  }
  
  .loading-spinner {
    animation: none;
  }
}