/* Add to markdown-editor.css */
h1,
h2,
h3,
h4,
h5,
h6 {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

#help-btn {
  display: none;
}

/* Style the anchor link */
.header-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin-left: 8px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

/* Improve visibility on hover/focus */
h1:hover .header-anchor,
h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor,
h5:hover .header-anchor,
h6:hover .header-anchor,
.header-anchor:focus {
  opacity: 1;
}

/* Focus styles for keyboard navigation */
.header-anchor:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
/* Tab styles */

/* Add these to your existing tab styles in markdown-editor.css */

/* Light mode specific styles */
@media (prefers-color-scheme: light) {
  .tabs-tab-button {
    background-color: #f5f5f5;
  }

  .tabs-tab-button.active {
    background-color: #fff;
    border-bottom: 2px solid #005c84;
  }

  .tabs-tab-button:hover,
  .tabs-tab-button:focus {
    background-color: #e0e0e0;
  }
}

/* Dark mode specific styles */
@media (prefers-color-scheme: dark) {
  .tabs-tab-button {
    background-color: #2c3e50;
    color: #e1e8ec;
  }

  .tabs-tab-button.active {
    background-color: #1a2533;
    border-bottom: 2px solid #90caf9;
  }

  .tabs-tab-button:hover,
  .tabs-tab-button:focus {
    background-color: #34495e;
  }

  .tabs-tabs-wrapper {
    border-color: #758d9a;
  }

  .tabs-tabs-container {
    background-color: #1a2533;
  }
}

/* Focus styles for better accessibility */
.tabs-tab-button:focus-visible {
  outline: 3px solid #005c84;
  outline-offset: -1px;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  .tabs-tab-button:focus-visible {
    outline-color: #90caf9;
  }
}

.tabs-tabs-wrapper {
  margin: 1.5em 0;
  border: 1px solid currentColor;
  border-radius: 4px;
  overflow: hidden;
}

.tabs-tabs-header {
  display: flex;
  border-bottom: 1px solid currentColor;
}

.tabs-tab-button {
  padding: 0.5em 1em;
  background: none;
  border: none;
  border-right: 1px solid currentColor;
  font-family: inherit;
  font-size: 1em;
  cursor: pointer;
}

.tabs-tab-button:hover,
.tabs-tab-button:focus {
  background-color: rgba(0, 0, 0, 0.05);
}

.tabs-tab-button.active {
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.1);
}

.tabs-tabs-container {
  padding: 1em;
}

.tabs-tab-content {
  display: none;
}

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

.status-message.success {
  background-color: #c1d100;
  border: 2px solid #00131d;
  color: #00131d;
}

.status-message.error {
  background-color: #d5007f;
  border: 2px solid #00131d;
  color: #00131d;
}

.loading::after {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
}

.info {
  background-color: #b3dbd2;
  border-left: 10px solid #00131d;
  border-top: 2px solid #00131d;
  border-right: 2px solid #00131d;
  border-bottom: 2px solid #00131d;
  color: #00131d;
}

.warning {
  background-color: #fcbc00;
  border-left: 10px solid #00131d;
  border-top: 2px solid #00131d;
  border-right: 2px solid #00131d;
  border-bottom: 2px solid #00131d;
  color: #00131d;
}

.danger {
  background-color: #ef7d00;
  border-left: 10px solid #00131d;
  border-top: 2px solid #00131d;
  border-right: 2px solid #00131d;
  border-bottom: 2px solid #00131d;
  color: #00131d;
}

.keyboard-shortcuts kbd {
  border: 1px solid currentcolor;
  color: currentcolor;
}

/* Keyboard shortcuts help */
.keyboard-shortcuts {
  box-shadow: 0 2px 10px rgb(0, 0, 0);
  background: #fffdf9;
}

.keybMDshortcutsLI {
  line-height: 35px;
}

.error-boundary pre {
  background-color: #f8f9fa;
}

.error-boundary pre {
  background-color: #f8f9fa;
}

/* Editor section */
.editor-section {
  margin-bottom: 2rem;
}

/* Controls section */
.controls-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Status messages */
.status-message {
  padding: 0.5rem;
  margin: 0.5rem 0;
  border-radius: 4px;
  display: none;
}

.status-message.visible {
  display: block;
}

/* Form controls */
textarea {
  width: 100%;
  min-height: 200px;
  padding: 10px;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
}

/* Output area */
.output {
  padding: 20px;
  border-radius: 4px;
  border: 1px solid currentcolor;
  min-height: 100px;
}

/* Loading indicator */
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.loading.visible {
  display: flex;
}

.loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Component styles */
.task-list-item {
  list-style-type: none;
}

.task-list-item-checkbox {
  margin-right: 0.5em;
  cursor: default;
  pointer-events: none;
}

/* Alert styles */
.info,
.warning,
.danger {
  padding: 1em;
  margin: 1em 0;
  border-radius: 0.3em;
}

/* Table of contents */
.toc {
  padding: 1em;
  margin: 1em 0;
  border-radius: 0.3em;
  border: 1px solid currentcolor;
}

.toc ul {
  margin-bottom: 0;
}

/* Chart container */
.chart-container {
  margin: 20px 0;
  position: relative;
}

/* Figure styling */
figure {
  margin: 1.5em 0;
  text-align: left;
}

figcaption {
  margin-top: 0.5em;
}

/* Print styles */
@media print {
  body {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .editor-section,
  .controls-section,
  button {
    display: none;
  }

  .output {
    border: none;
    padding: 0;
    background: none;
  }
}

/* Error boundary */
.error-boundary {
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--error-color);
  border-radius: 4px;
}

/* Error boundary */
.error-boundary {
  background-color: #fff;
}

.error-boundary pre {
  margin: 0;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

/* Keyboard shortcuts help */
.keyboard-shortcuts {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 1rem;
  border-radius: 4px;
  display: none;
  z-index: 1000;
}

.keyboard-shortcuts.visible {
  display: block;
}

.keyboard-shortcuts kbd {
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.9em;
}

span.currency {
  display: inline;
  white-space: nowrap;
}
