/* ============================================================
   Temple Modal - 悬浮弹窗样式
   ============================================================ */

/* CSS Variables 复用 jarvis 体系 */
.temple-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: overlayFadeIn 0.2s ease-out;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.temple-modal {
  width: min(95vw, 1400px);
  height: min(88vh, 900px);
  background: var(--bg-void, #0a0a0f);
  border: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.15));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 245, 212, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(0, 245, 212, 0.04);
  animation: modalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---- Header ---- */
.temple-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.1));
  flex-shrink: 0;
}

.temple-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.temple-title-icon {
  font-size: 18px;
  opacity: 0.8;
}

.temple-title-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #e8f4f8);
  letter-spacing: 0.5px;
}

.temple-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.2));
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #8a9bae);
  cursor: pointer;
  transition: all 0.15s ease;
}

.temple-close-btn:hover {
  border-color: var(--accent-cyan, #00f5d4);
  color: var(--accent-cyan, #00f5d4);
  background: rgba(0, 245, 212, 0.06);
}

/* ---- Tab Bar ---- */
.temple-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px 0;
  flex-shrink: 0;
}

.temple-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted, #5a6b7a);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  bottom: -1px;
}

.temple-tab:hover {
  color: var(--text-secondary, #8a9bae);
}

.temple-tab.active {
  color: var(--accent-cyan, #00f5d4);
  background: rgba(0, 245, 212, 0.06);
  border-color: var(--border-subtle, rgba(0, 245, 212, 0.15));
}

.temple-tab-icon {
  font-size: 14px;
}

/* ---- Metrics Strip ---- */
.temple-metrics {
  display: flex;
  gap: 1px;
  padding: 10px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.08));
  background: rgba(0, 0, 0, 0.2);
}

.temple-metric {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 4px;
  background: rgba(0, 245, 212, 0.03);
  border: 1px solid rgba(0, 245, 212, 0.06);
  min-width: 80px;
}

.temple-metric-label {
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  letter-spacing: 1px;
  font-weight: 500;
}

.temple-metric-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan, #00f5d4);
  font-variant-numeric: tabular-nums;
}

/* ---- Main Content ---- */
.temple-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ---- Tools Tab Layout ---- */
.temple-tools-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Category Tree (Left sidebar) */
.temple-tree {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px 0;
  border-right: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.08));
}

.temple-tree::-webkit-scrollbar {
  width: 4px;
}

.temple-tree::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.15);
  border-radius: 2px;
}

.temple-tree-section {
  margin-bottom: 4px;
}

.temple-tree-section-title {
  padding: 6px 16px 4px;
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  letter-spacing: 1.2px;
  font-weight: 600;
  text-transform: uppercase;
}

.temple-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 12.5px;
  color: var(--text-secondary, #8a9bae);
  cursor: pointer;
  transition: all 0.12s ease;
  border-left: 2px solid transparent;
}

.temple-tree-item:hover {
  background: rgba(0, 245, 212, 0.05);
  color: var(--text-primary, #e8f4f8);
}

.temple-tree-item.active {
  background: rgba(0, 245, 212, 0.08);
  color: var(--accent-cyan, #00f5d4);
  border-left-color: var(--accent-cyan, #00f5d4);
}

.temple-tree-subgroup {
  padding-left: 24px;
  font-size: 12px;
}

.temple-tree-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Tools List & Detail (Right panel) */
.temple-tools-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.temple-tool-list {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.temple-tool-list::-webkit-scrollbar {
  width: 4px;
}

.temple-tool-list::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.15);
  border-radius: 2px;
}

.temple-tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.08));
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.temple-tool-card:hover {
  border-color: rgba(0, 245, 212, 0.25);
  background: rgba(0, 245, 212, 0.04);
}

.temple-tool-card.selected {
  border-color: var(--accent-cyan, #00f5d4);
  background: rgba(0, 245, 212, 0.07);
}

.temple-tool-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(0, 245, 212, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.temple-tool-card-info {
  flex: 1;
  min-width: 0;
}

.temple-tool-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e8f4f8);
  margin-bottom: 2px;
}

.temple-tool-card-desc {
  font-size: 11.5px;
  color: var(--text-muted, #5a6b7a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.temple-tool-card-commands {
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  background: rgba(0, 245, 212, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Tool Detail Panel */
.temple-detail {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle, rgba(0, 245, 212, 0.08));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.temple-detail::-webkit-scrollbar {
  width: 4px;
}

.temple-detail::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.15);
  border-radius: 2px;
}

.temple-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.temple-detail-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #e8f4f8);
}

.temple-detail-display-name {
  font-size: 13px;
  color: var(--accent-cyan, #00f5d4);
  margin-top: 2px;
}

.temple-detail-source {
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  background: rgba(0, 245, 212, 0.05);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(0, 245, 212, 0.1);
  flex-shrink: 0;
}

.temple-detail-desc {
  font-size: 12.5px;
  color: var(--text-secondary, #8a9bae);
  line-height: 1.6;
}

.temple-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.temple-detail-section-title {
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  letter-spacing: 1.2px;
  font-weight: 600;
  text-transform: uppercase;
}

.temple-detail-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.temple-detail-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 212, 0.06);
  min-width: 80px;
}

.temple-detail-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #e8f4f8);
  font-variant-numeric: tabular-nums;
}

.temple-detail-stat-label {
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  letter-spacing: 0.5px;
}

/* Commands List */
.temple-commands {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.temple-command-item {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 212, 0.06);
}

.temple-command-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan, #00f5d4);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-bottom: 4px;
}

.temple-command-desc {
  font-size: 11.5px;
  color: var(--text-secondary, #8a9bae);
  line-height: 1.5;
}

/* Tags */
.temple-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.temple-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(123, 44, 191, 0.15);
  color: #c084fc;
  border: 1px solid rgba(123, 44, 191, 0.2);
}

/* Empty state */
.temple-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--text-muted, #5a6b7a);
  font-size: 13px;
}

.temple-empty-icon {
  font-size: 32px;
  opacity: 0.4;
}

/* Loading */
.temple-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted, #5a6b7a);
  font-size: 13px;
  gap: 10px;
}

/* Skills Tab overrides */
.temple-skills-container {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Section label */
.temple-section-label {
  font-size: 10px;
  color: var(--text-muted, #5a6b7a);
  letter-spacing: 1.2px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 10px 16px 6px;
}
