:root {
  --main-color: darkslateblue;
  --bg-color: #f0f2f5;
  --card-bg-color: #ffffff;
  --border-color: #e0e0e0;
  --paid-color: #5cb85c;
  --pending-color: #f0ad4e;
  --topic-color: #556fb5;
  --allow-color: #ad4ef0;
  --text-color: #333;
  --secondary-text-color: #888;
}

body {
  font-family: -apple-system, BlinkMac-System-Font, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  margin: 0;
  padding: 20px;
}

/* 共通スタイル */
.history-container {
  width: 250px;
  background-color: var(--card-bg-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  color: var(--text-color);
}

.history-header {
  background-color: var(--main-color);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-weight: 500;
  font-size: 1.2em;
}

.history-list {
  padding: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: var(--card-bg-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  cursor: pointer;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.item-content > div {
  margin: 0 0 5px 0;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
}

.item-date,
.item-description {
  font-size: 14px;
  color: var(--secondary-text-color);
}

.status {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 12px;
  margin-top: 8px;
  font-weight: 600;
}

.status.paid {
  background-color: var(--paid-color);
  color: white;
}

.status.pending {
  background-color: var(--pending-color);
  color: white;
}
.status.allow {
  background-color: var(--allow-color);
  color: white;
}
.status.topic {
  background-color: var(--topic-color);
  color: white;
}

.item-arrow {
  font-size: 20px;
  color: var(--secondary-text-color);
}

/* PC用スタイル (常時表示) */
.menu-button {
  display: none; /* PCでは非表示 */
}

@media (min-width: 769px) {
  .history-container {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
  .history-list {
    height: 300px;
    overflow-x: scroll;
  }
  .close-button {
    display: none; /* PCでは非表示 */
  }
}

/* スマホ用スタイル (メニュー表示) */
@media (max-width: 768px) {
  body {
    padding: 0;
  }

  .history-list {
    overflow-x: scroll;
  }

  .menu-button {
    display: block;
    position: fixed;
    left: 20px;
    bottom: 20px;
    height: 22px;
    z-index: 100;
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .history-container {
    position: fixed;
    left: -100%; /* 初期状態は画面外に配置 */
    top: 0;
    height: 100%;
    width: 320px;
    max-width: 90vw;
    border-radius: 0;
    box-shadow: none;
    transition: left 0.3s ease-in-out;
    z-index: 99;
  }

  .history-container.active {
    left: 0; /* アクティブ時に画面内にスライド */
  }

  .history-header {
    padding: 15px;
  }

  .close-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
  }
}
