:root {
  --bg-color: #1e1e1e;
  --text-color: #dddddd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  font-family: sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

#shade {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(22, 22, 22);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  z-index: 1000;
}

.none {
  display: none !important;
}

.flex-grow {
  flex-grow: 1;
}

/* 全体 */
#md-editor-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

#md-editor-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* タブ部分のスタイル */
#editor-tabs {
  display: flex;
  background-color: #333;
  padding: 5px 2px;
  border-bottom: 1px solid #444;
  align-items: center;
}

#editor-tabs button {
  padding: 8px 15px;
  margin-right: 2px;
  background-color: #444;
  color: #fff;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

#editor-tabs button:hover {
  filter: brightness(1.2);
}

#editor-tabs button.active {
  background-color: var(--bg-color);
}

/* ダウンロードボタンのスタイル */
#editor-tabs #button-download {
  background-color: #28a745;
}

/* クリアボタンのスタイル */
#editor-tabs #button-clear {
  background-color: #dc3545;
}

/* PC版ではPreviewタブを非表示にする */
#tab-preview {
  display: none;
}

/* メインコンテンツエリア */
#main-content {
  display: flex;
  flex: 1;
  flex-direction: row;
}

#pane-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333;
}

#pane-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  color: #333333;
  overflow: auto;
}

#editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#editor-markdown,
#editor-css {
  flex: 1;
  height: 100%;
  width: 100%;
}

#iframe-preview {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
}

.editor-active {
  display: block;
}

/* モバイル向けスタイル */
@media (max-width: 1024px) {
  #main-content {
    flex-direction: column;
  }

  #editor-tabs {
    display: flex;
  }

  #tab-preview {
    display: block;
  }

  #pane-editor,
  #pane-preview {
    flex: 1;
    width: 100vw;
    height: auto;
    border-right: none;
  }
}