/* ============================================
   LIFE SIM - SCI-FI RPG CHARACTER TERMINAL
   Base Stylesheet - Design System Foundation
   ============================================ */

/* ============================================
   CSS VARIABLES - COLOR PALETTE & THEME
   ============================================ */
:root {
  /* Background Colors */
  --bg-space-black: #0a0a0f;
  --bg-card: rgba(20, 20, 35, 0.8);
  --bg-card-hover: rgba(30, 30, 50, 0.9);
  --bg-overlay: rgba(10, 10, 15, 0.95);

  /* Category Accent Colors */
  --accent-physical: #00f0ff;      /* Cyan */
  --accent-appearance: #ff00aa;    /* Magenta */
  --accent-identity: #ffd700;      /* Gold */
  --accent-career: #00ff88;        /* Green */
  --accent-location: #4488ff;      /* Blue */
  --accent-family: #ff4466;        /* Red/Pink */
  --accent-lifestyle: #aa66ff;     /* Purple */

  /* UI Colors */
  --color-text-primary: #e0e0e8;
  --color-text-secondary: #b5b5c5;
  --color-text-muted: #808090;
  --color-border: rgba(100, 150, 255, 0.2);
  --color-border-glow: rgba(100, 150, 255, 0.4);

  /* Terminal Colors */
  --terminal-green: #00ff88;
  --terminal-cyan: #00f0ff;
  --terminal-text: #c0c0d0;

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Sizing */
  --grid-gap: 1.5rem;
  --border-radius: 8px;
  --border-width: 2px;

  /* Effects */
  --glow-size: 8px;
  --transition-speed: 0.3s;
  --scanline-opacity: 0.03;
  --grid-opacity: 0.08;
}

/* ============================================
   BASE RESET & TYPOGRAPHY
   ============================================ */
* {
  box-sizing: border-box;
}

html {
  position: relative;
  min-height: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--bg-space-black);
  background-image:
    /* Subtle grid texture */
    linear-gradient(90deg, rgba(100, 150, 255, var(--grid-opacity)) 1px, transparent 1px),
    linear-gradient(rgba(100, 150, 255, var(--grid-opacity)) 1px, transparent 1px),
    /* Scanline effect */
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, var(--scanline-opacity)) 0px,
      transparent 2px,
      transparent 4px
    );
  background-size: 50px 50px, 50px 50px, 100% 4px;
  background-attachment: fixed;
  margin-bottom: 80px; /* Footer clearance */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY STYLES
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  font-size: 2.5rem;
  font-weight: 900;
  text-shadow: 0 0 20px currentColor;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5, h6 {
  font-size: 1rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ============================================
   LINKS
   ============================================ */
a {
  color: var(--terminal-cyan);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  position: relative;
}

a:hover,
a:focus {
  color: var(--accent-physical);
  text-decoration: none;
  text-shadow: 0 0 8px currentColor;
}

a:active {
  color: var(--terminal-green);
}

/* Link underline glow effect */
a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 4px currentColor;
  transition: width var(--transition-speed) ease;
}

a:hover::after {
  width: 100%;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border: 2px solid currentColor;
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--terminal-cyan);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover,
.btn:focus {
  color: var(--accent-physical);
  border-color: var(--accent-physical);
  box-shadow:
    0 0 10px var(--accent-physical),
    inset 0 0 10px rgba(0, 240, 255, 0.1);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  box-shadow:
    0 0 5px var(--accent-physical),
    inset 0 0 5px rgba(0, 240, 255, 0.2);
}

.btn-primary {
  color: var(--terminal-cyan);
  border-color: var(--terminal-cyan);
}

.btn-primary:hover {
  color: var(--accent-physical);
  border-color: var(--accent-physical);
}

.btn-terminal {
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  color: var(--terminal-green);
  border-color: var(--terminal-green);
}

.btn-terminal:hover {
  color: var(--accent-career);
  border-color: var(--accent-career);
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  transition: all var(--transition-speed) ease;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-border-glow);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 15px var(--color-border-glow);
  transform: translateY(-4px);
}

.card-header {
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-body {
  padding: 1.25rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  width: 100%;
  background: rgba(15, 15, 25, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem 0;
}

/* Character Name (H1) */
.character-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}

/* Identity Tags Container */
.identity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

/* Individual Identity Tag */
.identity-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  transition: all var(--transition-speed) ease;
}

.identity-tag:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Tag type-specific colors - subtle accents */
.identity-tag[data-type="age"] {
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--color-text-primary);
}

.identity-tag[data-type="gender"] {
  border-color: rgba(255, 0, 170, 0.3);
  color: var(--color-text-primary);
}

.identity-tag[data-type="ethnicity"] {
  border-color: rgba(255, 215, 0, 0.3);
  color: var(--color-text-primary);
}

/* Character Summary */
.character-summary {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 70ch;
  margin: 0 auto 1rem;
  text-align: center;
}

/* Optional: Typewriter animation for summary */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.character-summary.typewriter-effect {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typewriter 2s steps(60, end) forwards;
}

/* Seed Display */
.seed-display {
  text-align: center;
  margin-bottom: 1rem;
}

.seed-display .serial-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: inline-block;
  transition: all var(--transition-speed) ease;
}

.seed-display .serial-code::before {
  content: 'SEED: ';
  color: var(--terminal-green);
  font-weight: 700;
  text-shadow: 0 0 5px var(--terminal-green);
}

.seed-display .serial-code:hover {
  border-color: var(--terminal-green);
  color: var(--terminal-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Hero Actions Container */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

/* Generate New Button */
.btn-generate {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--terminal-cyan);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--terminal-cyan);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-generate:hover {
  background: var(--terminal-cyan);
  color: #000;
}

.btn-generate:focus {
  outline: 2px solid var(--terminal-cyan);
  outline-offset: 2px;
}

/* Seed Input Form */
.seed-input-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.seed-input-form .form-control {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  color: var(--color-text-primary);
  padding: 0.65rem 1rem;
  min-width: 200px;
  transition: all var(--transition-speed) ease;
}

.seed-input-form .form-control::placeholder {
  color: var(--color-text-muted);
}

.seed-input-form .form-control:focus {
  border-color: var(--terminal-cyan);
  outline: none;
}

/* Responsive adjustments for hero section */
@media (max-width: 768px) {
  .hero-content {
    padding: 2rem 0;
  }

  .character-name {
    font-size: 2rem;
  }

  .identity-tags {
    justify-content: center;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-generate {
    width: 100%;
    max-width: 400px;
  }

  .seed-input-form {
    width: 100%;
    max-width: 400px;
  }

  .seed-input-form .form-control {
    min-width: 100%;
  }
}

@media (max-width: 576px) {
  .character-name {
    font-size: 1.75rem;
    letter-spacing: 0.1em;
  }

  .identity-tag {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .character-summary {
    font-size: 0.9rem;
  }

  .character-summary.typewriter-effect {
    white-space: normal;
    width: 100%;
    animation: none;
  }

  .btn-generate {
    font-size: 1rem;
    padding: 0.85rem 2rem;
  }
}

/* Hero section scrolls with page - no sticky positioning */

/* ============================================
   STAT BLOCKS (Base styling)
   ============================================ */

/* Stat Grid Section - Use Bootstrap grid, not CSS Grid */
.stat-grid {
  padding: 1rem 0 2rem;
}

/* Full-width container for stat blocks */
.stat-grid .container,
.stat-grid .container-fluid {
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Stat block columns - vertical spacing */
.stat-block-col {
  margin-bottom: 1.5rem;
}

/* Individual Stat Block Card */
.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 0;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Category-specific top borders with glow */
.stat-block[data-category="physical"] {
  border-top: 2px solid var(--accent-physical);
}

.stat-block[data-category="appearance"] {
  border-top: 2px solid var(--accent-appearance);
}

.stat-block[data-category="identity"] {
  border-top: 2px solid var(--accent-identity);
}

.stat-block[data-category="career"] {
  border-top: 2px solid var(--accent-career);
}

.stat-block[data-category="location"] {
  border-top: 2px solid var(--accent-location);
}

.stat-block[data-category="family"] {
  border-top: 2px solid var(--accent-family);
}

.stat-block[data-category="lifestyle"] {
  border-top: 2px solid var(--accent-lifestyle);
}

/* Hover effects for stat blocks */
.stat-block:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================
   STAT BLOCK HEADER
   ============================================ */
.stat-block-header {
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-block-header h3,
.stat-block-header .category-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--color-text-primary);
}

.stat-block-header .category-icon {
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px currentColor);
}

/* Category-specific header colors */
.stat-block[data-category="physical"] .stat-block-header h3,
.stat-block[data-category="physical"] .category-icon {
  color: var(--accent-physical);
}

.stat-block[data-category="appearance"] .stat-block-header h3,
.stat-block[data-category="appearance"] .category-icon {
  color: var(--accent-appearance);
}

.stat-block[data-category="identity"] .stat-block-header h3,
.stat-block[data-category="identity"] .category-icon {
  color: var(--accent-identity);
}

.stat-block[data-category="career"] .stat-block-header h3,
.stat-block[data-category="career"] .category-icon {
  color: var(--accent-career);
}

.stat-block[data-category="location"] .stat-block-header h3,
.stat-block[data-category="location"] .category-icon {
  color: var(--accent-location);
}

.stat-block[data-category="family"] .stat-block-header h3,
.stat-block[data-category="family"] .category-icon {
  color: var(--accent-family);
}

.stat-block[data-category="lifestyle"] .stat-block-header h3,
.stat-block[data-category="lifestyle"] .category-icon {
  color: var(--accent-lifestyle);
}

/* ============================================
   STAT BLOCK CONTENT
   ============================================ */
.stat-block-content {
  padding: 1.25rem;
  flex: 1;
}

/* Stat rows - label/value pairs */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
  flex-shrink: 0;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-primary);
  font-weight: 500;
  text-align: right;
}

/* Highlighted stat values */
.stat-value.highlight {
  color: var(--terminal-cyan);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

/* Single-column stat rows for longer values */
.stat-row.full-width {
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

.stat-row.full-width .stat-value {
  text-align: left;
}

/* ============================================
   SPECIAL BLOCKS - LOCATION
   ============================================ */
.location-map-container {
  margin-top: 1rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.4);
  aspect-ratio: 16 / 9;
  position: relative;
}

.location-map-container iframe,
.location-map-container img {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.location-map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   SPECIAL BLOCKS - FAMILY (Spouse Mini-Card)
   ============================================ */
.spouse-mini-card {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent-family);
  border-radius: var(--border-radius);
  box-shadow: 0 0 10px rgba(255, 68, 102, 0.2);
}

.spouse-mini-card-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-family);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spouse-mini-card-header::before {
  content: '💕';
  font-size: 1rem;
  filter: drop-shadow(0 0 3px var(--accent-family));
}

.spouse-mini-card .stat-row {
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.spouse-mini-card .stat-label {
  font-size: 0.75rem;
}

.spouse-mini-card .stat-value {
  font-size: 0.85rem;
  text-align: left;
}


/* ============================================
   NAVBAR
   ============================================ */
.navbar.navbar-dark {
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  padding: 1rem 1.5rem;
}

.navbar-brand.navbar-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terminal-cyan);
  text-shadow: 0 0 15px var(--terminal-cyan);
  transition: all var(--transition-speed) ease;
}

.navbar-brand.navbar-brand:hover {
  color: var(--accent-physical);
  text-shadow: 0 0 25px var(--accent-physical);
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
  position: relative;
}

.navbar-nav .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--terminal-cyan);
  box-shadow: 0 0 8px var(--terminal-cyan);
  transform: translateX(-50%);
  transition: width var(--transition-speed) ease;
}

.navbar-nav .nav-link:hover {
  color: var(--terminal-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.navbar-nav .nav-link:hover::before {
  width: 80%;
}

.navbar-nav .nav-link.active {
  color: var(--terminal-cyan);
  background: rgba(0, 240, 255, 0.15);
}

.navbar-toggler {
  border-color: var(--color-border);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 240, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80px;
  line-height: 80px;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  box-shadow:
    0 -2px 20px rgba(0, 0, 0, 0.5),
    0 -1px 10px var(--color-border-glow);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.footer .container {
  padding-right: 15px;
  padding-left: 15px;
}

.footer .text-muted {
  color: var(--color-text-muted);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
main {
  display: block;
  padding-top: 80px;
  min-height: calc(100vh - 80px);
}

body > .container,
body > .container-fluid {
  padding: 80px 15px 0;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-control {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(20, 20, 35, 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  color: var(--color-text-primary);
  padding: 0.75rem 1rem;
  transition: all var(--transition-speed) ease;
}

.form-control:focus {
  background: rgba(30, 30, 50, 0.8);
  border-color: var(--terminal-cyan);
  color: var(--color-text-primary);
  box-shadow:
    0 0 0 0.2rem rgba(0, 240, 255, 0.25),
    0 0 15px rgba(0, 240, 255, 0.3);
  outline: 0;
}

.form-control::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ============================================
   CODE BLOCKS
   ============================================ */
code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--terminal-green);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  overflow-x: auto;
  color: var(--terminal-text);
}

pre.prettyprint.lang-json {
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.6);
}

#codeWindow {
  height: 200px;
  width: 100%;
  overflow-y: scroll;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1rem;
}

/* ============================================
   TABLES
   ============================================ */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid var(--color-border);
}

.table thead th {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: bottom;
  border-bottom: 2px solid var(--color-border-glow);
  background: rgba(0, 0, 0, 0.3);
  color: var(--terminal-cyan);
}

.table tbody + tbody {
  border-top: 2px solid var(--color-border);
}

.table-bordered {
  border: 1px solid var(--color-border);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--color-border);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(100, 150, 255, 0.05);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 240, 255, 0.1);
  color: var(--color-text-primary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
  color: var(--color-text-muted);
}

.text-primary {
  color: var(--terminal-cyan);
}

.text-success {
  color: var(--terminal-green);
}

.text-glow {
  text-shadow: 0 0 10px currentColor;
}

.serial-code {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   ANIMATIONS & KEYFRAMES
   ============================================ */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px currentColor;
  }
  50% {
    box-shadow: 0 0 20px currentColor;
  }
}

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

/* Blinking cursor for terminal elements */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor-blink::after {
  content: '▊';
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }

  body {
    background-size: 30px 30px, 30px 30px, 100% 4px;
  }

  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 1.75rem;
  }

  .stat-block {
    padding: 1rem;
  }

  .footer {
    height: 60px;
    line-height: 20px;
    padding: 20px 0;
    text-align: center;
  }

  body {
    margin-bottom: 60px;
  }
}

/* ============================================
   SCROLLBAR STYLING (Webkit browsers)
   ============================================ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.5);
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
  background: rgba(0, 240, 255, 0.3);
  color: var(--color-text-primary);
}

::-moz-selection {
  background: rgba(0, 240, 255, 0.3);
  color: var(--color-text-primary);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--terminal-cyan);
  outline-offset: 2px;
}

/* ============================================
   API TERMINAL SECTION
   ============================================ */

/* API Terminal Container */
.api-terminal {
  width: 100%;
  background: linear-gradient(135deg, rgba(5, 5, 10, 0.98) 0%, rgba(10, 15, 10, 0.98) 100%);
  border-top: 3px solid var(--terminal-green);
  box-shadow:
    0 -4px 40px rgba(0, 255, 136, 0.3),
    0 4px 30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(0, 255, 136, 0.1);
  margin-top: 4rem;
  margin-bottom: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Enhanced scanline effect for terminal */
.api-terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.8;
}

/* CRT screen effect with subtle vignette */
.api-terminal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* Terminal content wrapper positioning */
.api-terminal .container {
  position: relative;
  z-index: 2;
  padding-top: 0;
  padding-bottom: 2rem;
}

/* ============================================
   TERMINAL HEADER BAR (Always Visible)
   ============================================ */
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0, 255, 136, 0.3);
  backdrop-filter: blur(5px);
  position: relative;
  flex-wrap: wrap;
}

/* Terminal title with blinking cursor */
.terminal-title {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--terminal-green);
  text-shadow:
    0 0 10px var(--terminal-green),
    0 0 20px rgba(0, 255, 136, 0.5);
  margin: 0;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  animation: terminal-glow 2s ease-in-out infinite;
}

/* Blinking cursor animation */
.terminal-title::after {
  content: '▊';
  display: inline-block;
  margin-left: 0.5rem;
  animation: blink 1.2s step-end infinite;
  color: var(--terminal-green);
  text-shadow:
    0 0 10px var(--terminal-green),
    0 0 20px rgba(0, 255, 136, 0.6);
}

@keyframes terminal-glow {
  0%, 100% {
    text-shadow:
      0 0 10px var(--terminal-green),
      0 0 20px rgba(0, 255, 136, 0.5);
  }
  50% {
    text-shadow:
      0 0 15px var(--terminal-green),
      0 0 30px rgba(0, 255, 136, 0.7),
      0 0 40px rgba(0, 255, 136, 0.4);
  }
}

/* Terminal action buttons container */
.terminal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Terminal-style buttons */
.btn-terminal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 2px solid var(--terminal-green);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--terminal-green);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Ripple effect for terminal buttons */
.btn-terminal::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 255, 136, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn-terminal:hover::before {
  width: 200px;
  height: 200px;
}

/* Terminal button hover state - fill with green */
.btn-terminal:hover {
  background: var(--terminal-green);
  color: #000;
  border-color: var(--terminal-green);
  box-shadow:
    0 0 20px rgba(0, 255, 136, 0.6),
    inset 0 0 10px rgba(0, 255, 136, 0.3);
  transform: translateY(-2px);
}

/* Terminal button active state */
.btn-terminal:active {
  transform: translateY(0);
  box-shadow:
    0 0 10px rgba(0, 255, 136, 0.4),
    inset 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Copied button feedback */
.btn-terminal.copied,
.btn-copy.copied {
  background: var(--terminal-green);
  color: #000;
  border-color: var(--terminal-green);
}

/* Toggle button with arrow indicator */
.toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.9rem;
}

.terminal-content.expanded + .terminal-header .toggle-icon,
#toggleTerminalButton .toggle-icon.expanded {
  transform: rotate(180deg);
}

/* ============================================
   COLLAPSIBLE CONTENT AREA
   ============================================ */
.terminal-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
}

/* Expanded state */
.terminal-content.expanded {
  max-height: 5000px;
  opacity: 1;
  padding: 2rem 0;
  overflow: visible;
}

/* Terminal section containers */
.terminal-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.terminal-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Terminal section titles */
.terminal-section-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terminal-green);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 255, 136, 0.3);
  text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

/* ============================================
   ENDPOINT DISPLAY SECTION
   ============================================ */
.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(0, 255, 136, 0.1);
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--terminal-green);
  background: transparent;
  padding: 0;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  text-shadow: 0 0 3px rgba(0, 255, 136, 0.2);
}

/* Copy button for code blocks */
.btn-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--terminal-green);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--terminal-green);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-copy:hover {
  background: var(--terminal-green);
  color: #000;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
  transform: scale(1.05);
}

.btn-copy:active {
  transform: scale(0.98);
}

/* ============================================
   REQUEST PARAMETERS TABLE
   ============================================ */
.terminal-table {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(0, 255, 136, 0.1);
}

.terminal-table thead {
  background: rgba(0, 0, 0, 0.6);
}

.terminal-table thead th {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terminal-green);
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid rgba(0, 255, 136, 0.4);
  text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.terminal-table tbody tr {
  transition: background 0.2s ease;
}

/* Alternating row backgrounds (subtle) */
.terminal-table tbody tr:nth-child(odd) {
  background: rgba(0, 255, 136, 0.03);
}

.terminal-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.3);
}

.terminal-table tbody tr:hover {
  background: rgba(0, 255, 136, 0.1);
}

.terminal-table tbody td {
  padding: 0.9rem 1rem;
  color: var(--terminal-text);
  border-bottom: 1px solid rgba(0, 255, 136, 0.15);
  vertical-align: top;
}

.terminal-table tbody tr:last-child td {
  border-bottom: none;
}

/* Parameter name styling (green accent) */
.param-name {
  font-weight: 700;
  color: var(--terminal-green);
  text-shadow: 0 0 3px rgba(0, 255, 136, 0.2);
}

/* Parameter type styling */
.param-type {
  font-weight: 600;
  color: var(--terminal-cyan);
  font-style: italic;
}

/* ============================================
   JSON RESPONSE SECTION
   ============================================ */
.json-response-container {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 6px;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: auto;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(0, 255, 136, 0.1);
}

.json-response-container pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--terminal-text);
  background: transparent;
  border: none;
  padding: 1.25rem;
  padding-top: 3rem; /* Space for copy button */
  margin: 0;
  white-space: pre;
  overflow: visible;
}

/* Syntax highlighting for JSON */
.json-response-container .str {
  color: #00ff88;
}

.json-response-container .num {
  color: #00f0ff;
}

.json-response-container .kwd {
  color: #ffd700;
}

.json-response-container .pln {
  color: var(--terminal-text);
}

.json-response-container .pun {
  color: var(--terminal-green);
}

/* Custom scrollbar for JSON container */
.json-response-container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.json-response-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
}

.json-response-container::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.3);
  border-radius: 5px;
}

.json-response-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 136, 0.5);
}

/* Optional: Line numbers via CSS counters */
.json-response-container pre.line-numbers {
  counter-reset: line;
  padding-left: 3.5rem;
}

.json-response-container pre.line-numbers .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 2.5rem;
  margin-left: -3.5rem;
  margin-right: 1rem;
  text-align: right;
  color: var(--terminal-text);
  opacity: 0.5;
  user-select: none;
}

/* ============================================
   TERMINAL EFFECTS & ANIMATIONS
   ============================================ */

/* Phosphor glow on text */
.api-terminal code,
.api-terminal pre,
.terminal-table {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle flicker effect on terminal title */
@keyframes terminal-flicker {
  0%, 100% {
    opacity: 1;
  }
  5% {
    opacity: 0.95;
  }
  10% {
    opacity: 1;
  }
  15% {
    opacity: 0.98;
  }
  20% {
    opacity: 1;
  }
}

.terminal-title {
  animation:
    terminal-glow 2s ease-in-out infinite,
    terminal-flicker 5s ease-in-out infinite;
}

/* Scanline animation (optional, can be enabled via JS) */
@keyframes scanline-move {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

.api-terminal.scanline-active::before {
  animation: scanline-move 8s linear infinite;
}

/* Green phosphor glow on code elements */
.code-block:hover,
.json-response-container:hover {
  border-color: rgba(0, 255, 136, 0.5);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(0, 255, 136, 0.2);
}

/* ============================================
   RESPONSIVE DESIGN - API TERMINAL
   ============================================ */
@media (max-width: 768px) {
  .terminal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 0;
  }

  .terminal-title {
    font-size: 1rem;
    text-align: center;
  }

  .terminal-actions {
    justify-content: center;
  }

  .btn-terminal {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }

  .code-block,
  .json-response-container {
    font-size: 0.8rem;
  }

  .terminal-table {
    font-size: 0.75rem;
  }

  .terminal-table thead th,
  .terminal-table tbody td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 576px) {
  .terminal-title {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }

  .terminal-actions {
    flex-direction: column;
  }

  .btn-terminal {
    width: 100%;
  }

  .code-block code,
  .json-response-container pre {
    font-size: 0.75rem;
  }

  .terminal-table {
    display: block;
    overflow-x: auto;
  }

  .btn-copy {
    position: static;
    display: block;
    margin: 0.5rem 0;
    width: 100%;
  }
}

/* ============================================
   PRINT STYLES FOR API TERMINAL
   ============================================ */
@media print {
  .api-terminal {
    background: white;
    border-top: 2px solid #000;
    box-shadow: none;
  }

  .api-terminal::before,
  .api-terminal::after {
    display: none;
  }

  .terminal-header {
    border-bottom: 1px solid #000;
  }

  .terminal-actions {
    display: none;
  }

  .terminal-content {
    max-height: none;
    opacity: 1;
    padding: 1rem 0;
  }

  .code-block,
  .json-response-container,
  .terminal-table {
    border: 1px solid #000;
    box-shadow: none;
  }

  .btn-copy {
    display: none;
  }
}
