/* PROJECTS SECTION (NEURAL MAP) STYLE */
.projects-section {
  background-color: rgba(5, 8, 16, 0.4);
  position: relative;
  z-index: 10;
}

.projects-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  width: 100%;
  min-height: 520px;
  align-items: stretch;
}

/* INTERACTIVE NEURAL NODE MAP (LEFT PANEL) */
.projects-interactive-map {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(10, 14, 26, 0.4);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 500px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

#project-connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.project-nodes-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Individual node orbits */
.project-node {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  /* Center the node on its (x, y) coordinate so SVG lines meet its middle */
  transform: translate(-50%, -50%);
  transition: transform var(--transition-bounce), border-color var(--transition-normal), box-shadow var(--transition-normal);
  z-index: 3;
  cursor: pointer;
}

.project-node:hover,
.project-node:focus-visible {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 10;
}

.project-node:focus-visible {
  outline: 1px solid var(--accent-cyan);
  outline-offset: 4px;
}

.project-node.active {
  background: rgba(0, 240, 255, 0.1);
}

/* Node Icons / Glyphs styling */
.node-glyph {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color var(--transition-normal);
}

.project-node:hover .node-glyph,
.project-node.active .node-glyph {
  color: var(--accent-cyan);
}

/* Category highlights */
.project-node.cat-enterprise {
  border-color: var(--accent-amber);
  box-shadow: 0 0 10px rgba(255, 174, 66, 0.15);
}
.project-node.cat-enterprise.active,
.project-node.cat-enterprise:hover {
  border-color: var(--accent-amber);
  box-shadow: var(--shadow-neon-amber);
}

.project-node.cat-ai {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}
.project-node.cat-ai.active,
.project-node.cat-ai:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-neon-cyan);
}

.project-node.cat-ml {
  border-color: var(--accent-violet);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}
.project-node.cat-ml.active,
.project-node.cat-ml:hover {
  border-color: var(--accent-violet);
  box-shadow: var(--shadow-neon-violet);
}

/* Floating Project Node Label (Only visible on hover / active) */
.node-label {
  position: absolute;
  top: 60px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  background: rgba(5, 7, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  letter-spacing: 1px;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity var(--transition-normal), color var(--transition-normal);
}

.project-node:hover .node-label,
.project-node.active .node-label,
.project-node.linked .node-label {
  opacity: 1;
  color: var(--text-primary);
}

/* SVG Connection Lines */
.conn-line {
  stroke: rgba(0, 240, 255, 0.15);
  stroke-width: 1.2;
  transition: stroke var(--transition-normal), stroke-width var(--transition-normal);
}

.conn-line.highlight {
  stroke: var(--accent-cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 4px var(--accent-cyan));
}

.conn-line.dimmed {
  stroke: rgba(255, 255, 255, 0.02);
}

/* TERMINAL DECODER CARD (RIGHT PANEL) */
.project-details-panel {
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-details-panel::before {
  content: ' ';
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 4px;
  z-index: 1;
  pointer-events: none;
}

.details-panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  color: var(--text-muted);
}

.pulse-square {
  width: 16px;
  height: 16px;
  border: 1px solid var(--accent-cyan);
  box-shadow: var(--shadow-neon-cyan);
  animation: pulse-node 1.5s infinite alternate;
}

.details-panel-content {
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.details-panel-content.hidden {
  display: none;
}

.details-category {
  font-size: 0.65rem;
  color: var(--accent-amber);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.details-title {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
}

.details-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.tech-pill {
  font-size: 0.6rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.details-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.details-highlights {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 15px;
}

.details-highlights li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  position: relative;
  padding-left: 15px;
}

.details-highlights li::before {
  content: '*';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-cyan);
}

/* Linked nodes row — projects connected on the map + the stack they share */
.details-linked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 15px;
}

.details-linked-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.details-linked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.linked-node-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 6px 10px;
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-normal), background var(--transition-normal);
}

.linked-node-chip:hover,
.linked-node-chip:focus-visible {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
}

.chip-name {
  font-size: 0.65rem;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.chip-shared {
  font-size: 0.55rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.details-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.enterprise-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--accent-amber);
  background: rgba(255, 174, 66, 0.08);
  border: 1px solid var(--accent-amber);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}

/* FETCH GITHUB DRAWER OVERLAY */
.repos-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(15px);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  display: flex;
  justify-content: flex-end;
}

.repos-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.repos-drawer {
  width: 100%;
  max-width: 600px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid rgba(0, 240, 255, 0.15);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.repos-drawer-overlay.active .repos-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 20px;
}

.drawer-header h3 {
  font-size: 1.2rem;
  color: var(--accent-cyan);
}

.drawer-close-btn {
  font-size: 2rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition-normal);
}

.drawer-close-btn:hover {
  color: var(--accent-crimson);
}

.drawer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 200px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
}

.drawer-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(0, 240, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: var(--radius-full);
  animation: spin-clockwise 1s infinite linear;
}

.repos-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.repos-grid.hidden {
  display: none;
}

.repo-item-card {
  background: var(--bg-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.repo-item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.2);
  background: var(--bg-card-hover);
}

.repo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.repo-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.repo-card-header a:hover .repo-name {
  color: var(--accent-cyan);
  text-shadow: var(--shadow-neon-cyan);
}

.repo-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 15px;
}

.repo-meta {
  display: flex;
  gap: 20px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-circle {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--text-muted);
}

.projects-footer {
  display: flex;
  justify-content: center;
  margin-top: 50px;
}

/* MOBILE PROJECT LIST (shown only on small screens; see responsive.css) */
.projects-mobile-list {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.mobile-project-card {
  background: var(--bg-card);
  border: var(--border-card);
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-project-card.cat-enterprise {
  border-left-color: var(--accent-amber);
}
.mobile-project-card.cat-ai {
  border-left-color: var(--accent-cyan);
}
.mobile-project-card.cat-ml {
  border-left-color: var(--accent-violet);
}

.mobile-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-card-head .node-glyph {
  font-size: 1.1rem;
}

.mobile-project-card .details-title {
  font-size: 1.25rem;
}

.mobile-project-card .details-highlights {
  margin: 0;
}

.mobile-project-card .details-actions {
  margin-top: 4px;
}
