/* ============================================
   POST CREATE FORM - MULTI-STEP WORKFLOW
   ============================================ */

.post-create-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-container {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.modal-header h2 {
  margin: 0 0 8px 0;
  color: #1f2937;
  font-size: 24px;
}

.modal-header p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  color: #374151;
  background: #f3f4f6;
}

/* Form Step Styles */
.form-sections {
  padding: 20px 30px;
}

.form-section {
  margin-bottom: 30px;
}

.form-section h3 {
  margin: 0 0 15px 0;
  color: #374151;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}

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

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2d5016;
  box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-actions {
  padding: 20px 30px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Preview Step Styles */
.preview-content {
  padding: 20px;
}

.preview-container {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
}

.preview-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Obituary preview specific styles */
.obituary-separator {
  width: 100%;
  height: 1px;
  background: #e5e7eb;
  margin: 15px 0;
}

.biography-section {
  margin: 15px 0;
  padding: 0 10px;
}

.biography-section p {
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.condolences-text {
  text-align: center;
  font-weight: bold;
  color: #2d5016;
  background: #f0f9ff;
  padding: 12px;
  border-radius: 6px;
  border: 2px solid #2d5016;
  margin: 10px 0;
}

/* Family Members Form Styles */
.family-member-row {
  margin-bottom: 15px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.family-member-row .form-row {
  grid-template-columns: 140px 1fr auto;
  gap: 12px;
  align-items: end;
}

.family-member-row .form-group {
  margin-bottom: 0;
}

.family-relationship {
  background: white;
}

.section-hint {
  margin: 0 0 15px 0;
  color: #6b7280;
  font-size: 14px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Family Members Preview Styles */
.family-members {
  margin: 15px 0;
  padding: 0 10px;
}

.family-members p {
  margin: 0 0 8px 0;
  color: #374151;
  font-weight: 500;
}

.family-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #4b5563;
  line-height: 1.4;
}

.family-member {
  display: inline-block;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
}

.family-member::after {
  content: ",";
  margin-left: 2px;
}

.family-member:last-child::after {
  content: "";
}

/* Edit Step Styles */
.edit-content {
  padding: 20px;
}

.edit-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  height: 500px;
}

.html-editor,
.live-preview {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.html-editor h4,
.live-preview h4 {
  margin: 0;
  padding: 12px 16px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.html-editor textarea {
  width: 100%;
  height: calc(100% - 50px);
  border: none;
  padding: 16px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
}

.live-preview .preview-container {
  height: calc(100% - 50px);
  overflow-y: auto;
  margin: 0;
  background: white;
}

/* Button Styles */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #2d5016;
  color: white;
}

.btn-primary:hover {
  background: #1e3610;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-outline {
  background: white;
  color: #2d5016;
  border: 1px solid #2d5016;
}

.btn-outline:hover {
  background: #f0f9ff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error Styles */
.error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
}

.general-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .edit-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .html-editor,
  .live-preview {
    height: 300px;
  }

  .form-actions {
    flex-direction: column;
  }
}
