/* ==========================================================================
   GLOBAL FUTURISTIC ERROR PAGES STYLESHEET
   Design: Cyber-Futuristic, Enterprise-Grade, Sleek & Responsive
   Editor / Author: Christian Herrera (christianherrera.com.ar)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Base */
  --bg-primary: #07090e;
  --bg-secondary: #0d111a;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(20, 30, 55, 0.75);
  --bg-terminal: rgba(6, 10, 18, 0.85);

  /* Borders & Glassmorphism */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);
  --glass-blur: blur(16px);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.05);

  /* Typography */
  --font-family-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', Consolas, monospace;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Default Accent (Cyan/Teal - General Tech) */
  --accent-rgb: 6, 182, 212;
  --accent-color: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.4);
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-glow: 0.5s ease-in-out;
}

/* Status Specific Accents Overrides */
.error-theme-400 {
  --accent-rgb: 245, 158, 11;
  --accent-color: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.error-theme-401 {
  --accent-rgb: 168, 85, 247;
  --accent-color: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.4);
  --accent-gradient: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%);
}

.error-theme-403 {
  --accent-rgb: 239, 68, 68;
  --accent-color: #ef4444;
  --accent-glow: rgba(239, 68, 68, 0.45);
  --accent-gradient: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}

.error-theme-404 {
  --accent-rgb: 56, 189, 248;
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.4);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
}

.error-theme-408 {
  --accent-rgb: 249, 115, 22;
  --accent-color: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.4);
  --accent-gradient: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

.error-theme-429 {
  --accent-rgb: 236, 72, 153;
  --accent-color: #ec4899;
  --accent-glow: rgba(236, 72, 153, 0.45);
  --accent-gradient: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
}

.error-theme-500 {
  --accent-rgb: 244, 63, 94;
  --accent-color: #f43f5e;
  --accent-glow: rgba(244, 63, 94, 0.45);
  --accent-gradient: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
}

.error-theme-502 {
  --accent-rgb: 251, 146, 60;
  --accent-color: #fb923c;
  --accent-glow: rgba(251, 146, 60, 0.4);
  --accent-gradient: linear-gradient(135deg, #fdba74 0%, #c2410c 100%);
}

.error-theme-503 {
  --accent-rgb: 16, 185, 129;
  --accent-color: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.4);
  --accent-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.error-theme-504 {
  --accent-rgb: 14, 165, 233;
  --accent-color: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.4);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-family-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. FUTURISTIC BACKGROUND SYSTEM
   -------------------------------------------------------------------------- */
.bg-viewport {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #0f172a 0%, var(--bg-primary) 70%);
}

.bg-grid {
  position: absolute;
  inset: -50% -50% -50% -50%;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(600px) rotateX(60deg);
  transform-origin: center 80%;
  animation: gridMove 25s linear infinite;
  opacity: 0.6;
}

@keyframes gridMove {
  0% { transform: perspective(600px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(600px) rotateX(60deg) translateY(60px); }
}

.bg-glow-orb-1 {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  animation: orbPulse 8s ease-in-out infinite alternate;
}

.bg-glow-orb-2 {
  position: absolute;
  bottom: -10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(90px);
  pointer-events: none;
}

@keyframes orbPulse {
  0% { opacity: 0.35; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 0.65; transform: translateX(-50%) scale(1.1); }
}

.bg-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0, 0, 0, 0.25) 50%,
    rgba(0, 0, 0, 0.25)
  );
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   4. LAYOUT & CONTAINER
   -------------------------------------------------------------------------- */
.error-page-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* Brand Header */
.brand-header {
  position: absolute;
  top: 2rem;
  left: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
  font-family: var(--font-family-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
}

.brand-name {
  background: linear-gradient(to right, #ffffff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Top System Status Indicator */
.system-status-badge {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Main Futuristic Glass Card */
.error-card {
  width: 100%;
  max-width: 760px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.error-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  opacity: 0.8;
}

.error-card::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. ERROR CONTENT TYPOGRAPHY & GRAPHICS (VERTICAL ALIGNMENT BLOCK)
   -------------------------------------------------------------------------- */
.error-header-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 1.5rem;
}

/* Code Graphic & Number display */
.error-code-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
  width: 100%;
}

.error-code {
  font-size: clamp(5rem, 14vw, 9.5rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-family: var(--font-family-mono);
  background: linear-gradient(180deg, #ffffff 20%, rgba(255, 255, 255, 0.4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  user-select: none;
  text-align: center;
}

/* Glitch Accent overlay on numbers */
.error-code-glow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(5rem, 14vw, 9.5rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-family: var(--font-family-mono);
  color: var(--accent-color);
  opacity: 0.25;
  filter: blur(12px);
  pointer-events: none;
  z-index: -1;
  text-align: center;
}

/* Cyber Badge Category - Strictly centered vertically below code */
.error-category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 9999px;
  color: var(--accent-color);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
  align-self: center;
}

/* Title & Description */
.error-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.error-description {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 2rem auto;
  font-weight: 400;
  text-align: center;
}

/* --------------------------------------------------------------------------
   6. TERMINAL & DIAGNOSTIC BOX
   -------------------------------------------------------------------------- */
.terminal-box {
  width: 100%;
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.25rem;
  text-align: left;
  font-family: var(--font-family-mono);
  font-size: 0.825rem;
  color: var(--text-muted);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  position: relative;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.terminal-dot:nth-child(1) { background: #ff5f56; }
.terminal-dot:nth-child(2) { background: #ffbd2e; }
.terminal-dot:nth-child(3) { background: #27c93f; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.terminal-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  word-break: break-all;
}

.terminal-line {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.terminal-prompt {
  color: var(--accent-color);
  user-select: none;
  font-weight: 700;
}

.terminal-highlight {
  color: var(--text-main);
  font-weight: 600;
}

.terminal-accent {
  color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   7. ACTION BUTTON (SINGLE CENTERED MAIN LINK)
   -------------------------------------------------------------------------- */
.action-group {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 2.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1px solid transparent;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 25px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px var(--accent-glow);
  filter: brightness(1.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.25 ease;
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   8. FOOTER METADATA
   -------------------------------------------------------------------------- */
.error-footer {
  margin-top: 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 10;
}

.error-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.error-footer a:hover {
  color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   9. SHOWCASE HUB / INDEX GRID SPECIFIC
   -------------------------------------------------------------------------- */
.hub-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem 1.5rem;
}

.hub-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.hub-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
}

.hub-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--hub-accent-rgb, 56, 189, 248), 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(var(--hub-accent-rgb, 56, 189, 248), 0.2);
}

.hub-card-code {
  font-family: var(--font-family-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--hub-accent-color, #38bdf8);
  margin-bottom: 0.5rem;
}

.hub-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.hub-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.hub-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hub-accent-color, #38bdf8);
}

.hub-card-arrow svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.hub-card:hover .hub-card-arrow svg {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .brand-header {
    top: 1.5rem;
    left: 1.5rem;
  }
  
  .system-status-badge {
    top: 1.5rem;
    right: 1.5rem;
  }

  .error-card {
    padding: 2.5rem 1.5rem;
    border-radius: 18px;
    margin-top: 3.5rem;
  }

  .terminal-box {
    padding: 1rem;
    font-size: 0.775rem;
  }

  .action-group {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brand-name {
    display: none;
  }

  .system-status-badge span {
    display: none;
  }

  .system-status-badge {
    padding: 0.4rem;
  }

  .error-code {
    font-size: 4.5rem;
  }
}
