html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background-color: #1e1e1e;
  color: #cccccc;
}

#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;
}

#md-editor-container {
  display: flex;
  flex-direction: column; /* タブとメインコンテンツを縦に並べる */
  height: 100vh;
  width: 100vw;
}

#editor-tabs {
  display: flex;
  background-color: #333;
  padding: 5px 0;
  border-bottom: 1px solid #444;
  align-items: center; /* ボタンの垂直方向中央揃え */
}

#editor-tabs button {
  /* これがすべてのボタンに適用される基本スタイル */
  color: #fff;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  outline: none;
  font-size: 14px;
}

#editor-tabs button:hover {
  filter: brightness(1.2); /* ホバー効果 */
}

/* タブボタンのスタイル */
#editor-tabs #markdown-tab,
#editor-tabs #css-tab,
#editor-tabs #preview-tab {
  background-color: #444;
  border-radius: 4px 4px 0 0;
  margin-right: 2px;
}

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

#editor-tabs #markdown-tab.active,
#editor-tabs #css-tab.active,
#editor-tabs #preview-tab.active {
  background-color: #1e1e1e;
  color: #ffffff;
}

/* ダウンロードボタンのスタイル */
#editor-tabs #download-button {
  background-color: #28a745; /* 緑色 */
  border-radius: 4px;
  margin-left: 5px;
}

/* クリアボタンのスタイル */
#editor-tabs #clear-button {
  background-color: #dc3545; /* 赤色 */
  border-radius: 4px;
  margin-left: 5px;
}

/* メインコンテンツエリア (エディタとプレビューのラッパー) */
#main-content {
  display: flex;
  flex: 1; /* タブの下の残りのスペースを占める */
  flex-direction: row; /* PC版では左右に並べる */
}

#editor-pane {
  flex: 1; /* PC版ではエディタとプレビューが半々 */
  display: flex; /* JavaScriptで制御される */
  flex-direction: column;
  border-right: 1px solid #333;
}

#preview-pane {
  flex: 1;
  display: flex; /* JavaScriptで制御される */
  flex-direction: column;
  background-color: #ffffff;
  color: #333333;
  overflow: auto;
}

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

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

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

/* モバイル向けスタイル */
@media (max-width: 768px) {
  #main-content {
    flex-direction: column; /* モバイル版では縦に並べる */
  }

  /* モバイルではeditor-tabsは常に表示 */
  #editor-tabs {
    display: flex;
  }

  /* モバイルではPreviewタブを表示 */
  #preview-tab {
    display: block;
  }

  #editor-pane, #preview-pane {
    flex: 1; /* モバイルでは残りのスペースを占めるように */
    width: 100vw;
    height: auto;
    border-right: none;
    /* JavaScriptでdisplayが切り替えられる */
  }
}

