:root {
  --theme-color: #1c1a99;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#editor-container {
  max-width: 900px;
  margin: 50px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  flex: 1;
}

#editor-header {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--theme-color);
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 15px;
  gap: 6px;
}

.action-bar button {
  padding: 8px 14px;
  font-size: 14px;
  background-color: var(--theme-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.action-bar button:hover {
  background-color: #0d0c5f;
}

#toast {
  position: fixed;
  top: 40px;
  right: 40px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#theme-color-picker {
  position: absolute;
  top: 10px;
  right: 10px;
}

.footer {
  text-align: center;
  padding: 10px 0;
  background-color: var(--theme-color);
  color: #fff;
  font-size: 14px;
  margin-top: auto;
}

.footer a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

.footer a:hover {
  text-decoration: underline;
}

a.external::after {
  content: "↗";
  margin-left: 4px;
}

/* EasyMDE overrides to match theme */
.EasyMDEContainer .CodeMirror {
  border-color: #ccc;
  border-radius: 4px;
}

.editor-toolbar button.active,
.editor-toolbar button:hover {
  background: var(--theme-color);
  color: #fff;
  border-color: var(--theme-color);
}

@media screen and (max-width: 768px) {
  #editor-container {
    margin: 20px 10px;
    padding: 15px;
  }

  #editor-header {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .editor-toolbar {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 480px) {
  #editor-container {
    margin: 10px 5px;
    padding: 10px;
  }

  #editor-header {
    font-size: 18px;
  }

  .action-bar {
    justify-content: center;
  }

  .action-bar button {
    padding: 10px 16px;
    font-size: 14px;
  }

  .EasyMDEContainer .CodeMirror {
    min-height: 300px;
  }

  .editor-toolbar button {
    padding: 4px !important;
    width: 32px;
    height: 32px;
  }

  #toast {
    right: 10px;
    top: 10px;
    font-size: 13px;
  }

  .footer {
    font-size: 12px;
    padding: 8px 10px;
  }
}
