/* ============================================
   xaviera.tech — Ultra Dev Theme
   ============================================ */

.dev-theme {
  --activity-w: 48px;
  --statusbar-h: 26px;
  --ultra-glow: rgba(26, 143, 224, 0.15);
}

.dev-theme.has-activity-bar {
  padding-left: var(--activity-w);
}

.dev-theme.has-activity-bar .header {
  margin-left: calc(-1 * var(--activity-w));
  padding-left: calc(var(--activity-w) + 24px);
  width: calc(100% + var(--activity-w));
}

.dev-theme.has-activity-bar .dev-scroll-progress {
  left: 0;
}

.dev-theme.has-statusbar {
  padding-bottom: var(--statusbar-h);
}

/* ---- Noise texture ---- */
.dev-noise {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Scroll progress ---- */
.dev-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 10001;
  background: linear-gradient(90deg, var(--brand, #1a8fe0), var(--code-green, #3dd68c), #6366f1);
  box-shadow: 0 0 12px var(--brand, #1a8fe0);
  transition: width 0.05s linear;
}

/* ---- Activity bar (VS Code left) ---- */
.dev-activity-bar {
  position: fixed;
  top: var(--header-height, 88px);
  left: 0;
  bottom: var(--statusbar-h);
  width: var(--activity-w);
  z-index: 999;
  background: #020406;
  border-right: 1px solid var(--ide-border, #1a2332);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
}

.dev-activity-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: #4a5568;
  border-left: 2px solid transparent;
  cursor: default;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
}

.dev-activity-icon:hover {
  color: var(--text-secondary);
}

.dev-activity-icon.active {
  color: #fff;
  border-left-color: var(--brand, #1a8fe0);
  background: rgba(26, 143, 224, 0.08);
}

.dev-activity-icon .badge {
  position: absolute;
  top: 6px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--brand, #1a8fe0);
  border-radius: 7px;
  font-family: var(--mono, monospace);
  font-size: 0.5rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dev-activity-spacer { flex: 1; }

/* ---- Global status bar ---- */
.dev-global-statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--statusbar-h);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: linear-gradient(90deg, var(--brand-dark, #0d6ebc), var(--brand, #1a8fe0) 40%, #2563eb);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.92);
  gap: 16px;
  overflow: hidden;
}

.dev-global-statusbar-left,
.dev-global-statusbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.dev-global-statusbar-center {
  flex: 1;
  text-align: center;
  opacity: 0.85;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.5625rem;
}

.dev-global-statusbar span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.2s;
}

.dev-global-statusbar span:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dev-global-statusbar .sb-ok { color: #a7f3d0; }
.dev-global-statusbar .sb-warn { color: #fde68a; }

/* ---- Command palette ---- */
.dev-cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(3, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.dev-cmd-palette.open {
  opacity: 1;
  visibility: visible;
}

.dev-cmd-box {
  width: min(560px, 92vw);
  background: var(--ide-bg, #050810);
  border: 1px solid var(--ide-border, #1a2332);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(26, 143, 224, 0.15);
  transform: translateY(-12px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dev-cmd-palette.open .dev-cmd-box {
  transform: translateY(0) scale(1);
}

.dev-cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ide-border, #1a2332);
  background: #030508;
}

.dev-cmd-input-wrap .cmd-icon {
  color: var(--brand-light, #4db3f5);
  font-family: var(--mono, monospace);
  font-size: 0.875rem;
}

.dev-cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono, monospace);
  font-size: 0.9375rem;
  color: var(--text-primary, #f1f5f9);
}

.dev-cmd-input::placeholder { color: var(--text-muted, #64748b); }

.dev-cmd-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.dev-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--mono, monospace);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.dev-cmd-item:hover,
.dev-cmd-item.selected {
  background: rgba(26, 143, 224, 0.12);
  color: var(--text-primary);
}

.dev-cmd-item .cmd-label { display: flex; align-items: center; gap: 10px; }
.dev-cmd-item .cmd-icon-sm { opacity: 0.5; font-size: 0.75rem; }
.dev-cmd-item kbd {
  font-size: 0.625rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ide-border);
  border-radius: 4px;
  color: var(--text-muted);
}

.dev-cmd-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--ide-border);
  font-family: var(--mono, monospace);
  font-size: 0.5625rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

/* ---- Boot sequence ---- */
.dev-boot {
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: #020406;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  transition: opacity 0.6s ease, visibility 0.6s;
}

.dev-boot.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dev-boot-inner {
  width: min(520px, 90vw);
  padding: 32px;
}

.dev-boot-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.dev-boot-logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(26, 143, 224, 0.4);
}

.dev-boot-logo span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.dev-boot-lines {
  font-size: 0.75rem;
  line-height: 1.9;
  color: var(--text-muted);
  min-height: 160px;
}

.dev-boot-lines .line-ok { color: var(--code-green, #3dd68c); }
.dev-boot-lines .line-info { color: var(--brand-light, #4db3f5); }
.dev-boot-lines .line-dim { opacity: 0.5; }

.dev-boot-progress {
  margin-top: 20px;
  height: 3px;
  background: var(--ide-border);
  border-radius: 2px;
  overflow: hidden;
}

.dev-boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--code-green));
  transition: width 0.3s ease;
  box-shadow: 0 0 12px var(--brand);
}

/* ---- Git toast ---- */
.dev-git-toast {
  position: fixed;
  bottom: calc(var(--statusbar-h) + 12px);
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.dev-toast-item {
  padding: 10px 14px;
  background: var(--ide-bg, #050810);
  border: 1px solid var(--ide-border);
  border-left: 3px solid var(--code-green, #3dd68c);
  border-radius: 8px;
  font-family: var(--mono, monospace);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 3.6s forwards;
  max-width: 320px;
}

.dev-toast-item .hash { color: var(--code-purple, #c792ea); }
.dev-toast-item .msg { color: var(--text-primary); margin-top: 2px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ---- Cmd hint badge ---- */
.dev-cmd-hint {
  position: fixed;
  bottom: calc(var(--statusbar-h) + 12px);
  left: calc(var(--activity-w) + 12px);
  z-index: 999;
  padding: 6px 12px;
  background: rgba(5, 8, 16, 0.9);
  border: 1px solid var(--ide-border);
  border-radius: 8px;
  font-family: var(--mono, monospace);
  font-size: 0.625rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  transition: opacity 0.4s;
}

.dev-cmd-hint kbd {
  padding: 2px 5px;
  background: rgba(26, 143, 224, 0.15);
  border: 1px solid rgba(26, 143, 224, 0.25);
  border-radius: 4px;
  color: var(--brand-light);
  margin: 0 2px;
}

.dev-cmd-hint.hidden { opacity: 0; pointer-events: none; }

/* ---- Hero: network canvas + glitch ---- */
#network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

.dev-theme .dev-hero-content h1 .highlight {
  position: relative;
}

.dev-theme .dev-hero-content h1:hover .highlight {
  animation: glitchText 0.4s ease;
}

@keyframes glitchText {
  0%, 100% { transform: translate(0); filter: none; }
  20% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--code-pink, #f07178); }
  40% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--code-cyan, #56d4ff); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(1px, -2px); text-shadow: 1px 0 var(--code-green, #3dd68c); }
}

/* ---- IDE ultra: breadcrumbs + minimap ---- */
.ide-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #060a10;
  border-bottom: 1px solid var(--ide-border);
  font-family: var(--mono, monospace);
  font-size: 0.625rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.ide-breadcrumbs span.sep { opacity: 0.4; }
.ide-breadcrumbs span.current { color: var(--brand-light, #4db3f5); }

.ide-body {
  position: relative;
}

.ide-minimap {
  width: 72px;
  flex-shrink: 0;
  background: #060a10;
  border-left: 1px solid var(--ide-border);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.ide-minimap-line {
  height: 2px;
  border-radius: 1px;
  background: rgba(26, 143, 224, 0.15);
  transition: background 0.3s;
}

.ide-minimap-line.active {
  background: rgba(26, 143, 224, 0.55);
  box-shadow: 0 0 4px rgba(26, 143, 224, 0.4);
}

.ide-minimap-line.purple { background: rgba(199, 146, 234, 0.25); }
.ide-minimap-line.green { background: rgba(61, 214, 140, 0.25); }

.ide-problems {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 14px;
  background: #060a10;
  border-top: 1px solid var(--ide-border);
  font-family: var(--mono, monospace);
  font-size: 0.5625rem;
  color: var(--text-muted);
}

.ide-problems .prob-ok { color: var(--code-green, #3dd68c); }

.dev-theme .ide-window {
  grid-template-rows: auto auto 1fr auto auto;
}

/* ---- 3D card tilt ---- */
.dev-tilt {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.dev-tilt-inner {
  transform: translateZ(20px);
}

/* ---- Neon section dividers ---- */
.dev-theme section {
  position: relative;
}

.dev-section-gutter {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 88px 8px 0 0;
  font-family: var(--mono, monospace);
  font-size: 0.5625rem;
  color: #2a3344;
  pointer-events: none;
  opacity: 0.6;
}

/* ---- Hex overlay on hero ---- */
.dev-hex-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill='none' stroke='%231a8fe0' stroke-width='0.5'%3E%3Cpath d='M13.99 1.5L26.5 8.75v14.5L13.99 30.5 1.5 23.25V8.75z'/%3E%3Cpath d='M13.99 18.5L26.5 25.75v14.5L13.99 47.5 1.5 40.25V25.75z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* ---- Pipeline: commit nodes ---- */
.dev-theme .pipeline-step {
  position: relative;
}

.dev-theme .pipeline-step::after {
  content: attr(data-commit);
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono, monospace);
  font-size: 0.5rem;
  color: var(--code-purple, #c792ea);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.dev-theme .pipeline-step:hover::after {
  opacity: 0.8;
}

/* ---- Keyboard shortcut overlay ---- */
.dev-kbd-overlay {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: 16px;
  z-index: 998;
  font-family: var(--mono, monospace);
  font-size: 0.5625rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ---- Mobile: hide ultra chrome ---- */
@media (max-width: 1024px) {
  .dev-theme.has-activity-bar {
    padding-left: 0;
  }
  .dev-theme.has-activity-bar .header {
    margin-left: 0;
    padding-left: 24px;
    width: 100%;
  }
  .dev-activity-bar,
  .dev-cmd-hint,
  .dev-kbd-overlay { display: none; }
}

@media (max-width: 768px) {
  .dev-global-statusbar-center { display: none; }
  .dev-boot-inner { padding: 20px; }
  .ide-minimap,
  .ide-breadcrumbs,
  .ide-problems { display: none; }
}
