:root {
  color-scheme: dark;
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/RobotoMono-Regular.woff2") format("woff2");
}

body {
  margin: 0;
  height: 100vh;
  background: #282a36;
  display: flex;
  flex-direction: column;
  color: #f8f8f2;
}

body,
button,
select,
option {
  font-family: Helvetica, Arial, sans-serif;
}

#editor {
  flex: 1;
}

.CodeMirror {
  height: 100%;
  font-size: 18px;
  font-family: "Roboto Mono", monospace;
  line-height: 1.4;
  font-weight: 400;
}

footer {
  padding: 6px 10px;
  background: #44475a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

footer button,
select {
  font-size: 12px;
}

select,
button {
  margin-left: 6px;
  padding: 4px 8px;
  background: #6272a4;
  color: #f8f8f2;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

select:hover,
button:hover {
  background: #7082b6;
}

/* Scrollbars — visible only on hover, minimal */
.CodeMirror-scroll {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s;
}
.CodeMirror-scroll:hover {
  scrollbar-color: #6272a4 transparent;
}
.CodeMirror-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.CodeMirror-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.CodeMirror-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.3s;
}
.CodeMirror-scroll:hover::-webkit-scrollbar-thumb {
  background: #6272a4;
}

/* Restore picker */
#restore-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  align-items: center;
  justify-content: center;
}
#restore-overlay.visible {
  display: flex;
}

#restore-dialog {
  background: #282a36;
  border: 1px solid #6272a4;
  border-radius: 6px;
  padding: 16px;
  width: 420px;
  max-width: 90vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}
#restore-dialog h3 {
  margin: 0;
  font-size: 13px;
  color: #bd93f9;
}
#restore-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.restore-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: #44475a;
  border-radius: 4px;
}
.restore-item:hover {
  background: #50536b;
}
.restore-meta {
  flex: 1;
  overflow: hidden;
}
.restore-time {
  color: #8be9fd;
}
.restore-preview {
  color: #6272a4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.restore-item button {
  margin: 0;
  padding: 3px 8px;
  font-size: 11px;
}
.restore-item .del-btn {
  background: #44475a;
  color: #ff5555;
  border: 1px solid #ff5555;
}
.restore-item .del-btn:hover {
  background: #ff5555;
  color: #f8f8f2;
}
#restore-close {
  align-self: flex-end;
}
