/* Custom Lexxy Styles for Synkmart */
/* Override these CSS variables to match your app's theme */

:root {
  /* Editor Colors */
  --lexxy-background: #ffffff;
  --lexxy-text: #111827;
  --lexxy-border: #d1d5db;
  --lexxy-border-focus: #10b981;
  --lexxy-placeholder: #9ca3af;
  
  /* Toolbar Colors */
  --lexxy-toolbar-background: #f9fafb;
  --lexxy-toolbar-border: #e5e7eb;
  --lexxy-button-hover: #f3f4f6;
  --lexxy-button-active: #10b981;
  --lexxy-button-active-text: #ffffff;
  
  /* Content Colors */
  --lexxy-heading: #111827;
  --lexxy-link: #10b981;
  --lexxy-link-hover: #059669;
  --lexxy-code-background: #f3f4f6;
  --lexxy-code-text: #ef4444;
  --lexxy-blockquote-border: #10b981;
  --lexxy-blockquote-background: #f0fdf4;
  
  /* Selection */
  --lexxy-selection-background: #d1fae5;
  --lexxy-selection-text: #065f46;
}

/* Editor Container */
lexxy-editor {
  display: block;
  position: relative;
  background: var(--lexxy-background);
  color: var(--lexxy-text);
  border: 1px solid var(--lexxy-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

lexxy-editor:focus-within {
  outline: none;
  border-color: var(--lexxy-border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Toolbar */
.lexxy-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--lexxy-toolbar-background);
  border-bottom: 1px solid var(--lexxy-toolbar-border);
}

.lexxy-toolbar button {
  padding: 0.5rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: var(--lexxy-text);
  transition: background-color 0.15s;
}

.lexxy-toolbar button:hover {
  background: var(--lexxy-button-hover);
}

.lexxy-toolbar button.active {
  background: var(--lexxy-button-active);
  color: var(--lexxy-button-active-text);
}

/* Editor Content Area */
.lexxy-editor-content {
  padding: 1rem;
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
  outline: none;
}

.lexxy-editor-content:empty:before {
  content: attr(data-placeholder);
  color: var(--lexxy-placeholder);
  pointer-events: none;
}

/* Content Styles */
.lexxy-content h1,
.lexxy-editor-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--lexxy-heading);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.lexxy-content h2,
.lexxy-editor-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--lexxy-heading);
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.lexxy-content h3,
.lexxy-editor-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--lexxy-heading);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.lexxy-content p,
.lexxy-editor-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.lexxy-content strong,
.lexxy-editor-content strong,
.lexxy-content b,
.lexxy-editor-content b {
  font-weight: 600;
}

.lexxy-content em,
.lexxy-editor-content em,
.lexxy-content i,
.lexxy-editor-content i {
  font-style: italic;
}

.lexxy-content a,
.lexxy-editor-content a {
  color: var(--lexxy-link);
  text-decoration: underline;
  transition: color 0.15s;
}

.lexxy-content a:hover,
.lexxy-editor-content a:hover {
  color: var(--lexxy-link-hover);
}

/* Lists */
.lexxy-content ul,
.lexxy-editor-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.lexxy-content ol,
.lexxy-editor-content ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.lexxy-content li,
.lexxy-editor-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Code */
.lexxy-content code,
.lexxy-editor-content code {
  background: var(--lexxy-code-background);
  color: var(--lexxy-code-text);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
}

.lexxy-content pre,
.lexxy-editor-content pre {
  background: var(--lexxy-code-background);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.lexxy-content pre code,
.lexxy-editor-content pre code {
  background: transparent;
  padding: 0;
}

/* Blockquotes */
.lexxy-content blockquote,
.lexxy-editor-content blockquote {
  border-left: 4px solid var(--lexxy-blockquote-border);
  background: var(--lexxy-blockquote-background);
  padding: 1rem;
  margin: 1rem 0;
  font-style: italic;
}

/* Selection */
.lexxy-content ::selection,
.lexxy-editor-content ::selection {
  background: var(--lexxy-selection-background);
  color: var(--lexxy-selection-text);
}

/* Horizontal Rule */
.lexxy-content hr,
.lexxy-editor-content hr {
  border: none;
  border-top: 2px solid var(--lexxy-border);
  margin: 1.5rem 0;
}

/* Images */
.lexxy-content img,
.lexxy-editor-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Tables */
.lexxy-content table,
.lexxy-editor-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.lexxy-content th,
.lexxy-editor-content th,
.lexxy-content td,
.lexxy-editor-content td {
  border: 1px solid var(--lexxy-border);
  padding: 0.5rem;
  text-align: left;
}

.lexxy-content th,
.lexxy-editor-content th {
  background: var(--lexxy-toolbar-background);
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .lexxy-content h1,
  .lexxy-editor-content h1 {
    font-size: 1.5rem;
  }
  
  .lexxy-content h2,
  .lexxy-editor-content h2 {
    font-size: 1.25rem;
  }
  
  .lexxy-content h3,
  .lexxy-editor-content h3 {
    font-size: 1.125rem;
  }
}
