/* ═══════════════ BASE RESET ═══════════════ */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

/* ═══════════════ NAV GLASS ═══════════════ */
.nav-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dark .nav-glass {
  background: rgba(3, 7, 18, 0.8);
}

.nav-link.active {
  color: #6366f1;
}

.dark .nav-link.active {
  color: #818cf8;
}

/* ═══════════════ HERO ═══════════════ */
.dot-grid {
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
}

.dark .dot-grid {
  background-image: radial-gradient(circle, #374151 1px, transparent 1px);
  opacity: 0.3;
}

.hero-glow {
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  animation: glow-pulse 6s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  0% { opacity: 0.15; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0.25; transform: translate(-50%, -50%) scale(1.15); }
}

/* ═══════════════ FADE IN UP ═══════════════ */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-up.delay-200 {
  transition-delay: 0.2s;
}

.fade-in-up.delay-400 {
  transition-delay: 0.4s;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-glow {
    animation: none;
  }
  .arch-arrow i {
    animation: none;
  }
}

/* ═══════════════ CODE BLOCKS ═══════════════ */
.code-block {
  background: #0f172a;
  border-radius: 0.75rem;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.code-header .copy-btn {
  padding: 0.25rem;
  border-radius: 0.25rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.code-header .copy-btn:hover {
  color: #e2e8f0;
  background: #334155;
}

.code-block pre {
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
}

.code-block code {
  color: #e2e8f0;
}

/* YAML syntax coloring */
.yk { color: #7dd3fc; } /* key */
.yv { color: #a5f3fc; } /* value */
.yc { color: #64748b; } /* comment */

.code-inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  padding: 0.15em 0.4em;
  border-radius: 0.375rem;
  background: #f1f5f9;
  color: #6366f1;
}

.dark .code-inline {
  background: #1e293b;
  color: #818cf8;
}

/* ═══════════════ TIER BADGES ═══════════════ */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  min-width: 3.5rem;
}

.tier-1 { background: #dcfce7; color: #166534; }
.tier-2 { background: #dbeafe; color: #1e40af; }
.tier-2b { background: #e0e7ff; color: #3730a3; }
.tier-3 { background: #f3f4f6; color: #4b5563; }

.dark .tier-1 { background: #052e16; color: #4ade80; }
.dark .tier-2 { background: #172554; color: #60a5fa; }
.dark .tier-2b { background: #1e1b4b; color: #818cf8; }
.dark .tier-3 { background: #1f2937; color: #9ca3af; }

/* ═══════════════ DATA SOURCE BADGES ═══════════════ */
.ds-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.ds-jdbc { background: #dcfce7; color: #166534; }
.ds-rest { background: #dbeafe; color: #1e40af; }
.ds-ldap { background: #fce7f3; color: #9d174d; }
.ds-sql { background: #fef3c7; color: #92400e; }
.ds-yaml { background: #e0e7ff; color: #3730a3; }

.dark .ds-jdbc { background: #052e16; color: #4ade80; }
.dark .ds-rest { background: #172554; color: #60a5fa; }
.dark .ds-ldap { background: #500724; color: #f472b6; }
.dark .ds-sql { background: #451a03; color: #fbbf24; }
.dark .ds-yaml { background: #1e1b4b; color: #818cf8; }

/* ═══════════════ ROLE BARS ═══════════════ */
.role-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 2rem;
  border-radius: 0.5rem;
  background: #f1f5f9;
  padding: 0 0.75rem;
  overflow: hidden;
}

.dark .role-bar {
  background: #1e293b;
}

.role-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 0.5rem;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.15;
}

.role-label {
  position: relative;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-perms {
  position: relative;
  font-size: 0.6875rem;
  color: #6b7280;
}

.dark .role-perms {
  color: #9ca3af;
}

/* ═══════════════ TAB BUTTONS ═══════════════ */
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #374151;
  background: #f9fafb;
}

.dark .tab-btn:hover {
  color: #d1d5db;
  background: #1f2937;
}

.tab-btn.active {
  color: #6366f1;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.dark .tab-btn.active {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ═══════════════ TAB PANELS ═══════════════ */
.tab-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-panel.active {
  display: block;
  opacity: 1;
}

/* ═══════════════ ARCHITECTURE ═══════════════ */
.arch-artifact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 500;
}

.dark .arch-artifact {
  background: #111827;
}

.arch-file {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #94a3b8;
}

.dark .arch-file {
  background: #111827;
  color: #6b7280;
}

.arch-arrow {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef2ff;
  border: 2px solid #c7d2fe;
}

.dark .arch-arrow {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
}

.arch-arrow i {
  animation: arrow-pulse 2s ease-in-out infinite;
}

@keyframes arrow-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ═══════════════ AI SKILLS ═══════════════ */
.ai-mesh {
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 102, 241, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 20%, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  animation: mesh-drift 12s ease-in-out infinite alternate;
}

@keyframes mesh-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 1%) scale(1.02); }
  100% { transform: translate(1%, -1%) scale(1); }
}

.ai-sparkle {
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

.skill-chain-node {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark .skill-chain-node {
  background: #111827;
  border-color: #1f2937;
}

.skill-chain-arrow,
.skill-chain-arrow-v {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  font-size: 1.25rem;
}

.skill-card {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: white;
  transition: all 0.2s;
}

.skill-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.dark .skill-card {
  border-color: #1f2937;
  background: #111827;
}

.dark .skill-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .ai-mesh { animation: none; }
  .ai-sparkle { animation: none; opacity: 1; }
  .mesh-drift { animation: none; }
}

/* ═══════════════ COPY FEEDBACK ═══════════════ */
.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
}

.copy-btn.copied i::before {
  content: '\eb7a'; /* bx-check icon */
}

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #374151;
}

.code-block::-webkit-scrollbar-thumb {
  background: #475569;
}
