:root {
  --terminal-bg: #05070d;
}

body {
  overflow-x: hidden;
}

.page {
  min-height: 100vh;
  overflow-x: hidden;
}

.view-card {
  margin-bottom: 1.5rem;
}

.terminal-card {
  border: none;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
  background: var(--terminal-bg);
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 0.5rem 0.5rem 0 0;
}

.terminal-toolbar .btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.terminal-toolbar .btn:hover,
.terminal-toolbar .btn:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.terminal-title h3 {
  font-size: 1rem;
}

.terminal-wrapper {
  position: relative;
  height: calc(100vh - 180px);
  /* 從 260px 改為 180px，讓區域變大 */
  background: var(--terminal-bg);
  border-radius: 0 0 0.5rem 0.5rem;
  overflow: hidden;
  padding: 12px;
  /* 增加內邊距，文字才不會貼邊 */
}

@media (max-width: 768px) {
  .terminal-wrapper {
    height: calc(100vh - 320px);
  }
}

#terminal {
  width: 100%;
  height: 100%;
}

.terminal-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--terminal-bg);
  margin: 0 !important;
  border-radius: 0 !important;
}

.context-menu {
  position: fixed;
  background: #1f2331;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  min-width: 180px;
}

.context-menu button {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.context-menu.d-none {
  display: none;
}

.credential-password-field,
.credential-certificate-field {
  display: none;
}

.credential-password-field.active,
.credential-certificate-field.active {
  display: block;
}

.credential-certificate-field textarea {
  min-height: 140px;
}

.key-field-wrapper {
  position: relative;
}

.key-field-wrapper textarea {
  transition: filter 0.2s ease;
}

.key-field-wrapper[data-blurred='true'] textarea {
  filter: blur(6px);
  pointer-events: none;
}

.key-overlay {
  position: absolute;
  inset: 45px 16px 16px 16px;
  background: rgba(5, 7, 13, 0.92);
  border-radius: 0.5rem;
  padding: 1rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2;
}

.active-session-list .list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.active-session-list .session-meta {
  display: flex;
  flex-direction: column;
}

.active-session-list .session-meta small {
  color: #94a3b8;
}

.table tbody tr td:last-child {
  white-space: nowrap;
}

.view-card.d-none {
  display: none;
}

/* Status Indicator */
.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
}

.status-indicator-dot.busy {
  background-color: #f76707;
  /* Orange */
  box-shadow: 0 0 8px #f76707;
}

.status-indicator-dot.ready {
  background-color: #2fb344;
  /* Green */
  box-shadow: 0 0 8px #2fb344;
}

.status-indicator-dot.busy::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #f76707;
  animation: pulse 1.5s infinite;
  opacity: 0;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}