/* New Homes Community Content Engine - Styles */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.form-panel {
  width: 420px;
  min-width: 420px;
  background: white;
  border-right: 1px solid var(--gray-200);
  padding: 24px;
  overflow-y: auto;
  max-height: 100vh;
}

.output-panel {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: 100vh;
}

/* Header */
.app-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--gray-900);
}

.app-header p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-group label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: var(--gray-500);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  appearance: none;
  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 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 36px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

.btn-primary:disabled {
  background-color: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background-color: var(--gray-50);
}

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

.btn-block {
  width: 100%;
}

/* Loading State */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Output Panel */
.output-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-500);
  text-align: center;
}

.output-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.output-empty h2 {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 8px 0;
  color: var(--gray-700);
}

.output-empty p {
  font-size: 0.875rem;
  margin: 0;
}

/* Tabs */
.output-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--gray-700);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Content Sections */
.content-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 16px;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 8px 8px 0 0;
}

.content-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  color: var(--gray-700);
}

.content-body {
  padding: 16px;
}

.content-body p {
  margin: 0 0 12px 0;
}

.content-body p:last-child {
  margin-bottom: 0;
}

.content-body ul {
  margin: 0;
  padding-left: 20px;
}

.content-body li {
  margin-bottom: 6px;
}

.content-body li:last-child {
  margin-bottom: 0;
}

/* Copy Button */
.copy-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--gray-500);
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  color: var(--gray-700);
  background: var(--gray-50);
}

.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

/* FAQ Section */
.faq-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item:first-child {
  padding-top: 0;
}

.faq-question {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.faq-answer {
  color: var(--gray-700);
}

/* Social Posts */
.social-post {
  padding: 12px;
  background: var(--gray-50);
  border-radius: 6px;
  margin-bottom: 12px;
}

.social-post:last-child {
  margin-bottom: 0;
}

.social-text {
  margin-bottom: 8px;
}

.social-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hashtag {
  font-size: 0.75rem;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Meta Fields */
.meta-field {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.meta-field:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.meta-value {
  color: var(--gray-900);
}

/* Error State */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.error-message h3 {
  margin: 0 0 8px 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.error-message p {
  margin: 0;
  font-size: 0.875rem;
}

/* Export Actions */
.export-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  .form-panel {
    width: 100%;
    min-width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }

  .output-panel {
    max-height: none;
  }
}

/* Section Dividers */
.form-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
