/* ナビゲーション関連スタイル - navigation.css */

/* 履歴表示 */
.history-container {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.history-header h3 {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.history-list {
  max-height: 150px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  padding: 5px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
  align-items: center;
  font-size: 12px;
}

.history-item:hover {
  background-color: #f5f5f5;
}

.history-jan {
  font-weight: bold;
  color: #2196F3;
  margin-right: 8px;
  white-space: nowrap;
}

.history-name {
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

/* 洗練されたメニューアイコンのスタイル */
.menu-icon {
  display: none;
  width: 30px;
  height: 22px;
  position: relative;
  margin-right: 15px;
  cursor: pointer;
  z-index: 1200;
}

.menu-icon span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background-color: #2196F3;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .3s ease-in-out;
}

.menu-icon span:nth-child(1) {
  top: 0px;
}

.menu-icon span:nth-child(2) {
  top: 10px;
  width: 75%;
  right: 0;
  left: auto;
}

.menu-icon span:nth-child(3) {
  top: 20px;
}

/* メニューアイコンがアクティブになったときのスタイル */
.menu-icon.active span {
  background-color: #FF5252;
}

.menu-icon.active span:nth-child(1) {
  top: 10px;
  transform: rotate(45deg);
  width: 100%;
}

.menu-icon.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.menu-icon.active span:nth-child(3) {
  top: 10px;
  transform: rotate(-45deg);
  width: 100%;
}

/* モダンなモーダルメニューのスタイル */
.menu-modal {
  display: none;
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  z-index: 1100;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
}

.menu-modal.active {
  right: 0;
}

.menu-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
  height: 100%;
  overflow-y: auto;
  border-left: 1px solid rgba(0,0,0,0.05);
}

.menu-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.menu-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.close-menu {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #f0f3f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.close-menu:hover {
  background-color: #e6eaef;
  transform: rotate(90deg);
}

.menu-modal-body {
  padding: 15px;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.menu-list li {
  margin-bottom: 5px;
  transition: all 0.2s;
  border-radius: 10px;
  overflow: hidden;
}

.menu-list li:hover {
  transform: translateX(5px);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 15px;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.3s;
  background-color: rgba(255,255,255,0.7);
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  position: relative;
}

.menu-item:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: #2196F3;
  opacity: 0;
  transition: all 0.3s;
}

.menu-item:hover {
  background-color: #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  color: #2196F3;
}

.menu-item:hover:before {
  opacity: 1;
}

/* メニュー項目のアイコン */
.menu-item-icon {
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #2196F3;
}

/* オーバーレイのスタイル */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.menu-overlay.active {
  opacity: 1;
}

/* アニメーション効果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.menu-list li {
  opacity: 0;
  animation: slideIn 0.5s forwards;
}

.menu-list li:nth-child(1) { animation-delay: 0.1s; }
.menu-list li:nth-child(2) { animation-delay: 0.2s; }
.menu-list li:nth-child(3) { animation-delay: 0.3s; }
.menu-list li:nth-child(4) { animation-delay: 0.4s; }
.menu-list li:nth-child(5) { animation-delay: 0.5s; }
.menu-list li:nth-child(6) { animation-delay: 0.6s; }
.menu-list li:nth-child(7) { animation-delay: 0.7s; }
.menu-list li:nth-child(8) { animation-delay: 0.8s; }
.menu-list li:nth-child(9) { animation-delay: 0.9s; }
.menu-list li:nth-child(10) { animation-delay: 1.0s; }
.menu-list li:nth-child(11) { animation-delay: 1.1s; }

/* メニューが開いたときのみアニメーションを適用 */
.menu-modal.active .menu-list li {
  animation-play-state: running;
}

.menu-modal:not(.active) .menu-list li {
  animation: none;
  opacity: 0;
}

/* スマホビュー調整 */
@media screen and (max-width: 500px) {
  .menu-icon {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
  }
  
  .history-container {
    margin-top: 15px;
    padding-top: 5px;
  }
  
  .history-header h3 {
    font-size: 12px;
  }
  
  .history-list {
    max-height: 120px;
  }
  
  .history-item {
    padding: 3px 5px;
    font-size: 11px;
  }
  
  .history-jan {
    font-size: 11px;
  }
  
  .history-name {
    font-size: 10px;
    max-width: 60%;
  }
}