/* メニューバーのスタイル */
.menubar {
  background: #1f2937;
  border-bottom: 1px solid #374151;
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-radius: 8px 8px 0 0;
}

.menu-item {
  position: relative;
  display: inline-block;
}

.menu-button {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.2s;
}

.menu-button:hover {
  background: #374151;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  min-width: 200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  margin-top: 4px;
  padding: 4px 0;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 8px 16px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #1f2937;
}

.dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdown-divider {
  height: 1px;
  background: #374151;
  margin: 4px 0;
}

.dropdown-item-label {
  flex: 1;
}

.dropdown-item-shortcut {
  color: #9ca3af;
  font-size: 12px;
  font-family: monospace;
  margin-left: 16px;
}

/* コンテキストメニュー */
.context-menu {
  display: none;
  position: fixed;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  min-width: 200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  padding: 4px 0;
}

.context-menu.show {
  display: block;
}

.context-menu-item {
  padding: 12px 16px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.context-menu-item:hover {
  background: #1f2937;
}

.context-menu-item:active {
  background: #374151;
}

.context-menu-label {
  flex: 1;
}

.context-menu-divider {
  height: 1px;
  background: #374151;
  margin: 4px 0;
}

.context-menu-section-title {
  padding: 8px 16px 4px 16px;
  color: #9ca3af;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
}

/* サブメニュー */
.context-menu-item.has-submenu {
  position: relative;
}

.context-menu-item.has-submenu::after {
  content: '▶';
  margin-left: auto;
  font-size: 10px;
  color: #9ca3af;
}

.context-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  min-width: 200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  padding: 4px 0;
  margin-left: 4px;
}

.context-menu-item.has-submenu:hover .context-submenu {
  display: block;
}

.context-submenu-item {
  padding: 12px 16px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.context-submenu-item:hover {
  background: #1f2937;
}

.context-submenu-item:active {
  background: #374151;
}

.context-submenu-label {
  flex: 1;
}

.context-submenu-preview {
  width: 32px;
  height: 32px;
  margin-left: 12px;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: repeating-conic-gradient(#374151 0% 25%, #1f2937 0% 50%) 50% / 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.context-submenu-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
