/* FILE: css/community/wysiwyg-editor.css */
/* Reusable WYSIWYG Editor Styles - Use across all pages */

/* Editor Container */
#body-editor {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Toolbar */
.editor-toolbar {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.toolbar-group {
  display: flex;
  gap: 2px;
  align-items: center;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: #d1d5db;
  margin: 0 4px;
}

/* Toolbar Buttons */
.toolbar-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: #4b5563;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 32px;
}

.toolbar-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.toolbar-btn:active {
  background: #d1d5db;
  transform: translateY(1px);
}

.toolbar-btn.active {
  background: #dbeafe;
  color: #2563eb;
  border-color: #93c5fd;
}

.toolbar-btn i {
  pointer-events: none;
}

/* Editor Content Area */
.editor-content {
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.editor-content:focus {
  outline: none;
}

/* Placeholder */
.editor-content:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  font-style: italic;
  pointer-events: none;
}

/* Focus state for entire editor */
#body-editor:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Content Formatting */
.editor-content h1,
.editor-content h2,
.editor-content h3,
.editor-content h4,
.editor-content h5,
.editor-content h6 {
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
  color: #111827;
}

.editor-content h1 { font-size: 2em; }
.editor-content h2 { font-size: 1.5em; }
.editor-content h3 { font-size: 1.25em; }
.editor-content h4 { font-size: 1.1em; }

.editor-content h1:first-child,
.editor-content h2:first-child,
.editor-content h3:first-child {
  margin-top: 0;
}

.editor-content p {
  margin-bottom: 1em;
}

.editor-content p:last-child {
  margin-bottom: 0;
}

.editor-content strong,
.editor-content b {
  font-weight: 600;
  color: #111827;
}

.editor-content em,
.editor-content i {
  font-style: italic;
}

.editor-content u {
  text-decoration: underline;
}

.editor-content strike,
.editor-content s {
  text-decoration: line-through;
}

/* Lists */
.editor-content ul,
.editor-content ol {
  margin: 1em 0;
  padding-left: 2em;
}

.editor-content ul {
  list-style-type: disc;
}

.editor-content ol {
  list-style-type: decimal;
}

.editor-content li {
  margin-bottom: 0.5em;
}

.editor-content li:last-child {
  margin-bottom: 0;
}

/* Nested lists */
.editor-content ul ul,
.editor-content ol ol,
.editor-content ul ol,
.editor-content ol ul {
  margin: 0.5em 0;
}

/* Links */
.editor-content a {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}

.editor-content a:hover {
  color: #1d4ed8;
}

/* Images */
.editor-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1em 0;
  display: block;
}

/* Code blocks */
.editor-content pre {
  background: #1f2937;
  color: #f3f4f6;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
}

.editor-content code {
  background: #f3f4f6;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.editor-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Horizontal rule */
.editor-content hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 2em 0;
}

/* Blockquotes */
.editor-content blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1em;
  margin: 1em 0;
  color: #6b7280;
  font-style: italic;
}

/* Text alignment */
.editor-content [style*="text-align: center"] {
  text-align: center;
}

.editor-content [style*="text-align: right"] {
  text-align: right;
}

.editor-content [style*="text-align: left"] {
  text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
  .editor-toolbar {
    padding: 8px;
  }
  
  .toolbar-btn {
    min-width: 28px;
    height: 28px;
    padding: 4px 8px;
    font-size: 13px;
  }
  
  .toolbar-divider {
    height: 20px;
  }
  
  .editor-content {
    min-height: 250px;
    padding: 12px;
    font-size: 14px;
  }
  
  /* Hide some toolbar items on mobile */
  .toolbar-group:nth-child(n+7) {
    display: none;
  }
}

/* Scrollbar styling for editor content */
.editor-content::-webkit-scrollbar {
  width: 8px;
}

.editor-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.editor-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.editor-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}