:root {
  --editor-bg: #22272e;
  --editor-card-bg: #2d333b;
  --editor-header-bg: rgb(68, 76, 86);
  --editor-footer-bg: rgb(68, 76, 86);
  --editor-border: rgb(45, 51, 59);
  --editor-border-muted: #373e47;
  --editor-text: #adbac7;
  --editor-text-muted: #768390;
  --editor-text-subtle: #636e7b;
  --editor-accent: #539bf5;
  --editor-accent-emphasis: #4184e4;
  --editor-success: #57ab5a;
  --editor-danger: #e5534b;
  --editor-warning: #c69026;
  --editor-btn-bg: #373e47;
  --editor-btn-hover: #444c56;
  --editor-btn-active: #4184e4;
  --editor-gutter-bg: #2d333b;
  --editor-line-highlight: rgba(65, 132, 228, 0.1);
  --editor-selection: rgba(65, 132, 228, 0.2);
  --editor-scrollbar: #444c56;
  --editor-scrollbar-hover: #768390;
}

.editorContainer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.editorContainer.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--editor-bg);
  padding: 1rem;
}

.editorContainer.fullscreen .editorCard {
  height: 100%;
}

.editorContainer.fullscreen .editorBody {
  flex: 1;
  max-height: none;
}

.editorCard {
  display: flex;
  flex-direction: column;
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.editorHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--editor-header-bg);
  border-bottom: 1px solid var(--editor-border);
  min-height: 2.75rem;
  gap: 1rem;
}

.editorHeaderLeft,
.editorHeaderCenter,
.editorHeaderRight {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.editorHeaderLeft {
  gap: 0.75rem;
}

.fileInfo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fileIcon {
  width: 1rem;
  height: 1rem;
  color: var(--editor-text-muted);
  flex-shrink: 0;
}

.fileName {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--editor-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.badgeSecondary {
  background: var(--editor-btn-bg);
  color: var(--editor-text-muted);
  border: 1px solid var(--editor-border-muted);
}

.headerSeparator {
  width: 1px;
  height: 1rem;
  background: var(--editor-border);
  margin: 0 0.25rem;
}

.languageSelector {
  position: relative;
}

.headerButton {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0 0.375rem;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  color: var(--editor-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  font-family: inherit;
}

.headerButton:hover {
  background: var(--editor-btn-bg);
  color: var(--editor-text);
}

.headerButton.active {
  background: var(--editor-btn-active);
  color: #ffffff;
}

.headerButton.active:hover {
  background: var(--editor-accent-emphasis);
}

.languageBtn {
  padding: 0 0.5rem;
}

.buttonIcon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.chevronIcon {
  width: 0.625rem;
  height: 0.625rem;
  flex-shrink: 0;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 10rem;
  max-height: 20rem;
  overflow-y: auto;
}

.dropdown.dropdownRight {
  left: auto;
  right: 0;
}

.dropdown.hide {
  display: none;
}

.dropdownContent {
  padding: 0.25rem;
}

.dropdownItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  color: var(--editor-text);
  font-size: 0.8125rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdownItem:hover {
  background: var(--editor-btn-bg);
}

.dropdownIcon {
  width: 1rem;
  height: 1rem;
  color: var(--editor-text-muted);
}

.dropdownDivider {
  height: 1px;
  background: var(--editor-border);
  margin: 0.25rem 0;
}

.fontSizeControl {
  display: flex;
  align-items: center;
  background: var(--editor-btn-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.25rem;
  height: 1.75rem;
  overflow: hidden;
}

.fontBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--editor-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fontBtn:hover {
  background: var(--editor-btn-hover);
  color: var(--editor-text);
}

.fontSizeLabel {
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--editor-text);
  min-width: 2.5rem;
  text-align: center;
  border-left: 1px solid var(--editor-border);
  border-right: 1px solid var(--editor-border);
}

.tinyIcon {
  width: 0.75rem;
  height: 0.75rem;
}

.editorBody {
  position: relative;
  flex: 1;
  min-height: 400px;
  max-height: calc(100vh - 250px);
  background: var(--editor-bg);
  overflow: hidden;
}

.codeMirrorContainer {
  width: 100%;
  height: 100%;
}

.codeMirrorContainer .CodeMirror {
  height: 100% !important;
  width: 100% !important;
  background: var(--editor-bg) !important;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--editor-text);
}

.codeMirrorContainer .CodeMirror-scroll {
  overflow: auto !important;
}

.codeMirrorContainer .CodeMirror-gutters {
  background: var(--editor-gutter-bg) !important;
  border-right: 1px solid var(--editor-border);
  padding-right: 0.5rem;
}

.codeMirrorContainer .CodeMirror-linenumber {
  color: var(--editor-text-subtle);
  padding: 0 0.75rem 0 0.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.codeMirrorContainer .CodeMirror-foldgutter {
  width: 1rem;
}

.codeMirrorContainer .CodeMirror-foldgutter-open,
.codeMirrorContainer .CodeMirror-foldgutter-folded {
  cursor: pointer;
  color: var(--editor-text-subtle);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
  transition: color 0.15s ease;
}

.codeMirrorContainer .CodeMirror-foldgutter-open:: after {
  content: "▾";
}

.codeMirrorContainer .CodeMirror-foldgutter-folded::after {
  content: "▸";
}

.codeMirrorContainer .CodeMirror-foldgutter-open: hover,
.codeMirrorContainer .CodeMirror-foldgutter-folded:hover {
  color: var(--editor-text);
}

.codeMirrorContainer .CodeMirror-activeline-background {
  background: var(--editor-line-highlight) !important;
}

.codeMirrorContainer .CodeMirror-selected {
  background: var(--editor-selection) !important;
}

.codeMirrorContainer .CodeMirror-matchingbracket {
  color: var(--editor-accent) !important;
  background: rgba(83, 155, 245, 0.2);
  border-bottom: 1px solid var(--editor-accent);
}

.codeMirrorContainer .CodeMirror-cursor {
  border-left: 2px solid var(--editor-accent);
}

.loadingSpinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(34, 39, 46, 0.9);
  backdrop-filter: blur(4px);
  z-index: 100;
}

.loadingSpinner[data-active="true"] {
  display: flex;
}

.spinnerContainer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinnerSvg {
  width: 3rem;
  height: 3rem;
  animation: rotate 1s linear infinite;
}

.spinnerTrack {
  fill: none;
  stroke: var(--editor-border);
  stroke-width: 4;
}

.spinnerHead {
  fill: none;
  stroke: var(--editor-accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 60;
  animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
  0% {
    stroke-dashoffset: 80;
  }
  50% {
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dashoffset: 80;
  }
}

.searchPanel {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  z-index: 50;
}

.searchPanel.hide {
  visibility: hidden;
  opacity: 0;
  transition: all 0.35s ease;
}

.searchContainer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
}

.searchInput {
  width: 200px;
  height: 1.75rem;
  padding: 0 0.625rem;
  background: var(--editor-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.25rem;
  color: var(--editor-text);
  font-size: 0.8125rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.searchInput:focus {
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 2px rgba(83, 155, 245, 0.2);
}

.searchInput::placeholder {
  color: var(--editor-text-subtle);
}

.searchActions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.searchCount {
  font-size: 0.6875rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--editor-text-muted);
  padding: 0 0.375rem;
  min-width: 2.5rem;
  text-align: center;
}

.searchNavBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: transparent;
  border: 1px solid var(--editor-border);
  border-radius: 0.25rem;
  color: var(--editor-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.searchNavBtn:hover {
  background: var(--editor-btn-bg);
  color: var(--editor-text);
  border-color: var(--editor-text-muted);
}

.editorFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 1rem;
  background: var(--editor-footer-bg);
  border-top: 1px solid var(--editor-border);
  font-size: 0.6875rem;
  color: var(--editor-text-muted);
  min-height: 1.75rem;
}

.editorFooterLeft,
.editorFooterCenter,
.editorFooterRight {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footerItem {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.footerLabel {
  color: var(--editor-text-subtle);
}

.footerValue {
  font-family: "JetBrains Mono", monospace;
  color: var(--editor-text-muted);
}

.footerBullet {
  color: var(--editor-text-subtle);
  margin: 0 0.125rem;
}

.footerIcon {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--editor-text-subtle);
}

.footerDivider {
  width: 1px;
  height: 0.75rem;
  background: var(--editor-border);
}

.statusIndicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.statusIcon {
  width: 0.75rem;
  height: 0.75rem;
}

.statusOk {
  color: var(--editor-success);
}

.statusError {
  color: var(--editor-danger);
}

.statusWarning {
  color: var(--editor-warning);
}

.footerBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  background: transparent;
  border: 1px solid var(--editor-border);
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--editor-text-muted);
}

.footerBadgeAccent {
  background: rgba(83, 155, 245, 0.1);
  border-color: rgba(83, 155, 245, 0.3);
  color: var(--editor-accent);
}

.badgeIcon {
  width: 0.625rem;
  height: 0.625rem;
}

.commitPanel {
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.5rem;
  padding: 1rem;
}

.commitPanel.hide {
  display: none;
}

.commitTitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--editor-text);
}

.commitContent {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.commitInput,
.commitTextarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--editor-bg);
  border: 1px solid var(--editor-border);
  border-radius: 0.25rem;
  color: var(--editor-text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.commitInput:focus,
.commitTextarea:focus {
  border-color: var(--editor-accent);
}

.commitInput::placeholder,
.commitTextarea::placeholder {
  color: var(--editor-text-subtle);
}

.commitTextarea {
  resize: vertical;
  min-height: 4rem;
  line-height: 1.5;
}

.commitActions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.commitBtnPrimary,
.commitBtnSecondary {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.commitBtnPrimary {
  background: #347d39;
  border: none;
  color: #ffffff;
}

.commitBtnPrimary:hover {
  background: #46954a;
}

.commitBtnSecondary {
  background: transparent;
  border: 1px solid var(--editor-border);
  color: var(--editor-text);
}

.commitBtnSecondary:hover {
  background: var(--editor-btn-bg);
  border-color: var(--editor-text-muted);
}

.hide {
  display: none !important;
}

@media (max-width: 768px) {
  .editorHeader {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .editorHeaderLeft,
  .editorHeaderCenter,
  .editorHeaderRight {
    flex-wrap: wrap;
  }

  .fileName {
    max-width: 120px;
  }

  .editorFooter {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .editorFooterLeft,
  .editorFooterCenter,
  .editorFooterRight {
    justify-content: center;
  }

  .searchPanel {
    left: 0.5rem;
    right: 0.5rem;
  }

  .searchInput {
    width: 100%;
    flex: 1;
  }
}