/**
 * Note Themes CSS
 * Estilos para los diferentes temas de notas
 * Solo afectan al contenido del editor (#editor)
 */

/* ===== TEMA BASE ===== */
#editor {
  transition: all 0.3s ease;
}

/* ===== TEMA DE TEXTO (por defecto) ===== */
#editor.note-theme-text {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
}

#editor.note-theme-text h1,
#editor.note-theme-text h2,
#editor.note-theme-text h3,
#editor.note-theme-text h4,
#editor.note-theme-text h5,
#editor.note-theme-text h6 {
  color: var(--text);
  font-weight: 600;
  margin: 1.5em 0 0.5em 0;
  line-height: 1.3;
}

#editor.note-theme-text h1 { font-size: 2em; }
#editor.note-theme-text h2 { font-size: 1.7em; }
#editor.note-theme-text h3 { font-size: 1.4em; }
#editor.note-theme-text h4 { font-size: 1.2em; }
#editor.note-theme-text h5 { font-size: 1.1em; }
#editor.note-theme-text h6 { font-size: 1em; }

#editor.note-theme-text p {
  margin: 1em 0;
  text-align: justify;
}

#editor.note-theme-text ul,
#editor.note-theme-text ol {
  margin: 1em 0;
  padding-left: 2em;
}

#editor.note-theme-text li {
  margin: 0.5em 0;
}

#editor.note-theme-text blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1em;
  margin: 1em 0;
  font-style: italic;
  color: var(--text-muted);
}

#editor.note-theme-text code {
  background: var(--bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.9em;
  color: var(--accent);
}

#editor.note-theme-text pre {
  background: var(--bg-secondary);
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1em 0;
}

#editor.note-theme-text pre code {
  background: transparent;
  padding: 0;
  color: var(--text);
}

/* ===== TEMA DE CÓDIGO ===== */
#editor.note-theme-code {
  font-family: 'Source Code Pro', 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5em;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Números de línea simulados para el tema código */
#editor.note-theme-code {
  counter-reset: line-number;
  position: relative;
}

#editor.note-theme-code::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border);
  opacity: 0.5;
}

/* Sintaxis highlighting para el tema código */
#editor.note-theme-code .keyword {
  color: #569cd6; /* Azul para keywords */
  font-weight: bold;
}

#editor.note-theme-code .string {
  color: #ce9178; /* Naranja para strings */
}

#editor.note-theme-code .comment {
  color: #6a9955; /* Verde para comentarios */
  font-style: italic;
}

#editor.note-theme-code .number {
  color: #b5cea8; /* Verde claro para números */
}

#editor.note-theme-code .function {
  color: #dcdcaa; /* Amarillo para funciones */
}

#editor.note-theme-code .variable {
  color: #9cdcfe; /* Azul claro para variables */
}

#editor.note-theme-code .operator {
  color: #d4d4d4; /* Gris claro para operadores */
}

#editor.note-theme-code .bracket {
  color: #ffd700; /* Dorado para brackets */
  font-weight: bold;
}

/* Estilos específicos para elementos HTML en tema código */
#editor.note-theme-code h1,
#editor.note-theme-code h2,
#editor.note-theme-code h3,
#editor.note-theme-code h4,
#editor.note-theme-code h5,
#editor.note-theme-code h6 {
  color: #4ec9b0; /* Verde azulado para headers */
  font-weight: bold;
  margin: 1em 0 0.5em 0;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--border);
}

#editor.note-theme-code p {
  margin: 0.8em 0;
  color: var(--text);
}

#editor.note-theme-code ul,
#editor.note-theme-code ol {
  margin: 0.8em 0;
  padding-left: 2em;
}

#editor.note-theme-code li {
  margin: 0.3em 0;
  color: var(--text);
}

#editor.note-theme-code blockquote {
  border-left: 3px solid #569cd6;
  padding-left: 1em;
  margin: 1em 0;
  background: rgba(86, 156, 214, 0.1);
  color: #9cdcfe;
  font-style: italic;
}

#editor.note-theme-code code {
  background: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: #ce9178;
  border: 1px solid var(--border);
}

#editor.note-theme-code pre {
  background: var(--bg-tertiary);
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
  border: 1px solid var(--border);
  position: relative;
}

#editor.note-theme-code pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text);
}

/* Indicador visual del tema activo */
#editor.note-theme-code::after {
  content: 'CODE';
  position: absolute;
  top: 10px;
  right: 15px;
  background: #569cd6;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

#editor.note-theme-text::after {
  content: 'TEXT';
  position: absolute;
  top: 10px;
  right: 15px;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

/* Animaciones de transición entre temas */
#editor.note-theme-code,
#editor.note-theme-text {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estilos para modo oscuro en tema código */
[data-theme="dark"] #editor.note-theme-code {
  background: #1e1e1e;
  color: #d4d4d4;
  border-color: #3c3c3c;
}

[data-theme="dark"] #editor.note-theme-code::before {
  background: #252526;
  border-color: #3c3c3c;
}

[data-theme="dark"] #editor.note-theme-code .keyword {
  color: #569cd6;
}

[data-theme="dark"] #editor.note-theme-code .string {
  color: #ce9178;
}

[data-theme="dark"] #editor.note-theme-code .comment {
  color: #6a9955;
}

[data-theme="dark"] #editor.note-theme-code .number {
  color: #b5cea8;
}

[data-theme="dark"] #editor.note-theme-code .function {
  color: #dcdcaa;
}

[data-theme="dark"] #editor.note-theme-code .variable {
  color: #9cdcfe;
}

/* Estilos para modo claro en tema código */
[data-theme="light"] #editor.note-theme-code {
  background: #f8f8f8;
  color: #333333;
  border-color: #e1e1e1;
}

[data-theme="light"] #editor.note-theme-code::before {
  background: #f0f0f0;
  border-color: #e1e1e1;
}

[data-theme="light"] #editor.note-theme-code .keyword {
  color: #0000ff;
}

[data-theme="light"] #editor.note-theme-code .string {
  color: #a31515;
}

[data-theme="light"] #editor.note-theme-code .comment {
  color: #008000;
}

[data-theme="light"] #editor.note-theme-code .number {
  color: #098658;
}

[data-theme="light"] #editor.note-theme-code .function {
  color: #795e26;
}

[data-theme="light"] #editor.note-theme-code .variable {
  color: #001080;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #editor.note-theme-code {
    font-size: 13px;
    padding: 1em;
  }
  
  #editor.note-theme-code::before {
    width: 40px;
  }
  
  #editor.note-theme-text {
    font-size: 15px;
  }
}