/**
 * ============================================================================
 * GDGoC Tree - Pixel Art (8-Bit Retro Gaming) Theme
 * ============================================================================
 * Pure code implementation of 8-bit arcade / NES aesthetic.
 * Strictly scoped under [data-theme="pixel"] to protect original classic styles.
 * Does NOT touch .container-background-border (outer rainbow frame).
 * ============================================================================
 */

/* --------------------------------------------------------------------------
   1. Global Pixel Art Typography & Rendering
   -------------------------------------------------------------------------- */
[data-theme="pixel"] body {
  font-family: "Press Start 2P", monospace, sans-serif;
  image-rendering: pixelated;
}

[data-theme="pixel"] * {
  image-rendering: pixelated;
}

/* --------------------------------------------------------------------------
   2. Main Container Styling & Subtle Retro CRT Scanlines
   -------------------------------------------------------------------------- */
[data-theme="pixel"] .container {
  background: #fdfbf7;
  border-radius: 0px;
  position: relative;
}

/* Subtle CRT Scanline effect (pure CSS, pointer-events none) */
[data-theme="pixel"] .container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.02) 0px,
    rgba(0, 0, 0, 0.02) 2px,
    transparent 2px,
    transparent 4px
  );
  z-index: 50;
}

/* --------------------------------------------------------------------------
   3. Google Circles -> 8-Bit Stepped Pixel Shapes
   -------------------------------------------------------------------------- */
[data-theme="pixel"] .google-circle {
  border-radius: 0;
  /* Authentic 8-bit stepped circle silhouette (blocky pixel stair-stepping) */
  clip-path: polygon(
    30% 0%,
    70% 0%,
    70% 5%,
    85% 5%,
    85% 15%,
    95% 15%,
    95% 30%,
    100% 30%,
    100% 70%,
    95% 70%,
    95% 85%,
    85% 85%,
    85% 95%,
    70% 95%,
    70% 100%,
    30% 100%,
    30% 95%,
    15% 95%,
    15% 85%,
    5% 85%,
    5% 70%,
    0% 70%,
    0% 30%,
    5% 30%,
    5% 15%,
    15% 15%,
    15% 5%,
    30% 5%
  );
  filter: drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.15));
}

/* --------------------------------------------------------------------------
   4. Floating Particles -> 8-Bit Square Pixels
   -------------------------------------------------------------------------- */
[data-theme="pixel"] .particle {
  border-radius: 0;
  width: 6px;
  height: 6px;
  opacity: 0.65;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.25);

  animation: particle-drift steps(50, end) infinite;
}

/* --------------------------------------------------------------------------
   5. Header & Text Typography (8-Bit NES Style)
   -------------------------------------------------------------------------- */
[data-theme="pixel"] .container h1,
[data-theme="pixel"] #title {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 64px;
  line-height: 1.5;
  letter-spacing: -1px;
  color: #1a1a1a;
  text-shadow:
    3px 3px 0px #4285f4,
    6px 6px 0px rgba(0, 0, 0, 0.15);
  padding-top: 180px;
}

[data-theme="pixel"] .container p,
[data-theme="pixel"] #description {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 11px;
  line-height: 2;
  color: #4a4a4a;
  max-width: 550px;
  margin-left: 0;
  margin-top: 12px;
}

[data-theme="pixel"] .logo {
  image-rendering: pixelated;
}

/* --------------------------------------------------------------------------
   6. 8-Bit Retro Buttons & Links
   -------------------------------------------------------------------------- */
[data-theme="pixel"] .container a {
  border-radius: 0;
  border: 3px solid #000000;
  background: #ffffff;
  box-shadow:
    4px 4px 0px #000000,
    inset 3px 3px 0px rgba(255, 255, 255, 0.8),
    inset -3px -3px 0px rgba(0, 0, 0, 0.15);
  height: 52px;
  transition:
    transform 0.1s steps(2),
    box-shadow 0.1s steps(2);
}

[data-theme="pixel"] .container a::before {
  border-radius: 0;
  transition: width 0.25s steps(4);
}

[data-theme="pixel"] .container a span {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 11px;
  font-weight: normal;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

[data-theme="pixel"] .container a img {
  border-radius: 0;
  image-rendering: pixelated;

  transition: 0.25s steps(4);
}

[data-theme="pixel"] .container .button-wrapper:hover a {
  transform: translate(-2px, -2px);
  box-shadow:
    6px 6px 0px #000000,
    inset 3px 3px 0px rgba(255, 255, 255, 0.9),
    inset -3px -3px 0px rgba(0, 0, 0, 0.2);
}

[data-theme="pixel"] .container .button-wrapper:active a {
  transform: translate(2px, 2px);
  box-shadow:
    2px 2px 0px #000000,
    inset -2px -2px 0px rgba(255, 255, 255, 0.8),
    inset 2px 2px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="pixel"] .container a.disabled {
  background: #cdcdcd;
  color: #555555;
}

[data-theme="pixel"] .container .button-wrapper:has(a.disabled):active {
  transform: none;
  box-shadow:
    4px 4px 0px #000000,
    inset 3px 3px 0px rgba(255, 255, 255, 0.8),
    inset -3px -3px 0px rgba(0, 0, 0, 0.15);
}

[data-theme="pixel"] .container a.disabled img {
  filter: grayscale(100%);
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   7. Dividers, Text Elements & Image Cards
   -------------------------------------------------------------------------- */
[data-theme="pixel"] .tree-divider {
  border-radius: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    #000000 0px,
    #000000 8px,
    transparent 8px,
    transparent 16px
  );
}

[data-theme="pixel"] .tree-heading {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #000000;
  text-transform: uppercase;
  margin: 12px 0 4px;
}

[data-theme="pixel"] .tree-paragraph {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 10px;
  line-height: 1.8;
  color: #444444;
}

[data-theme="pixel"] .tree-img-card {
  border-radius: 0;
  border: 3px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  background: #ffffff;
  transition:
    transform 0.1s steps(2),
    box-shadow 0.1s steps(2);
}

[data-theme="pixel"] .tree-img-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000000;
}

[data-theme="pixel"] .tree-img-caption {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 9px;
  border-radius: 0;
  border-top: 2px solid #000000;
  background: #f0f0f0;
}

[data-theme="pixel"] .tree-error-card {
  border-radius: 0;
  border: 3px solid #000000;
  background: #ffffff;
  box-shadow: 4px 4px 0px #000000;
  padding: 20px 16px;
}

[data-theme="pixel"] .tree-error-msg {
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 10px;
  line-height: 1.8;
  color: #1a1a1a;
}

[data-theme="pixel"] .tree-retry-btn {
  border-radius: 0;
  border: 3px solid #000000;
  background: #ea4335;
  color: #ffffff;
  font-family: "Press Start 2P", monospace, sans-serif;
  font-size: 10px;
  height: 44px;
  box-shadow:
    4px 4px 0px #000000,
    inset 2px 2px 0px rgba(255, 255, 255, 0.4);
  transition:
    transform 0.1s steps(2),
    box-shadow 0.1s steps(2);
}

[data-theme="pixel"] .tree-retry-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    6px 6px 0px #000000,
    inset 2px 2px 0px rgba(255, 255, 255, 0.4);
}

[data-theme="pixel"] .tree-retry-btn:active {
  transform: translate(2px, 2px);
  box-shadow:
    2px 2px 0px #000000,
    inset -2px -2px 0px rgba(255, 255, 255, 0.4);
}

/* --------------------------------------------------------------------------
   8. Mobile Responsiveness for Pixel Theme
   -------------------------------------------------------------------------- */
@media (max-width: 850px) {
  [data-theme="pixel"] .container h1,
  [data-theme="pixel"] #title {
    font-size: 28px;
    padding-top: 130px;
    line-height: 1.6;
    text-shadow:
      2px 2px 0px #4285f4,
      4px 4px 0px rgba(0, 0, 0, 0.15);
  }

  [data-theme="pixel"] .container p,
  [data-theme="pixel"] #description {
    font-size: 9px;
    line-height: 1.9;
  }

  [data-theme="pixel"] .container a span {
    font-size: 9.5px;
  }
}

/* --------------------------------------------------------------------------
   9. Motion Control for Pixel Theme
   -------------------------------------------------------------------------- */
html[data-motion="disabled"] [data-theme="pixel"] .particle {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="enabled"]) [data-theme="pixel"] .particle {
    animation: none;
  }
}
