/* ==========================================================================
   HAN SOFTWARE - PURE MATRIX THEME STYLESHEET
   Authentic Green Phosphor Digital Rain & Cyberpunk Terminal
   ========================================================================== */

:root {
  --matrix-primary: #00ff66;
  --matrix-bright: #80ffaa;
  --matrix-dim: #00aa44;
  --matrix-glow: rgba(0, 255, 102, 0.4);
  --bg-deep: #020603;
  --bg-card: rgba(2, 14, 7, 0.88);
  --border-neon: rgba(0, 255, 102, 0.35);

  --font-mono: 'Share Tech Mono', monospace;
  --font-code: 'Fira Code', monospace;
  --font-heading: 'Orbitron', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.matrix-theme {
  background-color: var(--bg-deep);
  color: #e0f8ea;
  font-family: var(--font-code);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Canvas Background */
#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

/* Retro CRT Scanlines Overlay */
.matrix-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 3px, 6px 100%;
  opacity: 0.8;
}

/* Vignette Dark Edges */
.matrix-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%);
}

/* Ambient Glow Blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 1;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--matrix-glow);
  top: -150px;
  left: -150px;
  opacity: 0.15;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: var(--matrix-glow);
  bottom: -200px;
  right: -200px;
  opacity: 0.18;
}

/* App Container Layout */
.matrix-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 24px;
}

/* System Header */
.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 255, 102, 0.2);
}

.sys-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-indicator {
  width: 10px;
  height: 10px;
  background: var(--matrix-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--matrix-primary);
  animation: pulse-dot 1.4s infinite alternate;
}

@keyframes pulse-dot {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 16px var(--matrix-primary); }
}

.sys-code {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--matrix-primary);
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px var(--matrix-glow);
}

.sys-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--matrix-primary);
  background: rgba(0, 255, 102, 0.1);
  border: 1px solid rgba(0, 255, 102, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.hud-badge-sec {
  color: #80ffaa;
  border-color: rgba(128, 255, 170, 0.4);
}

.hud-btn {
  background: transparent;
  border: 1px solid var(--border-neon);
  color: var(--matrix-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: var(--matrix-primary);
  color: var(--bg-deep);
  box-shadow: 0 0 14px var(--matrix-glow);
}

/* Center Terminal Layout */
.matrix-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.cyber-terminal-card {
  width: 100%;
  max-width: 900px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-neon);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 45px rgba(0, 0, 0, 0.8), 0 0 30px var(--matrix-glow);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

/* Terminal Titlebar */
.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(2, 10, 5, 0.95);
  border-bottom: 1px solid rgba(0, 255, 102, 0.25);
}

.terminal-lights {
  display: flex;
  gap: 7px;
}

.terminal-lights .light {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-lights .red { background: #ff5f56; }
.terminal-lights .yellow { background: #ffbd2e; }
.terminal-lights .green { background: var(--matrix-primary); box-shadow: 0 0 6px var(--matrix-primary); }

.terminal-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--matrix-primary);
  letter-spacing: 1.2px;
  text-shadow: 0 0 8px var(--matrix-glow);
}

.terminal-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* Terminal Screen */
.terminal-screen {
  padding: 20px 22px;
  min-height: 240px;
  max-height: 340px;
  overflow-y: auto;
  font-family: var(--font-code);
  font-size: 13.5px;
  line-height: 1.6;
  background: rgba(1, 8, 4, 0.85);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-screen::-webkit-scrollbar {
  width: 6px;
}

.terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 102, 0.3);
  border-radius: 3px;
}

.log-line {
  color: #a3e6be;
  word-break: break-word;
}

.log-line.text-bright {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 8px var(--matrix-primary);
}

.log-line.text-dim {
  color: rgba(0, 255, 102, 0.5);
  font-size: 12px;
}

/* Terminal Input Row */
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(2, 12, 6, 0.95);
  border-top: 1px solid rgba(0, 255, 102, 0.25);
  border-bottom: 1px solid rgba(0, 255, 102, 0.2);
}

.prompt-symbol {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--matrix-primary);
  flex-shrink: 0;
  text-shadow: 0 0 8px var(--matrix-glow);
}

#terminalInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-code);
  font-size: 14px;
  color: #fff;
}

#terminalInput::placeholder {
  color: rgba(0, 255, 102, 0.35);
  font-size: 12.5px;
}

.terminal-enter-btn {
  background: rgba(0, 255, 102, 0.12);
  border: 1px solid var(--border-neon);
  color: var(--matrix-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-enter-btn:hover {
  background: var(--matrix-primary);
  color: var(--bg-deep);
  box-shadow: 0 0 12px var(--matrix-glow);
}

/* Matrix Interactive Deck */
.matrix-deck {
  padding: 18px 22px;
  background: rgba(1, 8, 4, 0.95);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deck-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.deck-label {
  font-family: var(--font-heading);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 1px;
  width: 130px;
  flex-shrink: 0;
}

.deck-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-btn {
  background: rgba(0, 20, 10, 0.8);
  border: 1px solid rgba(0, 255, 102, 0.25);
  color: #a3e6be;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deck-btn:hover {
  border-color: var(--matrix-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 10px var(--matrix-glow);
}

.deck-btn.active {
  background: var(--matrix-primary);
  color: var(--bg-deep);
  border-color: var(--matrix-primary);
  font-weight: 700;
  box-shadow: 0 0 12px var(--matrix-glow);
}

/* Footer */
.matrix-footer {
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 255, 102, 0.15);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(0, 255, 102, 0.55);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-sep {
  opacity: 0.4;
}

@media (max-width: 650px) {
  .deck-label {
    width: 100%;
    margin-bottom: -4px;
  }
  .prompt-symbol {
    display: none;
  }
}
