/* ==========================================================================
   WISER WORKFLOWS - Site Map & Architecture Explorer Stylesheet
   ========================================================================== */

.sitemap-section {
  position: relative;
  overflow: hidden;
}

/* Control Toolbar */
.sitemap-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  backdrop-filter: blur(12px);
}

.sitemap-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-btn.active {
  background: rgba(43, 108, 176, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.view-switcher {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-btn.active {
  background: var(--accent-indigo);
  color: #fff;
  box-shadow: 0 0 10px rgba(43, 108, 176, 0.4);
}

/* --------------------------------------------------------------------------
   Visual Tree / Node Hierarchy View
   -------------------------------------------------------------------------- */
.sitemap-tree-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 2rem 0;
  min-height: 500px;
}

.tree-level {
  display: flex;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  position: relative;
  margin-bottom: 3.5rem;
}

.tree-level::after {
  content: '';
  position: absolute;
  bottom: -1.75rem;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(43, 108, 176, 0.4), rgba(43, 108, 176, 0.4), transparent);
  z-index: 0;
}

.tree-level:last-child {
  margin-bottom: 0;
}

.tree-level:last-child::after {
  display: none;
}

.tree-root-level::after {
  left: 50%;
  right: 50%;
  width: 2px;
  height: 3.5rem;
  bottom: -3.5rem;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Sitemap Node Card */
.sitemap-node-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  width: 100%;
  max-width: 280px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.sitemap-node-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-cyan-glow);
  background: var(--bg-card-hover);
}

.node-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.node-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(43, 108, 176, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
}

.node-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.node-card-route {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.node-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.node-explore-hint {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Grid View Directory
   -------------------------------------------------------------------------- */
.sitemap-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.category-group {
  margin-bottom: 3.5rem;
}

.category-group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.category-badge-count {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Side Drawer / Deep-Dive Node Inspector
   -------------------------------------------------------------------------- */
.sitemap-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sitemap-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.sitemap-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-medium);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 1200;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sitemap-drawer-backdrop.active .sitemap-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 2rem 2rem 1.25rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-content {
  padding: 2rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.drawer-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #cbd5e1;
}

.drawer-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 15, 26, 0.8);
  display: flex;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   Responsive Sitemap
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .tree-level {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
  }
  .tree-level::after {
    display: none;
  }
  .sitemap-node-card {
    max-width: 100%;
  }
}
