/**
 * CogText Editor Styles
 */

.cogtext-container {
  border: 1px solid var(--rcc-slate-300);
  border-radius: 4px;
  background: white;
  overflow: hidden;
}

.cogtext-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--rcc-slate-50);
  border-bottom: 1px solid var(--rcc-slate-200);
}

.cogtext-toolbar-group {
  display: flex;
  gap: 2px;
  align-items: center;
}

.cogtext-toolbar-separator {
  width: 1px;
  height: 24px;
  background: var(--rcc-slate-300);
  margin: 0 4px;
}

.cogtext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--rcc-slate-300);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--rcc-slate-700);
  transition: all 0.2s;
}

.cogtext-btn:hover {
  background: var(--rcc-slate-100);
  border-color: var(--rcc-slate-400);
}

.cogtext-btn:active,
.cogtext-btn.active {
  background: var(--rcc-ember-100);
  border-color: var(--rcc-ember-400);
  color: var(--rcc-ember-700);
}

.cogtext-select {
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--rcc-slate-300);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--rcc-slate-700);
}

.cogtext-select:hover {
  border-color: var(--rcc-slate-400);
}

.cogtext-color-picker {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--rcc-slate-300);
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.cogtext-color-picker:hover {
  border-color: var(--rcc-slate-400);
}

.cogtext-editor {
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--rcc-slate-900);
  outline: none;
}

.cogtext-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--rcc-slate-400);
  font-style: italic;
  pointer-events: none;
}

/* Preserve formatting in editor */
.cogtext-editor h1,
.cogtext-editor h2,
.cogtext-editor h3,
.cogtext-editor h4,
.cogtext-editor h5,
.cogtext-editor h6 {
  margin: 16px 0 8px;
  font-weight: 700;
  line-height: 1.3;
}

.cogtext-editor h1 { font-size: 2em; }
.cogtext-editor h2 { font-size: 1.75em; }
.cogtext-editor h3 { font-size: 1.5em; }
.cogtext-editor h4 { font-size: 1.25em; }
.cogtext-editor h5 { font-size: 1.1em; }
.cogtext-editor h6 { font-size: 1em; }

.cogtext-editor p {
  margin: 8px 0;
}

.cogtext-editor ul,
.cogtext-editor ol {
  margin: 8px 0;
  padding-left: 24px;
}

.cogtext-editor li {
  margin: 4px 0;
}

.cogtext-editor a {
  color: var(--rcc-ember-600);
  text-decoration: underline;
}

.cogtext-editor a:hover {
  color: var(--rcc-ember-700);
}

.cogtext-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.cogtext-editor blockquote {
  margin: 16px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--rcc-ember-400);
  background: var(--rcc-slate-50);
  font-style: italic;
}

.cogtext-editor code {
  padding: 2px 6px;
  background: var(--rcc-slate-100);
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.cogtext-editor pre {
  margin: 16px 0;
  padding: 16px;
  background: var(--rcc-slate-900);
  color: var(--rcc-slate-100);
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.cogtext-editor hr {
  margin: 16px 0;
  border: none;
  border-top: 2px solid var(--rcc-slate-300);
}

/* Focus state */
.cogtext-editor:focus {
  background: var(--rcc-slate-50);
}

/* Disable state */
.cogtext-editor[contenteditable="false"] {
  background: var(--rcc-slate-100);
  cursor: not-allowed;
  opacity: 0.7;
}
