/* ============================================
   xaviera.tech — Advanced Dev Theme Layer
   ============================================ */

:root {
  --ide-bg: #050810;
  --ide-surface: #0a0f18;
  --ide-border: #1a2332;
  --ide-border-glow: rgba(26, 143, 224, 0.45);
  --code-cyan: #56d4ff;
  --code-pink: #f07178;
  --scanline-opacity: 0.35;
}

/* ---- Global ambient ---- */
body.dev-theme {
  background: #030508;
  position: relative;
}

.dev-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  opacity: var(--scanline-opacity);
}

.dev-grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(26, 143, 224, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 143, 224, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 75%);
}

.dev-vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(3, 5, 8, 0.65) 100%);
}

::selection {
  background: rgba(26, 143, 224, 0.35);
  color: #fff;
}

/* Custom scrollbar */
.dev-theme ::-webkit-scrollbar { width: 8px; height: 8px; }
.dev-theme ::-webkit-scrollbar-track { background: #060a10; }
.dev-theme ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand, #1a8fe0), #6366f1);
  border-radius: 4px;
}
.dev-theme ::-webkit-scrollbar-thumb:hover { background: var(--brand-light, #4db3f5); }

/* ---- IDE Header ---- */
.dev-theme .header {
  height: auto;
  background: #040608;
  border-bottom: 1px solid var(--ide-border);
  backdrop-filter: blur(20px);
}

.dev-theme .header.scrolled {
  background: rgba(4, 6, 8, 0.97);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(26, 143, 224, 0.06);
}

.dev-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 24px;
  background: #030508;
  border-bottom: 1px solid var(--ide-border);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.625rem;
  color: var(--text-muted);
  gap: 16px;
}

.dev-header-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dev-header-dots .ide-dot {
  width: 10px;
  height: 10px;
}

.dev-header-path {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dev-git-branch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(26, 143, 224, 0.1);
  border: 1px solid rgba(26, 143, 224, 0.2);
  border-radius: 4px;
  color: var(--code-green, #3dd68c);
}

.dev-header-path .path-sep { color: #3d4555; }
.dev-header-path .path-file { color: var(--text-secondary); }

.dev-header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.dev-header-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dev-header-meta .meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--code-green, #3dd68c);
  box-shadow: 0 0 8px var(--code-green, #3dd68c);
  animation: pulse 2s infinite;
}

.dev-theme .header-inner {
  height: 56px;
  padding-top: 0;
  padding-bottom: 0;
}

.dev-theme {
  --header-height: 88px;
}

/* Nav as IDE tabs */
.dev-theme .nav-link {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  position: relative;
}

.dev-theme .nav-link:hover {
  background: rgba(26, 143, 224, 0.06);
  border-color: rgba(26, 143, 224, 0.15);
  color: var(--brand-light, #4db3f5);
}

.dev-theme .nav-link.active {
  background: rgba(26, 143, 224, 0.1);
  border-color: rgba(26, 143, 224, 0.25);
  color: var(--brand-light, #4db3f5);
  box-shadow: inset 0 -2px 0 var(--brand, #1a8fe0);
}

.dev-theme .nav-link.active::before {
  content: '▸ ';
  opacity: 0.7;
}

.dev-theme .nav-cta.btn-primary {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.8125rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 20px rgba(26, 143, 224, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dev-theme .logo-icon-img {
  border: 2px solid rgba(26, 143, 224, 0.35);
  box-shadow: 0 0 16px rgba(26, 143, 224, 0.2);
}

/* ---- Section headers as code blocks ---- */
.dev-theme .section-header {
  position: relative;
  padding-left: 20px;
  border-left: 3px solid var(--brand, #1a8fe0);
}

.dev-theme .section-header::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--brand, #1a8fe0);
  box-shadow: 0 0 12px var(--brand-glow, rgba(26, 143, 224, 0.3));
}

.dev-theme .section-label {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--code-green, #3dd68c);
  padding: 4px 10px;
  background: rgba(61, 214, 140, 0.06);
  border: 1px solid rgba(61, 214, 140, 0.12);
  border-radius: 4px;
}

.dev-theme .section-title {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.dev-theme .section-title::after {
  content: '()';
  font-family: var(--mono, monospace);
  font-size: 0.45em;
  color: var(--code-purple, #c792ea);
  margin-left: 6px;
  font-weight: 500;
  vertical-align: middle;
  opacity: 0.7;
}

/* ---- Buttons: terminal style ---- */
.dev-theme .btn-primary {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  background: linear-gradient(135deg, var(--brand, #1a8fe0) 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 24px rgba(26, 143, 224, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.dev-theme .btn-primary:not(.nav-cta)::before {
  content: '$ ';
  opacity: 0.7;
}

.dev-theme .btn-outline {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  border-color: var(--ide-border);
  background: rgba(10, 15, 24, 0.6);
}

.dev-theme .btn-outline:hover {
  border-color: var(--brand-light);
  background: rgba(26, 143, 224, 0.08);
  box-shadow: 0 0 16px rgba(26, 143, 224, 0.12);
}

/* ---- Cards: bracket corners + glow ---- */
.dev-theme .dev-stat-box,
.dev-theme .dev-testimonial,
.dev-theme .dev-cta-box,
.dev-theme .card,
.dev-theme .dev-code-panel,
.dev-theme .dev-service-card {
  position: relative;
}

.dev-theme .dev-stat-box::before,
.dev-theme .dev-testimonial::before,
.dev-theme .dev-cta-box::before,
.dev-theme .card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 14px;
  height: 14px;
  border-top: 2px solid rgba(26, 143, 224, 0.4);
  border-left: 2px solid rgba(26, 143, 224, 0.4);
  border-radius: 12px 0 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.dev-theme .dev-stat-box::after,
.dev-theme .dev-testimonial::after,
.dev-theme .dev-cta-box::after,
.dev-theme .card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-bottom: 2px solid rgba(26, 143, 224, 0.4);
  border-right: 2px solid rgba(26, 143, 224, 0.4);
  border-radius: 0 0 12px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.dev-theme .dev-stat-box:hover::before,
.dev-theme .dev-stat-box:hover::after,
.dev-theme .dev-testimonial:hover::before,
.dev-theme .dev-testimonial:hover::after,
.dev-theme .card:hover::before,
.dev-theme .card:hover::after {
  opacity: 1;
}

.dev-theme .dev-service-card:hover {
  border-color: rgba(26, 143, 224, 0.5);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 32px rgba(26, 143, 224, 0.12),
    inset 0 1px 0 rgba(26, 143, 224, 0.08);
}

.dev-theme .dev-service-card-body {
  position: relative;
  padding: 0 28px;
}

/* Service card terminal header strip */
.dev-theme .dev-service-card {
  padding: 0 0 28px;
  overflow: hidden;
}

.dev-theme .dev-service-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #030508;
  border-bottom: 1px solid var(--ide-border);
  font-family: var(--mono, monospace);
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dev-theme .dev-service-card-head .ide-dot {
  width: 8px;
  height: 8px;
}

/* ---- Pipeline: animated data flow ---- */
.dev-theme .dev-pipeline::before {
  background: none;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--brand, #1a8fe0) 20%,
    var(--code-green, #3dd68c) 50%,
    var(--brand, #1a8fe0) 80%,
    transparent
  );
  opacity: 0.35;
  animation: pipelineFlow 3s linear infinite;
  background-size: 200% 100%;
}

@keyframes pipelineFlow {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.dev-theme .pipeline-icon {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 20px rgba(26, 143, 224, 0.05);
}

.dev-theme .pipeline-step:hover .pipeline-icon {
  background: rgba(26, 143, 224, 0.08);
  transform: scale(1.05);
}

/* ---- IDE window upgrades ---- */
.dev-theme .ide-window {
  box-shadow:
    0 0 0 1px rgba(26, 143, 224, 0.1),
    0 32px 64px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(26, 143, 224, 0.08);
}

.dev-theme .ide-code {
  text-shadow: 0 0 20px rgba(130, 170, 255, 0.08);
}

.dev-theme .ide-glow-ring {
  opacity: 0.75;
  filter: blur(1px);
}

/* ---- Hero upgrades ---- */
.dev-theme .dev-terminal-line {
  box-shadow: 0 0 24px rgba(26, 143, 224, 0.08), inset 0 0 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(26, 143, 224, 0.2);
}

.dev-theme .dev-status-item {
  border-color: rgba(26, 143, 224, 0.15);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.2);
}

.dev-theme .page-terminal-line {
  box-shadow: 0 0 24px rgba(26, 143, 224, 0.08);
  border-color: rgba(26, 143, 224, 0.2);
}

/* ---- Stats: LED display ---- */
.dev-theme .dev-stat-box .num {
  text-shadow: 0 0 30px rgba(77, 179, 245, 0.3);
  font-variant-numeric: tabular-nums;
}

.dev-theme .dev-stat-box .label {
  color: var(--code-green, #3dd68c);
  opacity: 0.75;
}

/* ---- CTA: terminal window ---- */
.dev-theme .dev-cta-box {
  box-shadow:
    0 0 60px rgba(26, 143, 224, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dev-theme .dev-cta-terminal {
  padding: 8px 14px;
  background: #030508;
  border: 1px solid var(--ide-border);
  border-radius: 6px;
  display: inline-block;
  text-align: left;
}

.dev-theme .dev-cta-terminal::before {
  content: '❯ ';
  color: var(--brand-light, #4db3f5);
}

/* ---- Footer: IDE status bar ---- */
.dev-theme .footer {
  background: #030508;
  border-top: 1px solid var(--ide-border);
  position: relative;
}

.dev-theme .footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-dark, #0d6ebc), var(--brand, #1a8fe0), #6366f1, var(--code-green, #3dd68c));
  opacity: 0.6;
}

.dev-theme .footer-bottom {
  margin-top: 32px;
  padding: 10px 0;
  border-top: 1px solid var(--ide-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono, monospace);
  font-size: 0.6875rem;
}

.dev-theme .footer-bottom p:last-child {
  color: var(--code-green, #3dd68c);
}

.dev-theme .footer-col h4 {
  font-family: var(--mono, monospace);
  font-size: 0.75rem;
  color: var(--brand-light, #4db3f5);
  text-transform: lowercase;
}

.dev-theme .footer-col h4::before {
  content: './';
  opacity: 0.5;
}

/* ---- Code panels: gutter + minimap feel ---- */
.dev-theme .dev-code-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-theme .dev-code-panel-head::before {
  content: '';
  display: flex;
  gap: 4px;
  width: 36px;
  height: 10px;
  background:
    radial-gradient(circle, #ff5f57 3px, transparent 3px) 0 50%,
    radial-gradient(circle, #febc2e 3px, transparent 3px) 12px 50%,
    radial-gradient(circle, #28c840 3px, transparent 3px) 24px 50%;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.dev-theme .dev-code-panel-body {
  background: var(--ide-surface);
  position: relative;
}

.dev-theme .dev-code-panel-body::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(26, 143, 224, 0.3) 0%,
    rgba(99, 102, 241, 0.2) 40%,
    rgba(61, 214, 140, 0.2) 70%,
    transparent 100%
  );
  opacity: 0.5;
}

/* ---- Portfolio filters: command palette ---- */
.dev-theme .portfolio-filters {
  padding: 12px 16px;
  background: var(--ide-bg);
  border: 1px solid var(--ide-border);
  border-radius: 10px;
  margin-bottom: 32px;
}

.dev-theme .filter-btn.active {
  box-shadow: inset 0 -2px 0 var(--brand, #1a8fe0);
}

/* ---- Cursor glow (JS adds element) ---- */
.dev-cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 143, 224, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.dev-theme:hover .dev-cursor-glow {
  opacity: 1;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .dev-header-top { display: none; }
  .dev-theme { --header-height: 56px; }
  .dev-theme .section-title::after { display: none; }
  .dev-cursor-glow { display: none; }
}
