html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #1C1B22;
  font-family: sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
  box-sizing: border-box;
}

#app {
  display: flex;
  box-sizing: border-box;
}

.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow: visible;
  box-sizing: border-box;
}

.config-strip {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: #151718;
  border-bottom: 1px solid #333;
  border-left: 1px solid #333;
  border-right: 1px solid #333;
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translate(-50%, 0);
  overflow-x: auto;
  flex-wrap: wrap;
  z-index: 10;
  width: 100%;
  max-width: 100vw;
}

.config-strip button,
.config-strip input,
.config-strip select {
  padding: 5px 8px;
  font-size: 14px;
  border: 1px solid #444;
  background-color: #2a2d2e;
  color: #ccc;
  border-radius: 3px;
}

.config-strip button {
  cursor: pointer;
  text-wrap: nowrap;
}

.config-strip button:hover {
  background-color: #3a3d3e;
}

.config-strip input {
  flex-grow: 1;
  min-width: 10ch;
  max-width: 50ch;
}

.config-strip select {
  cursor: pointer;
  max-width: 150px;
}

.screenshot-wrapper {
  padding: 20px;
  background-color: #1C1B22;
  border-radius: 4px;
  position: relative;
  margin-top: 60px;
  max-width: 95vw;
  box-sizing: border-box;
}

.editor-container {
  overflow: visible;
  position: relative;
  height: auto;
  box-shadow: 0 0px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  border-radius: 4px;
}

.CodeMirror {
  font-family: 'Anka Coder', 'Source Code Pro', monospace;
  font-size: 40px;
  line-height: 1.4;
  height: auto !important;
  width: 100%;
  min-width: 600px;
  padding: 1em;
  position: relative;
  box-sizing: border-box;
}

/* Mobile responsive font size */
@media screen and (max-width: 768px) {
  .CodeMirror {
    font-size: 20px;
  }
}

.CodeMirror-scroll {
  max-height: 70vh;
}

.CodeMirror {
  padding-top: var(--top-padding, 1em);
  padding-left: 1em;
  padding-right: 1em;
  padding-bottom: 1em;
}

/* Traffic light dots */
.threedots .CodeMirror::before {
  content: '';
  position: absolute;
  top: 0.75em;
  left: 1em;
  width: 24px;
  height: 24px;
  background-color: #ff5f56;
  border-radius: 50%;
  box-shadow:
    40px 0 0 #ffbd2e,
    80px 0 0 #27c93f;
  z-index: 1;
}

@media screen and (max-width: 768px) {
  .threedots .CodeMirror::before {
    width: 12px;
    height: 12px;
    box-shadow:
      20px 0 0 #ffbd2e,
      40px 0 0 #27c93f;
  }
}

.CodeMirror::after {
  content: var(--filename);
  position: absolute;
  top: 1em;
  left: var(--filename-left, 1em);
  font-size: 24px;
  font-family: 'Fira Code', 'Source Code Pro', monospace;
  display: var(--filename-display, 'block');
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 4em);
}

@media screen and (max-width: 768px) {
  .CodeMirror::after {
    font-size: 12px;
  }
}

.threedots .CodeMirror::after {
  --filename-left: 180px;
}

@media screen and (max-width: 768px) {
  .threedots .CodeMirror::after {
    --filename-left: 90px;
  }
}

.CodeMirror-linenumber {
  padding-right: 0.5em;
}

/* Help button styling */
.help-button {
  font-weight: bold;
  min-width: 30px;
  height: 30px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #151718;
  border-radius: 5px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow: auto;
  color: #ccc;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #444;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #ccc;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 70px);
}

.modal-body pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: monospace;
  line-height: 1.5;
  font-size: 1.25em;
}

.modal-body a {
  color: red;
}

.spinner {
  display: inline-block;
  width: 2em;
  height: 2em;
  border: 3px solid transparent;
  border-left: 3px solid silver;
  border-right: 3px solid silver;
  border-radius: 2em;
  animation: spinner 0.33s linear infinite;
}

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