/**
 * Dashboard styles - extracted from dashboard.html for modularity
 */

/* ============================================
   SAGE DESIGN TOKENS
   ============================================ */
:root {
  /* Core palette */
  --sage-canvas: #F8F7F4;
  --sage-ink: #1A1A24;
  --sage-botanical: #4A7C59;
  --sage-botanical-dark: #3D6A4B;
  --sage-botanical-light: #E8F0EB;

  /* Semantic */
  --sage-bg-primary: var(--sage-canvas);
  --sage-text-primary: var(--sage-ink);
  --sage-text-secondary: #6B7280;
  --sage-text-muted: #9CA3AF;
  --sage-accent: var(--sage-botanical);
  --sage-accent-hover: var(--sage-botanical-dark);
  --sage-surface: #FFFFFF;
  --sage-border: #E5E5E0;

  /* Status */
  --sage-success: #10B981;
  --sage-error: #DC2626;
  --sage-warning: #F59E0B;

  /* Typography */
  --sage-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sage-font-base: 14px;

  /* Radius */
  --sage-radius-sm: 6px;
  --sage-radius-md: 8px;
  --sage-radius-lg: 12px;
}

* { box-sizing: border-box; }

.followup-context.compact {
  padding: 10px 12px;
  margin-bottom: 8px;
}

.followup-input-section.compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evaluation-workspace {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: white;
  padding: 12px;
}

.evaluation-inline {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin: 0;
}

.evaluation-inline .actionable-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.evaluation-inline .improvements-section,
.evaluation-inline .strengths-section,
.evaluation-inline .algorithm-section {
  margin-bottom: 0;
}

.evaluation-inline .insight-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.evaluation-inline .insight-list {
  margin: 0;
  padding-left: 16px;
}

.evaluation-inline .insight-list li {
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.evaluation-inline .algorithm-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #4B5563;
}

body { 
  font-family: var(--sage-font-primary);
  background: var(--sage-bg-primary); 
  margin: 0; 
  padding: 20px; 
  color: var(--sage-text-primary);
}

.header {
  background: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.product-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--sage-ink);
}

.product-section {
  font-size: 13px;
  color: var(--sage-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.add-idea-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 24px;
}

.add-idea-section h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--sage-ink);
}

.add-idea-form {
  display: flex;
  flex-direction: column;
}

.add-idea-form textarea {
  padding: 12px;
  border: 1px solid var(--sage-border);
  border-radius: var(--sage-radius-md);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  width: 100%;
  min-height: 80px;
}

/* Inline input pattern — buttons embedded in textarea */
.idea-input-wrapper {
  position: relative;
}

.idea-input-wrapper textarea {
  padding-bottom: 48px;
  min-height: 100px;
}

.idea-input-bar {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-dropdown-container {
  position: relative;
}

.platform-dropdown-trigger {
  font-size: 12px;
  color: var(--sage-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--sage-border);
  border-radius: var(--sage-radius-sm);
  background: white;
  font-family: inherit;
  transition: all 0.15s;
}

.platform-dropdown-trigger:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.add-idea-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--sage-radius-sm);
}

.platform-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  min-width: 180px;
  margin-top: 4px;
}

.platform-option {
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #374151;
}

.platform-option:hover {
  background-color: #f8f9fa;
}

.platform-option:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.platform-option:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.platform-selection {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.platform-selection label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.platform-dropdown {
  padding: 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.platform-dropdown:hover {
  border-color: var(--sage-accent);
}

.platform-dropdown:focus {
  outline: none;
  border-color: var(--sage-accent);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.platform-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.platform-btn {
  padding: 10px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.platform-btn:hover {
  border-color: var(--sage-accent);
  background: var(--sage-botanical-light);
}

.platform-btn.selected {
  border-color: var(--sage-accent);
  background: var(--sage-accent);
  color: white;
}

/* Platform Button Loading States - Fixed Dimensions */
.platform-btn {
  height: 44px !important; /* Fixed height to prevent changes */
  width: auto; /* Let width be determined by content but stay consistent */
  min-width: 120px; /* Reduced to fit 5 buttons in one row */
  max-width: none; /* Allow natural width */
  box-sizing: border-box;
  padding: 0 12px !important; /* Reduced padding for narrower buttons */
}

.platform-btn .btn-content {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: center;
}

.platform-btn .btn-icon,
.platform-btn .btn-spinner {
  width: 16px; /* Fixed width for consistent spacing */
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-btn .btn-icon svg,
.platform-btn .btn-icon img {
  width: 16px;
  height: 16px;
  display: block;
}

.platform-btn .btn-spinner {
  display: none;
  font-size: 8px;
  color: #9ca3af;
  animation: pulse 1.5s ease-in-out infinite;
}

.platform-btn.loading {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
}

.platform-btn.loading .btn-icon {
  display: none;
}

.platform-btn.loading .btn-spinner {
  display: flex;
}

.platform-btn.loading:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Simple pulse animation for circular dot */
@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.image-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: white;
  min-height: 150px;
}

/* Visual workspace - clean top controls + bottom preview */
.visual-controls {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.visual-ai-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visual-label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visual-limit {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
}

.visual-prompt-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.visual-prompt-input:focus {
  outline: none;
  border-color: var(--sage-accent);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.visual-prompt-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.visual-button-row {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

/* Visual tab buttons - use new unified system */
.visual-prompt-btn,
.visual-generate-btn,
.visual-upload-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.visual-prompt-btn {
  background: #64748b;
}

.visual-prompt-btn:hover:not(:disabled) {
  background: #475569;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.visual-generate-btn {
  background: var(--sage-accent);
}

.visual-generate-btn:hover:not(:disabled) {
  background: var(--sage-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.visual-upload-btn {
  background: var(--sage-accent);
}

.visual-upload-btn:hover:not(:disabled) {
  background: var(--sage-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.visual-preview-panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.visual-preview-image {
  width: 100%;
  max-height: 400px;
  border: none;
  background: none;
  padding: 20px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-preview-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.visual-preview-image img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.visual-preview-empty {
  text-align: center;
  padding: 12px;
  color: #64748b;
  width: 100%;
}

.visual-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.visual-empty-text {
  font-size: 15px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 8px;
}

.visual-empty-hint {
  font-size: 13px;
  color: #94a3b8;
}

.visual-preview-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.visual-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: #f1f5f9;
  color: #475569;
}

.visual-action-btn:hover:not(:disabled) {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.visual-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status messages for visual tab */
.idea-image-status {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
}

.idea-image-status.generating {
  color: var(--sage-accent);
  background: var(--sage-botanical-light);
}

.idea-image-status.uploading {
  color: var(--sage-accent);
  background: var(--sage-botanical-light);
}

/* Orphaned CSS removed - old visual tab layout replaced */

.image-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}

.image-modal-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  max-width: 80vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.image-modal-content img {
  max-width: 70vw;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  color: #475569;
  cursor: pointer;
  line-height: 1;
}

.image-modal-close:hover {
  color: #1f2937;
}

.image-modal-footer {
  display: flex;
  justify-content: flex-end;
}

.add-idea-btn {
  background: var(--sage-accent);
  color: white;
  border: none;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.add-idea-btn:hover {
  background: var(--sage-accent-hover);
}

.add-idea-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* View Selection Tabs */
.view-tabs {
  display: flex;
  gap: 0;
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 0;
  background: none;
  border-bottom: 1px solid var(--sage-border);
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  /* Smooth scrolling */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Better scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Webkit scrollbar styling (Chrome, Safari, Edge) */
.view-tabs::-webkit-scrollbar {
  height: 6px;
}

.view-tabs::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.view-tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.view-tabs::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.view-tabs .tab-btn {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sage-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--sage-text-primary);
  border-bottom-color: #cbd5e1;
  background: transparent;
}

.tab-btn.active {
  color: var(--sage-accent);
  border-bottom-color: var(--sage-accent);
  font-weight: 600;
  background: transparent;
  box-shadow: none;
}

.tab-btn.active:hover {
  color: var(--sage-accent-hover);
  border-bottom-color: var(--sage-accent-hover);
  background: transparent;
}

/* Sort Controls */
.sort-controls {
  background: white;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e5e7eb;
}

.sort-label {
  font-weight: 600;
  color: #64748b;
  font-size: 14px;
  margin: 0;
  white-space: nowrap;
}

.sort-buttons {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
}

.sort-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--sage-text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sort-btn:hover {
  background: #e2e8f0;
  color: var(--sage-text-primary);
}

.sort-btn:active {
  transform: none;
}

.sort-btn.active {
  background: white;
  color: var(--sage-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sort-btn.active:hover {
  background: white;
}

/* Search Input */
.search-input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 14px;
  color: #475569;
  width: 180px;
  transition: all 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--sage-accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-result-count {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.search-result-count:empty {
  display: none;
}

/* Responsive: Stack on mobile */
@media (max-width: 640px) {
  .sort-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .sort-buttons {
    width: 100%;
  }

  .sort-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
  }

  .search-wrapper {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .search-input {
    width: 100%;
  }

  .view-tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
}

.ideas-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.idea-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.idea-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.idea-header {
  position: relative;
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
}

.idea-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 12px;
}

.idea-actions-inline {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-self: flex-start;
}

.archive-btn, .posted-btn, .copy-idea-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  opacity: 0.6;
  transition: all 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archive-btn:hover, .posted-btn:hover, .copy-idea-btn:hover {
  opacity: 1;
  background-color: #f0f0f0;
  transform: scale(1.1);
}

.posted-btn {
  margin-right: 4px;
}

.platform-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.platform-select-btn {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-select-btn:hover {
  border-color: var(--sage-accent);
  background-color: var(--sage-botanical-light);
  transform: translateY(-1px);
}

.idea-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.readiness-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.readiness-badge.low { background: #fef3c7; color: #92400e; }
.readiness-badge.medium { background: #dbeafe; color: #1e40af; }
.readiness-badge.high { background: #d1fae5; color: #065f46; }

.progress-bar {
  display: flex;
  gap: 2px;
}

.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e5e7eb;
}

.progress-dot.filled {
  background: currentColor;
}

.platform-tag {
  background: #f3f4f6;
  color: #374151;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.idea-text {
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

/* Side-by-side content comparison layout */
/* New layout: Enhanced content primary, original collapsed, insights sidebar */
.new-layout {
  margin-top: 4px;
  margin-bottom: 8px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.main-content {
  flex: 1 1 420px;
  max-width: 580px;
  min-width: 300px;
  align-self: flex-start;
}

.idea-sidebar {
  flex: 1 1 500px;
  min-width: 400px;
  max-width: none;
  padding-top: 0;
}

.original-layout .main-content {
  flex: 1 1 auto;
  max-width: 100%;
}

.original-only-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.original-only-box {
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  background: linear-gradient(0deg, #ffffff 0%, #f8fafc 100%);
}

.original-only-box .idea-text {
  margin: 0;
}

.conversation-workspace.no-tabs .workspace-inline-tabs {
  display: none;
}

.enhanced-section {
  margin-bottom: 0;
}

/* Collapsible original reference */
.original-reference {
  margin-top: 12px;
}

.collapsible-original {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.original-toggle {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: all 0.2s ease;
}

.original-toggle:hover {
  background: #f1f5f9;
  color: #475569;
}

.original-toggle::-webkit-details-marker {
  display: none;
}

.collapsible-original[open] .original-toggle {
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
}

.collapsible-original .original-content {
  padding: 16px;
  background: white;
  border-radius: 0 0 6px 6px;
}

/* Workspace panels container - reduced padding */
.workspace-panels {
  padding: 0;
}

/* Conversation section */
.conversation-workspace, .platform-optimization-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.conversation-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: 0;
}

.conversation-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workspace-inline-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: -1px;
  align-items: flex-start;
  border: none;
  padding: 0;
  background: transparent;
}

.workspace-inline-tab {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  height: 38px;
  box-sizing: border-box;
}

.workspace-inline-tab:hover:not(.active) {
  background: #e2e8f0;
  color: #475569;
}

.workspace-inline-tab.active {
  background: white;
  color: var(--sage-accent);
  font-weight: 600;
  border-bottom-color: white;
  z-index: 1;
}

/* Follow-up context styling */
.followup-context {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.followup-context.inline {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.context-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-accent);
  margin-bottom: 6px;
}

.followup-context.inline .context-label {
  margin-bottom: 0;
  flex-shrink: 0;
}

.followup-input-section, .answer-form {
  margin-top: 12px;
}

.input-label, .input-guidance {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.4;
}

.submit-followup-btn {
  background: var(--sage-accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-followup-btn:hover {
  background: var(--sage-accent-hover);
}

.conversation-header {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.current-question {
  margin-bottom: 16px;
}

/* Evaluation prompts - visual distinction from regular questions */
.current-question.eval-prompt {
  background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 12px;
  border-left: 4px solid #f59e0b;
}

.current-question.eval-prompt .context-label {
  color: #d97706;
  font-weight: 600;
}

.question-text {
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
  line-height: 1.5;
}

.followup-context.inline .question-text {
  margin-bottom: 0;
}

.answer-input-section {
  margin-top: 8px;
}

.answer-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
  margin-bottom: 8px;
}

.answer-input:focus {
  outline: none;
  border-color: var(--sage-accent);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.submit-answer-btn {
  background: var(--sage-accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-answer-btn:hover {
  background: var(--sage-accent-hover);
}

.conversation-history {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: 12px;
}

.history-header {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.history-item {
  margin-bottom: 4px;
}

.question-history {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.history-item.current .question-history {
  color: var(--sage-accent);
  font-weight: 500;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding-bottom: 2px;
}

.column-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.original-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 16px;
  min-height: 240px;
}

.content-display {
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.enhanced-content-wrapper {
  background: var(--sage-botanical-light);
  border: 1px solid var(--sage-accent);
  border-radius: 6px;
  padding: 10px;
}

/* Fallback for ideas without enhanced content */
.original-only .idea-text {
  margin: 12px 0 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
}

/* Mobile responsiveness - stack on smaller screens */
@media (max-width: 768px) {
  body {
    padding: 8px;
    font-size: 14px;
    overflow-x: hidden;
    max-width: 100vw;
  }

  .header {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
  }

  .header h1 {
    font-size: 14px;
  }

  .header-right {
    font-size: 12px;
  }

  .add-idea-section {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .add-idea-section h2 {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .add-idea-form textarea {
    min-height: 60px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .platform-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .platform-btn {
    padding: 12px 8px;
    font-size: 12px;
    min-width: auto;
    height: auto;
  }

  .platform-btn .btn-content {
    flex-direction: column;
    gap: 4px;
  }

  .platform-btn .btn-text {
    font-size: 11px;
  }

  .idea-input-wrapper textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .new-layout {
    flex-direction: column;
    gap: 12px;
  }

  .main-content {
    max-width: none;
    min-width: 0;
    flex: 1 1 auto;
  }

  .idea-sidebar {
    min-width: 0;
    flex: 1 1 auto;
  }

  .sidebar {
    flex: 1;
    min-width: 0;
  }

  /* Legacy layout for backwards compatibility */
  .content-comparison {
    flex-direction: column;
    gap: 16px;
  }

  .enhanced-column {
    max-width: none;
    flex: 1;
  }

  .idea-card {
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .idea-header {
    padding: 12px;
  }

  .idea-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .readiness-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .enhanced-section {
    padding: 12px;
  }

  .enhanced-text-editor {
    min-height: 200px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .conversation-section {
    padding: 8px;
  }

  .answer-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .ideas-container {
    gap: 12px;
  }

  /* LinkedIn Evaluator mobile improvements */
  .linkedin-evaluator-section {
    padding: 16px;
  }

  #linkedin-post-text {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 100px;
  }

  .linkedin-evaluator-section .evaluate-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
  }

  .evaluation-results {
    padding: 16px;
  }

  .category-scores {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95vw;
    max-width: none;
    margin: 10px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }

  .modal-actions button {
    width: 100%;
    min-width: auto;
  }

  .workspace-inline-tab {
    padding: 6px 10px;
    font-size: 12px;
    height: 34px;
  }

  .workspace-panels {
    padding: 0;
  }

  .section-label {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .platform-optimization-section {
    padding: 8px 0;
  }

  .enhanced-actions {
    gap: 6px;
  }

  .original-only-section {
    padding: 12px;
  }

  .column-header {
    flex-wrap: wrap;
    gap: 6px;
  }
}


/* Enhanced content editor styles for side-by-side layout */
.enhanced-text-editor {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  color: #1e293b;
  background: white;
  resize: vertical;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.enhanced-text-editor:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.enhanced-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-start;
}

.enhanced-actions button {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  padding: 6px 12px;
  font-weight: 500;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Unified button system - base styles */
.btn-base {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  gap: 4px;
}

/* Button size variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-md {
  padding: 10px 20px;
  font-size: 13px;
}

/* Button color variants */
.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--sage-accent-hover);
  transform: translateY(-1px);
}

.btn-gradient {
  background: var(--sage-accent);
  color: white;
}

.btn-gradient:hover:not(:disabled) {
  background: var(--sage-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

/* Disabled state for all buttons */
.btn-base:disabled,
.save-btn:disabled,
.save-evaluate-btn:disabled,
.evaluate-btn:disabled,
.visual-prompt-btn:disabled,
.visual-generate-btn:disabled,
.visual-upload-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Legacy button classes - map to new system */
.save-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--sage-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--sage-text-secondary);
}

.save-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--sage-text-primary);
}

.save-evaluate-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--sage-accent);
  color: white;
}

.save-evaluate-btn:hover:not(:disabled) {
  background: var(--sage-accent-hover);
  transform: translateY(-1px);
}

.next-action {
  padding: 12px 20px;
  margin-top: 8px;
}

.platform-section, .refinement-section {
  margin-bottom: 16px;
}

.platform-section:last-child, .refinement-section:last-child {
  margin-bottom: 0;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* LinkedIn Evaluator Styles */
.linkedin-evaluator-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 24px;
}

.linkedin-evaluator-section h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.evaluator-description {
  color: #64748b;
  margin: 0 0 16px 0;
  font-size: 14px;
}

.evaluator-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#linkedin-post-text {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
}

#linkedin-post-text:focus {
  outline: none;
  border-color: var(--sage-accent);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.evaluate-btn {
  background: var(--sage-accent);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  font-size: 14px;
  align-self: flex-start;
  transition: background-color 0.2s;
}

.evaluate-btn:hover {
  background: var(--sage-accent-hover);
}

.evaluate-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.evaluation-results {
  margin-top: 20px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.score-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.overall-score {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
}

.performance-tier {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-excellent { background: #dcfce7; color: #166534; }
.tier-good { background: #dbeafe; color: #1e40af; }
.tier-average { background: #fef3c7; color: #92400e; }
.tier-needs-improvement { background: #fee2e2; color: #991b1b; }

.category-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.category-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.category-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
}

.category-score {
  font-weight: 700;
  color: var(--sage-accent);
}

.category-feedback {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.improvements-section, .strengths-section {
  margin-bottom: 16px;
}

.improvements-section h4, .strengths-section h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.improvements-list, .strengths-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.improvements-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #64748b;
}

.improvements-list li:before {
  content: "🔧 ";
  margin-right: 8px;
}

.strengths-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #64748b;
}

.strengths-list li:before {
  content: "✅ ";
  margin-right: 8px;
}

.algorithm-insights {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.algorithm-insights h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
}

.algorithm-insights p {
  margin: 0;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.4;
}

.next-action-label {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 12px;
}


.platform-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.platform-btn {
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.answer-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-form textarea {
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.buttons {
  display: flex;
  gap: 8px;
}

.submit-btn, .skip-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.submit-btn {
  background: #10b981;
  color: white;
}

.submit-btn:hover {
  background: #059669;
}

.skip-btn {
  background: #f3f4f6;
  color: #6b7280;
}

.skip-btn:hover {
  background: #e5e7eb;
}

/* Recommendations Section Styles */
.recommendations-section {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}

.recommendations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.recommendations-header .context-label {
  font-size: 20px;
  line-height: 1;
}

.recommendations-count {
  font-size: 13px;
  color: #64748b;
  background: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recommendation-item {
  display: flex;
  gap: 12px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Evaluation suggestions - amber/yellow theme to distinguish from regular questions */
.recommendation-item.eval-suggestion {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
  border-left: 4px solid #f59e0b;
}

.recommendation-item.eval-suggestion .recommendation-number {
  color: #d97706;
}

.eval-freshness {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  margin-left: 4px;
}

.recommendation-number {
  font-weight: 700;
  color: var(--sage-accent);
  font-size: 16px;
  min-width: 24px;
  flex-shrink: 0;
}

.recommendation-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recommendation-text {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.5;
  font-weight: 500;
}

.recommendation-reasoning {
  font-size: 13px;
  color: #64748b;
  font-style: italic;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  border-left: 3px solid var(--sage-accent);
}

.recommendation-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.recommendation-actions .submit-btn,
.recommendation-actions .skip-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.recommendations-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.recommendations-footer .input-guidance {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

.conversation-history {
  margin-top: 16px;
}

.conversation-toggle {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.conversation-items {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.conversation-item {
  margin-bottom: 12px;
}

.conversation-item:last-child {
  margin-bottom: 0;
}

.conversation-item .label {
  font-weight: 600;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.conversation-item .content {
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
}

.loading, .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-size: 16px;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
}

.modal-body {
  padding: 16px 20px 12px;
}

.optimized-content {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.constraints h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #374151;
}

.constraints ul {
  margin: 0;
  padding-left: 20px;
  color: #6b7280;
  font-size: 13px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 13px;
}

.modal-footer button:first-child {
  background: #6b7280;
  color: white;
}

/* Platform selection styling for mark as posted modal */
.platform-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.platform-select-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-select-btn:hover {
  background: var(--sage-accent);
  border-color: var(--sage-accent);
  color: white;
  transform: translateY(-1px);
}

/* Simplified LinkedIn Composer Styles */
.linkedin-composer {
  background: white;
  border-radius: 12px;
  border: 1px solid #e1e5e9;
  overflow: hidden;
}

.composer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e5e9;
  background: #fafbfc;
}

.composer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.composer-content {
  padding: 12px 16px;
}

.content-editor {
  width: 100%;
  min-height: 300px;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  resize: vertical;
  background: transparent;
  color: #000;
}

.content-editor::placeholder {
  color: #666;
  font-size: 18px;
  font-weight: 400;
}

.composer-toolbar {
  padding: 16px 20px;
  border-top: 1px solid #e1e5e9;
  border-bottom: 1px solid #e1e5e9;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toolbar-left {
  display: flex;
  gap: 12px;
}

.toolbar-btn {
  background: none;
  border: 1px solid #e1e5e9;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: #f3f2ef;
  border-color: #d0d0d0;
}

.evaluation-score {
  font-size: 13px;
  color: #0a66c2;
  font-weight: 600;
  background: #e7f3ff;
  padding: 6px 12px;
  border-radius: 16px;
}

.engagement-preview {
  padding: 16px 20px;
  background: #f9fafb;
  border-top: 1px solid #e1e5e9;
}

.engagement-stats {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin-bottom: 4px;
}

.engagement-note {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

/* LinkedIn Integration Styles */
.linkedin-status {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.linkedin-status.not-configured {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.linkedin-status.disconnected {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
}

.linkedin-status.connected {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.status-subtitle {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}

.linkedin-connect-btn {
  background: #0077b5;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.linkedin-connect-btn:hover {
  background: #005885;
  transform: translateY(-1px);
}

.linkedin-post-btn {
  background: #0077b5;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.linkedin-post-btn:hover:not(:disabled) {
  background: #005885;
  transform: translateY(-1px);
}

.linkedin-post-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.linkedin-post-btn.success {
  background: #10b981;
  color: white;
}

.linkedin-post-btn.error {
  background: #ef4444;
  color: white;
}

.view-post-btn {
  background: #6366f1;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.view-post-btn:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* Modal actions with LinkedIn integration */
.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 0 24px 24px 24px;
}

.modal-actions.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.dashboard-card .actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.header-actions {
  display: flex;
  align-items: center;
}

.modal-actions button {
  flex: 1;
  min-width: 130px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #374151;
}

.copy-btn:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.copy-post-btn {
  background: #059669;
  border: 1px solid #059669;
  color: white;
}

.copy-post-btn:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* LinkedIn Post Preview Styles */
.linkedin-post-preview {
  background: white;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.linkedin-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  background: #0077b5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.profile-details {
  flex: 1;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  color: #000;
  margin-bottom: 2px;
}

.profile-subtitle {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.post-time {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-options {
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.post-options:hover {
  background: #f3f2ef;
}

.linkedin-post-content {
  font-size: 14px;
  line-height: 1.6;
  color: #000;
  margin-bottom: 16px;
  white-space: pre-line;
}

.linkedin-post-content .hashtag {
  color: #0077b5;
  font-weight: 500;
}

.linkedin-post-actions {
  border-top: 1px solid #e6e6e6;
  padding-top: 8px;
}

.engagement-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  padding: 0 4px;
}

.reactions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.action-buttons {
  display: flex;
  justify-content: space-around;
}

.action-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  background: #f3f2ef;
  color: #0077b5;
}

/* Twitter Composer Styles - DEPRECATED: Use twitter-composer-efficient instead */
.twitter-composer {
  background: white;
  border-radius: 16px;
  border: 1px solid #e1e8ed;
  overflow: hidden;
  max-width: 598px;
  margin: 0 auto;
}

.twitter-composer .composer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1e8ed;
  background: #ffffff;
}

.twitter-composer .composer-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f1419;
}

.tweet-content {
  padding: 16px 20px;
}

.profile-section {
  display: flex;
  gap: 12px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  background: #1d9bf0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.tweet-input-section {
  flex: 1;
}

.tweet-editor {
  width: 100%;
  border: none;
  outline: none;
  font-size: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.25;
  resize: none;
  background: transparent;
  color: #0f1419;
  min-height: 120px;
  padding: 8px 0;
}

.tweet-editor::placeholder {
  color: #536471;
  font-size: 20px;
  font-weight: 400;
}

.tweet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eff3f4;
}

.tweet-actions {
  display: flex;
  gap: 16px;
}

.tweet-action {
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.tweet-action:hover {
  opacity: 1;
}

.tweet-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-count {
  font-size: 14px;
  color: #536471;
  font-weight: 400;
}

.tweet-btn {
  background: #1d9bf0;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.tweet-btn:hover:not(:disabled) {
  background: #1a8cd8;
}

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

/* Space-Efficient Twitter UI */
.twitter-composer-efficient {
  background: white;
  border-radius: 12px;
  border: 1px solid #e1e8ed;
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 400px; /* Fixed height for consistent layout */
}

.tweet-content-area {
  flex: 1;
  padding: 16px;
}

.tweet-editor-large {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 20px;
  line-height: 24px;
  color: #0f1419;
  background: transparent;
  padding: 0;
  margin: 0;
}

.tweet-editor-large::placeholder {
  color: #536471;
  font-size: 20px;
}

.tweet-bottom-bar {
  padding: 12px 16px;
  border-top: 1px solid #eff3f4;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.char-count {
  font-size: 15px;
  color: #536471;
  font-weight: 400;
}

.char-count.over-limit {
  color: #dc2626;
  font-weight: 600;
}

/* Twitter Composer with Analysis Sidebar */
.twitter-composer-with-analysis {
  display: flex;
  gap: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e1e8ed;
  overflow: hidden;
  min-height: 400px;
}

.tweet-editor-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 400px;
}

.tweet-editor-header {
  padding: 16px 16px 8px 16px;
  border-bottom: 1px solid #e1e8ed;
}

.tweet-editor-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f1419;
}

.tweet-editor-main {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 16px;
  font-size: 20px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 24px;
  resize: none;
  background: transparent;
  color: #0f1419;
}

.tweet-editor-main::placeholder {
  color: #657786;
}

.tweet-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e1e8ed;
  background: #fafafa;
}

.tweet-actions {
  display: flex;
  gap: 12px;
}

.tweet-analysis-sidebar {
  width: 300px;
  background: #f8fafc;
  border-left: 1px solid #e1e8ed;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.analysis-header {
  padding: 16px 16px 8px 16px;
}

.analysis-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.analysis-content {
  flex: 1;
  padding: 8px 16px 16px 16px;
  overflow-y: auto;
}

.analysis-section {
  margin-bottom: 20px;
}

.analysis-section h5 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #059669;
}

.analysis-points {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analysis-points li {
  padding: 4px 0;
  font-size: 13px;
  line-height: 18px;
  color: #475569;
  position: relative;
  padding-left: 16px;
}

.analysis-points li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: bold;
}

.visual-section h5 {
  color: var(--sage-accent);
}

.visual-suggestion {
  font-size: 13px;
  line-height: 18px;
  color: #475569;
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-style: italic;
}

.stats-section h5 {
  color: #0ea5e9;
}

.tweet-stats {
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 600;
}

.stat-value.over-limit {
  color: #dc2626;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .twitter-composer-with-analysis {
    flex-direction: column;
  }
  
  .tweet-analysis-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e1e8ed;
  }
  
  .tweet-editor-section {
    min-width: unset;
  }
}

/* New Twitter Composer - Simple Layout (Option D) */
.twitter-composer {
  background: white;
  border-radius: 8px;
  border: 1px solid #e1e8ed;
}

.twitter-composer .composer-header {
  padding: 16px 20px 8px 20px;
  border-bottom: 1px solid #e1e8ed;
}

.twitter-composer .composer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f1419;
}

.twitter-composer .composer-content {
  padding: 16px 20px;
}

.twitter-composer .content-editor {
  width: 100%;
  border: none;
  outline: none;
  font-size: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 24px;
  resize: none;
  background: transparent;
  color: #0f1419;
}

.twitter-composer .content-editor::placeholder {
  color: #657786;
}

.twitter-composer .composer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #e1e8ed;
  background: #fafafa;
}

.twitter-composer .toolbar-left {
  display: flex;
  gap: 12px;
}

.twitter-composer .toolbar-btn {
  background: none;
  border: 1px solid #ccd6dd;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.twitter-composer .toolbar-btn:hover {
  background: #f7f9fa;
  border-color: #657786;
}

.twitter-composer .char-count {
  font-size: 14px;
  font-weight: 500;
  color: #657786;
}

.twitter-composer .char-count.over-limit {
  color: #dc2626;
  font-weight: 600;
}

.twitter-composer .analysis-panel {
  padding: 16px 20px;
  border-top: 1px solid #e1e8ed;
  background: #f8fafc;
}

.twitter-composer .analysis-summary {
  font-size: 14px;
  line-height: 20px;
  color: #374151;
  margin-bottom: 8px;
}

.twitter-composer .visual-suggestion {
  font-size: 14px;
  line-height: 20px;
  color: #374151;
  font-style: italic;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.tweet-btn-primary {
  background: #1d9bf0;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

.copy-btn-secondary, .posted-btn-secondary {
  background: transparent;
  color: #1d9bf0;
  border: 1px solid #cfd9de;
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn-secondary:hover, .posted-btn-secondary:hover {
  background: #f7f9fa;
  border-color: #1d9bf0;
}

/* Ensure modal is wide enough for LinkedIn preview */
.modal-content {
  max-width: 600px;
  width: 90vw;
}

/* Template and Dual Evaluation Styles */
.enhanced-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.template-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-tag {
  background: #e0f2fe;
  color: #0277bd;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.template-reasoning {
  cursor: help;
  color: #64748b;
  font-size: 12px;
}

.dual-evaluation {
  margin-top: 12px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.evaluation-header {
  margin-bottom: 8px;
}

.eval-title {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

.evaluation-scores {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.eval-score {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.eval-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.eval-value {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.eval-tier {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 10px;
}

.eval-tier.excellent {
  background: #dcfce7;
  color: #166534;
}

.eval-tier.good {
  background: var(--sage-botanical-light);
  color: var(--sage-accent-hover);
}

.eval-tier.average {
  background: #fef3c7;
  color: #b45309;
}

.eval-tier.needs-improvement {
  background: #fee2e2;
  color: #dc2626;
}

.comparison-insights {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid var(--sage-accent);
}

.insights-icon {
  font-size: 12px;
  margin-top: 2px;
}

.insights-text {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

/* Substack Composer Styles - Tabbed Interface */
.substack-composer {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

/* Compact Header for Option 1 - More comfortable spacing */
.composer-header-compact {
  padding: 10px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.substack-logo-svg {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

.platform-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.composer-tabs-inline {
  display: flex;
  gap: 6px;
  margin-right: 60px; /* Leave space for the X button */
}

/* Tab Navigation */
.composer-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.composer-tabs .tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--sage-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  border-radius: 6px;
}

.composer-tabs .tab-btn:hover {
  color: var(--sage-ink);
  background: #f3f4f6;
}

.composer-tabs .tab-btn.active {
  color: var(--sage-accent);
  border-bottom-color: var(--sage-accent);
  background: white;
}

/* Tab Content */
.tab-content {
  display: none;
}

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

.substack-note-modal .tab-content {
  min-height: 400px;
}

/* Edit Tab Styles - More comfortable spacing */
.edit-header {
  padding: 12px 24px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
}

.word-count-top {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.editor-content-full {
  padding: 24px;
  height: calc(100% - 48px);
}

.substack-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
  resize: none;
  background: transparent;
  min-height: 360px;
}

.substack-textarea::placeholder {
  color: #9ca3af;
}

.word-count {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* Preview Tab Styles - More comfortable spacing */
.preview-content {
  padding: 24px;
  font-family: Georgia, serif;
  line-height: 1.6;
  min-height: 400px;
}

.newsletter-modal {
  display: flex;
  flex-direction: column;
  width: min(95vw, 740px);
  max-width: 740px;
  max-height: 88vh;
  overflow: hidden;
}

.newsletter-modal .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  overflow: hidden;
}

.newsletter-modal .tab-content {
  flex: 1;
  display: none;
  padding: 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-y: auto;
  min-height: 0;
}

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

.newsletter-modal .preview-content {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
}

.newsletter-modal #newsletter-edit-tab {
  margin-bottom: 0;
  flex: 1;
}

.newsletter-modal #newsletter-content-editor {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.newsletter-modal .modal-actions {
  margin-top: auto;
  padding: 0 24px 24px 24px;
}

@media (max-width: 640px) {
  .modal-actions.actions-row,
  .dashboard-card .actions-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .modal-actions.actions-row button,
  .dashboard-card .actions-row button {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
  }
}

.substack-paragraph {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: #1a1a1a;
}

.substack-paragraph:last-child {
  margin-bottom: 0;
}

.substack-hashtag {
  color: #ff6719;
  font-weight: 500;
}

/* Newsletter Preview Styles */
.newsletter-preview .preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.newsletter-preview .preview-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.newsletter-preview .word-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.newsletter-preview .preview-content {
  font-family: Georgia, serif;
  line-height: 1.6;
  color: #1a1a1a;
  font-size: 15px;
}

/* Version History Accordion Styles */
.version-accordion {
  margin-top: 8px;
}

.version-item {
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
}

.version-summary {
  padding: 8px 12px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  background: #f3f4f6;
  border-radius: 6px;
}

.version-summary:hover {
  background: #e5e7eb;
}

.version-content {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
}

.content-preview {
  font-size: 13px;
  line-height: 1.4;
  color: #374151;
  margin-bottom: 8px;
}

.show-full-btn {
  background: var(--sage-accent);
  color: white;
  border: none;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 4px;
}

.show-full-btn:hover {
  background: var(--sage-accent-hover);
}

.prompt-guidance {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 8px;
  border-radius: 4px;
  line-height: 1.4;
}

.prompt-guidance strong {
  color: #374151;
}

/* Version editing styles */
.v0-edit-wrapper,
.version-edit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.v0-text-editor,
.version-text-editor {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
}

.v0-text-editor:focus,
.version-text-editor:focus {
  outline: none;
  border-color: var(--sage-accent);
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.save-v0-btn,
.save-version-btn {
  align-self: flex-start;
  background: #10b981;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.save-v0-btn:hover,
.save-version-btn:hover {
  background: #059669;
}

.save-v0-btn:active,
.save-version-btn:active {
  transform: scale(0.98);
}

/* Floating close button positioned relative to modal */
.close-btn-floating {
  position: absolute;
  top: 12px;
  right: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.close-btn-floating:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #d1d5db;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Full modal body without header padding */
.modal-body-full {
  padding: 0;
}

/* Collapsible Evaluation Styles */
/* Compact evaluation with rightward overlay */
.dual-evaluation-compact {
  margin-top: 12px;
  position: relative;
}

.evaluation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.evaluation-summary:hover {
  background: var(--sage-botanical-light);
  border-color: var(--sage-accent);
}

.eval-summary-text {
  color: #1e40af;
  font-weight: 500;
}

.toggle-icon {
  color: #64748b;
  font-size: 12px;
  font-weight: bold;
  transition: transform 0.2s ease;
}

/* Inline evaluation card */
.evaluation-overlay {
  position: static;
  display: block;
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  box-shadow: none;
}

.evaluation-overlay.collapsed {
  display: none !important;
}

.overlay-content {
  padding: 16px;
  max-height: 360px;
  overflow-y: auto;
}

/* Actionable insights styling */
.actionable-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-insights {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #475569;
}

.improvements-section, .strengths-section, .algorithm-section {
  padding: 0;
}

.insight-header {
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}

.insight-list {
  margin: 0;
  padding-left: 20px;
  list-style-type: disc;
}

.insight-list li {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  margin-bottom: 4px;
}

.algorithm-text {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  margin: 0;
}

/* Posted Content View */
.posted-content-view {
  display: none;
}

.posted-content-view.active {
  display: block;
}


/* Revamped Posted Content Card */
.posted-item-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 16px 20px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}

.posted-item-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.posted-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.platform-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  color: #334155;
}

.platform-icon img { width: 14px; height: 14px; display: inline-block; }

.posted-date { font-size: 13px; color: #64748b; white-space: nowrap; }

.link-chips { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }

.link-chip,
.add-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  text-decoration: none;
  transition: all 0.2s ease;
}

.link-chip:hover,
.add-link-chip:hover { background: #eef2f7; border-color: #cbd5e1; color: #1e293b; }

.posted-content { margin-top: 6px; }
.content-excerpt { font-size: 14px; color: #1e293b; }
.content-full { background: #f9fafb; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin: 8px 0; }
.content-toggle { background: #f3f4f6; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 10px; font-size: 12px; color: #475569; cursor: pointer; }
.content-toggle:hover { background: #e2e8f0; }

.posted-link.linkedin {
  background: var(--sage-botanical-light);
  border-color: var(--sage-border);
  color: var(--sage-accent-hover);
}

.posted-link.linkedin:hover {
  background: var(--sage-botanical-light);
  border-color: var(--sage-accent);
}

.posted-link.twitter {
  background: #f0f9ff;
  border-color: #e0f2fe;
  color: #0369a1;
}

.posted-link.twitter:hover {
  background: #e0f2fe;
  border-color: #0284c7;
}

.posted-link.substack {
  background: #fffbeb;
  border-color: #fed7aa;
  color: #c2410c;
}

.posted-link.substack:hover {
  background: #fed7aa;
  border-color: #fb923c;
}

.posted-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.posted-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.posted-action-btn:hover {
  background: #e2e8f0;
  color: #475569;
}

.empty-posted-state {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.empty-posted-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px 0;
}

.empty-posted-state p {
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

/* Bulk Import Styles */
.bulk-import-modal .modal-content {
  max-width: 600px;
}

.bulk-import-modal .preview-section {
  margin: 16px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.bulk-import-modal .preview-section ol {
  margin: 8px 0;
  padding-left: 24px;
}

.bulk-import-modal .preview-section li {
  margin: 6px 0;
  color: #334155;
  line-height: 1.5;
}

.bulk-import-modal .skipped-section {
  margin-top: 12px;
  padding: 8px;
  background: #fef3c7;
  border-radius: 4px;
}

.bulk-import-modal .import-estimate {
  margin-top: 16px;
  padding: 12px;
  background: #eff6ff;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
}

.bulk-import-modal .cancel-btn {
  padding: 10px 20px;
  background: white;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.bulk-import-modal .cancel-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.bulk-import-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.bulk-import-progress-overlay .progress-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.bulk-import-progress-overlay h3 {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.bulk-import-progress-overlay .progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.bulk-import-progress-overlay .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.bulk-import-progress-overlay .progress-text {
  margin: 8px 0;
  font-size: 16px;
  font-weight: 500;
  color: #334155;
}

.bulk-import-progress-overlay .progress-estimate {
  margin: 4px 0;
  font-size: 14px;
  color: #64748b;
}

.bulk-import-progress-overlay .current-idea {
  margin-top: 12px;
  color: #64748b;
  font-size: 14px;
  font-style: italic;
  min-height: 20px;
}

.bulk-import-progress-overlay .progress-warning {
  margin-top: 20px;
  color: #b45309;
  font-size: 14px;
  font-weight: 500;
}

.bulk-import-progress-overlay .cancel-import-btn {
  margin-top: 16px;
  padding: 8px 16px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.bulk-import-progress-overlay .cancel-import-btn:hover {
  background: #dc2626;
}

.bulk-import-modal .results-summary {
  padding: 16px 0;
}

.bulk-import-modal .results-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bulk-import-modal .results-summary li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.bulk-import-modal .errors-section {
  margin-top: 16px;
  padding: 12px;
  background: #fef2f2;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.bulk-import-modal .errors-section ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

.bulk-import-modal .errors-section li {
  margin: 4px 0;
  color: #7f1d1d;
}

/* Spinner animation for processing status */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Mention hint */
.mention-hint {
  color: #9ca3af;
  font-size: 0.8em;
  margin: 4px 0 0;
}

.mention-hint code {
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.95em;
}
