:root {
  /* Cyber-Brutalism Fusion Palette */
  --bg-color: #000000;
  /* Void Black */
  --text-main: #e0f2fe;
  /* Holographic White */
  --text-muted: #94a3b8;
  /* Slate */

  /* Acid Neons */
  --color-primary: #00ff41;
  /* Matrix Green */
  --color-secondary: #00f3ff;
  /* Cyber Cyan */
  --color-accent: #ff00ff;
  /* Hot Pink */
  --color-warning: #facc15;
  /* Hazard Yellow */
  --color-danger: #ff2a2a;
  /* Error Red */
  --color-success: #00ff41;

  /* Structural (Neubrutalism Core) */
  --border-width: 2px;
  --border-color: #00ff41;
  /* Neon Borders! */
  --shadow-offset: 4px;
  --radius-sm: 0px;
  /* Sharp edges for cyber feel */
  --radius-md: 2px;
  --radius-lg: 4px;

  /* Hard Neon Shadows (No Blur) */
  --box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--color-secondary);
  --box-shadow-hover: 2px 2px 0 var(--color-secondary);
  --box-shadow-press: 0 0 0 var(--color-secondary);

  /* Tech Fonts */
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --font-sans: "JetBrains Mono", system-ui, -apple-system, monospace;
  /* All Mono for Cyber feel */

  --transition: all 0.1s steps(4);
  /* Digital/Stepped transition */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  padding: 2rem 1rem;

  /* Cyber Grid Background */
  background-image:
    linear-gradient(rgba(0, 255, 65, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
  background-size: 30px 30px;
}

.hidden {
  display: none !important;
}

/* Typography & Header - Glitch Style */
.page-header {
  text-align: center;
  margin-bottom: 4rem;
  padding: 2rem;
  background: #000;
  border: var(--border-width) solid var(--color-accent);
  /* Pink border for contrast */
  box-shadow: 6px 6px 0 var(--color-accent);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  transform: rotate(-1deg);
  /* The Slant */
  transition: transform 0.2s ease;
}

.page-header:hover {
  transform: rotate(0deg) scale(1.02);
  /* Straighten on hover */
}

/* Glitch Effect Keyframes */
@keyframes glitch-anim-1 {
  0% {
    clip: rect(20px, 9999px, 15px, 0);
  }

  20% {
    clip: rect(60px, 9999px, 80px, 0);
  }

  40% {
    clip: rect(10px, 9999px, 85px, 0);
  }

  60% {
    clip: rect(30px, 9999px, 5px, 0);
  }

  80% {
    clip: rect(70px, 9999px, 45px, 0);
  }

  100% {
    clip: rect(50px, 9999px, 20px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
  }

  20% {
    clip: rect(10px, 9999px, 45px, 0);
  }

  40% {
    clip: rect(90px, 9999px, 5px, 0);
  }

  60% {
    clip: rect(20px, 9999px, 80px, 0);
  }

  80% {
    clip: rect(5px, 9999px, 30px, 0);
  }

  100% {
    clip: rect(70px, 9999px, 20px, 0);
  }
}

.page-header h1 {
  font-size: 3rem;
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.05em;
  position: relative;

  /* Solid text shadow for depth */
  text-shadow:
    -1.5px -1.5px 0 #000,
    1.5px -1.5px 0 #000,
    -1.5px 1.5px 0 #000,
    1.5px 1.5px 0 #000,
    4px 4px 0 #000;
}

/* Glitch Layers */
.page-header h1::before,
.page-header h1::after {
  content: attr(data-text);
  /* Requires JS to set data-text, will fallback gracefully */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.page-header h1::before {
  left: 3px;
  text-shadow: -2px 0 #ff00c1;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.page-header h1::after {
  left: -3px;
  text-shadow: -2px 0 #00fff9;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

.hint {
  font-weight: bold;
  background: #000;
  color: var(--color-primary);
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
  margin-top: 1rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hint--panel {
  display: block;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 1.5rem;
  margin-top: 0;
  color: var(--text-muted);
  text-transform: none;
}

.tag {
  background: var(--color-secondary);
  color: #000;
  padding: 0.1rem 0.5rem;
  font-weight: bold;
  margin-right: 0.5rem;
  border: 1px solid var(--color-secondary);
}

/* Panels (Cards) */
.panel {
  background: #050505;
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 4rem;
  /* Big Gap */
  position: relative;
  transition: transform 0.2s ease;
  transform: rotate(1deg);
}

/* Chaos: Inconsistent Angles */
.panel:nth-of-type(odd) {
  transform: rotate(1.5deg);
}

.panel:nth-of-type(even) {
  transform: rotate(-1.2deg);
}

.panel:hover {
  transform: translate(-2px, -2px) rotate(0deg);
  box-shadow: 6px 6px 0 var(--color-secondary);
  /* Hard Cyan Shadow */
  border-color: #fff;
  /* Border glow up */
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
}

.panel__header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.panel__controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Inputs */
.login-field span {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--color-secondary);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.password-input-wrapper {
  position: relative;
}

input {
  width: 100%;
  padding: 1rem;
  background: #000;
  border: var(--border-width) solid var(--text-muted);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* Buttons */
button {
  padding: 0.8rem 1.6rem;
  border: var(--border-width) solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}

/* Primary Button Style (Green on Black) */
button[type="submit"],
#login-submit,
#toggle-capture {
  background: var(--color-primary);
  color: #000;
  border: 1px solid var(--color-primary);
  box-shadow: 4px 4px 0 #fff;
  /* White sharp shadow */
}

button[type="submit"]:hover,
#login-submit:hover,
#toggle-capture:hover {
  background: #fff;
  color: #000;
  box-shadow: 6px 6px 0 var(--color-primary);
  transform: translate(-2px, -2px);
}

/* Ghost / Secondary Buttons */
.ghost-button {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.ghost-button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
  text-shadow: 0 0 5px var(--color-accent);
}

button:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 transparent !important;
}

/* Login Panel */
.login-panel {
  min-height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 450px;
  background: #000;
  padding: 2.5rem;
  border: var(--border-width) solid var(--color-primary);
  box-shadow: 8px 8px 0 var(--color-primary);
  position: relative;
  transform: rotate(-1deg);
  transition: transform 0.2s ease;
}

.login-card:hover {
  transform: rotate(0deg) scale(1.01);
}

/* Corner decorations */
.login-card::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  width: 20px;
  height: 20px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
}

.login-card::after {
  content: "";
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
}

.login-card h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--color-primary);
  color: #fff;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  text-shadow: 2px 2px 0 var(--color-primary);
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--color-primary);
  padding: 0.5rem;
  cursor: pointer;
}

.eye-icon::before {
  content: '[ ◉ ]';
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1rem;
  color: var(--color-primary);
  text-shadow: 0 0 5px var(--color-primary);
}

.password-toggle:hover .eye-icon::before {
  content: '[ O ]';
}

.password-toggle.is-visible .eye-icon::before {
  content: '[///]';
  color: var(--color-danger);
  text-shadow: 0 0 5px var(--color-danger);
}

.login-error {
  background: rgba(255, 42, 42, 0.1);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  animation: shake 0.4s ease-in-out;
}

/* Status */
.status {
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 0.75rem;
  background: #000;
  color: var(--text-muted);
}

.status--active {
  background: #000;
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
  animation: pulse 2s infinite;
}

.status--inactive {
  border-style: dotted;
}

/* Logs */
.logs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-item {
  background: #000;
  border: 1px solid #333;
  padding: 0.8rem;
  font-family: var(--font-mono);
  border-left: 3px solid #333;
  transition: all 0.2s;
}

.log-item:hover {
  border-left-color: var(--color-secondary);
  background: #0a0a0a;
  box-shadow: -4px 0 0 var(--color-secondary);
  /* Left side neon glow */
}

.log-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #222;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.log-method {
  background: var(--color-accent);
  color: #000;
  font-weight: 900;
  padding: 0.1rem 0.4rem;
}

.log-url {
  color: var(--color-secondary);
}

.log-status {
  margin-left: auto;
  color: #fff;
}

.log-meta {
  font-size: 0.8rem;
  color: #666;
  gap: 1rem;
  display: flex;
}

/* Details */
details {
  margin-top: 0.5rem;
  border: 1px solid #333;
  background: #050505;
}

summary {
  padding: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

summary:hover {
  color: #fff;
  background: #111;
}

summary::after {
  content: "[+]";
}

details[open] summary::after {
  content: "[-]";
}

details[open] summary {
  background: #111;
  border-bottom: 1px solid #333;
  color: var(--color-primary);
}

.detail-block {
  padding: 0.5rem;
}

.detail-block__label {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

pre {
  background: #000;
  color: var(--color-primary);
  padding: 1rem;
  border: 1px solid #333;
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Animations */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(0, 255, 65, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 65, 0);
  }
}

@media (max-width: 640px) {
  .page-header h1 {
    font-size: 2rem;
  }
}

/* Unlock Screen Animation */
.unlock-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.unlock-content {
  text-align: center;
  width: 100%;
  max-width: 500px;
}

.unlock-text {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 20px var(--color-primary);
  margin-bottom: 1rem;
  animation: flash-text 0.5s infinite;
}

.unlock-sub {
  font-family: var(--font-mono);
  color: var(--color-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
  letter-spacing: 0.2em;
}

.unlock-bar {
  width: 100%;
  height: 4px;
  background: #111;
  border: 1px solid #333;
  position: relative;
  overflow: hidden;
}

.unlock-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
  width: 0%;
  animation: load-bar 1.5s cubic-bezier(0.1, 0, 0.1, 1) forwards;
}

@keyframes flash-text {

  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 20px var(--color-primary);
  }

  50% {
    opacity: 0.5;
    text-shadow: none;
  }
}

@keyframes load-bar {
  0% {
    width: 0%;
  }

  30% {
    width: 40%;
  }

  60% {
    width: 70%;
  }

  100% {
    width: 100%;
  }
}

/* Light Mode (Neubrutalism Revival) */
body.light-mode {
  --bg-color: #fff8f0;
  /* Cream */
  --text-main: #000000;
  /* Ink Black */
  --text-muted: #475569;

  /* Pop Colors */
  --color-primary: #a3e635;
  /* Lime */
  --color-secondary: #c084fc;
  /* Purple */
  --color-accent: #f472b6;
  /* Hot Pink */

  --border-width: 3px;
  --border-color: #000000;

  /* Solid Black Shadows */
  --box-shadow: 5px 5px 0 #000;
}

/* Light Mode Grid Override */
body.light-mode {
  background-image:
    linear-gradient(#0000000d 1px, transparent 1px),
    linear-gradient(90deg, #0000000d 1px, transparent 1px);
}

/* Light Mode Element Overrides */
body.light-mode .panel,
body.light-mode input,
body.light-mode .login-card,
body.light-mode pre,
body.light-mode .log-item,
body.light-mode summary,
body.light-mode #unlock-screen {
  background: #fff;
  color: #000;
  border-color: #000;
}

body.light-mode .page-header {
  background: #fff;
  color: #000;
  border-color: #000;
  box-shadow: 5px 5px 0 #000;
}

body.light-mode .page-header h1 {
  color: #000;
  text-shadow:
    -1.5px -1.5px 0 #fff,
    1.5px -1.5px 0 #fff,
    -1.5px 1.5px 0 #fff,
    1.5px 1.5px 0 #fff,
    3px 3px 0 #000;
}

/* Fix Glitch Background in Light Mode */
body.light-mode .page-header h1::before,
body.light-mode .page-header h1::after {
  background: var(--bg-color);
  color: #000;
}

body.light-mode .hint {
  background: var(--color-primary);
  color: #000;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 #000;
}

/* Status Badge - Invert for Readability in Light Mode */
body.light-mode .status {
  background: #fff;
  color: #000;
  border-color: #000;
  font-weight: 800;
}

body.light-mode .status--active {
  background: var(--color-primary);
  color: #000;
  border: 1px solid #000;
  box-shadow: 3px 3px 0 #000;
  animation: none;
}

body.light-mode input {
  background: #fff;
  color: #000;
  font-weight: 600;
}

body.light-mode .ghost-button {
  color: #000;
  border-color: #000;
}

body.light-mode button {
  border-color: #000;
  color: #000;
  box-shadow: 3px 3px 0 #000;
  font-weight: 900;
}

body.light-mode button:hover {
  background: #000;
  color: #fff;
  box-shadow: 5px 5px 0 var(--color-accent);
}

/* Theme Toggle Button Style */
.theme-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.theme-toggle {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-primary);
  text-shadow: 0 0 5px var(--color-primary);
  padding: 0.5rem;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  text-shadow: 0 0 10px var(--color-primary);
}

body.light-mode .theme-toggle {
  color: #000;
  text-shadow: none;
}