/* Terminal 组件样式 - 通用终端样式 */

.terminalWrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #0a0a0a;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  min-height: 48px;
}

:global(.dark) .toolbar {
  background: #1f2937;
  border-bottom: 1px solid #374151;
}

/* 搜索栏样式 */
.searchBar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

:global(.dark) .searchBar {
  background: #1f2937;
  border-bottom: 1px solid #374151;
}

.left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.container {
  flex: 1;
  background-color: #1e1e1e;
  position: relative;
  overflow: hidden;
}

.content {
  width: 100%;
  height: 100%;
  padding: 0;
}

/* xterm.js 滚动条样式优化 */
.content :global(.xterm) {
  height: 100%;
  padding: 0 0 0.5rem 0.5rem; /* 下边距 左边距 */
}

.content :global(.xterm-screen) {
  padding: 0;
}

/* 搜索高亮样式 - 浅黄色背景 */
.content :global(.xterm-decoration-overview-ruler) {
  background-color: rgba(255, 235, 59, 0.4) !important;
}

.content :global(.xterm .xterm-decoration-overview-ruler) {
  background-color: rgba(255, 235, 59, 0.4) !important;
}

/* 当前搜索匹配项 - 深黄色 */
.content :global(.xterm .xterm-rows .xterm-decoration) {
  background-color: rgba(255, 235, 59, 0.6) !important;
}

/* 搜索结果背景高亮 */
.content :global(.xterm .xterm-rows > :not(.xterm-decoration-top-layer) .xterm-decoration) {
  background-color: rgba(255, 235, 59, 0.4) !important;
  color: #000 !important;
  font-weight: bold;
}

.content :global(.xterm-viewport) {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.content :global(.xterm-viewport::-webkit-scrollbar) {
  width: 10px;
}

.content :global(.xterm-viewport::-webkit-scrollbar-track) {
  background: transparent;
}

.content :global(.xterm-viewport::-webkit-scrollbar-thumb) {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.content :global(.xterm-viewport::-webkit-scrollbar-thumb:hover) {
  background-color: rgba(255, 255, 255, 0.5);
}

.statusOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.connecting {
  color: #facc15;
}

.reconnecting {
  color: #fb923c;
}

.disconnected {
  color: #94a3b8;
}

.error {
  color: #ef4444;
}

.statusIcon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
}

.statusText {
  font-size: 1.125rem;
  line-height: 1.75rem;
  margin-bottom: 0.5rem;
}

.statusDetail {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.searchBar {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background-color: rgba(17, 24, 39, 0.95);
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.searchInput {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  width: 200px;
  font-size: 0.875rem;
}

.searchInput::placeholder {
  color: #9ca3af;
}

.searchButton {
  padding: 0.25rem;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s;
}

.searchButton:hover {
  color: #fff;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .toolbar {
    padding: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .content {
    padding: 0.25rem;
  }

  .searchBar {
    top: 0.25rem;
    right: 0.25rem;
  }

  .searchInput {
    width: 150px;
  }
}

/* 分隔线样式 */
.divider {
  flex-shrink: 0;
  z-index: 10;
  background-color: #9ca3af;
  transition: all 150ms;

  &:hover {
    background-color: rgb(59 130 246 / 1);
  }

  &.dragging {
    background-color: rgb(59 130 246 / 1);
  }

  &.horizontal {
    width: 4px;
    cursor: col-resize;
  }

  &.vertical {
    height: 4px;
    cursor: row-resize;
  }
}
