/* 
 * Hacker Terminal Portal - Theme CSS
 */

:root {
  --bg: #0a0e0a;
  --bg-alt: #0f1510;
  --fg: #c8f7c5;
  --accent: #00ff9c;
  --accent-dim: #1f6b4a;
  --warn: #ffb000;
  --danger: #ff5555;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

html, body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Container */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 2; /* Above matrix */
}

/* Header & Intro */
header {
  margin-bottom: 2.5rem;
}

.boot-sequence {
  color: var(--accent-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.prompt-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.prompt-host {
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: bold;
}

.typewriter {
  color: var(--fg);
  white-space: pre-wrap;
}

.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background-color: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Categories & Links */
.category {
  margin-bottom: 2.5rem;
  opacity: 0; /* For fade-in animation */
  transform: translateY(10px);
  animation: fadeInUp 0.5s forwards;
}

.category:nth-child(1) { animation-delay: 0.2s; }
.category:nth-child(2) { animation-delay: 0.4s; }
.category:nth-child(3) { animation-delay: 0.6s; }
.category:nth-child(4) { animation-delay: 0.8s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-title {
  color: var(--accent-dim);
  font-size: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--accent-dim);
  padding-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.link-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Link Cards */
.link-card {
  display: block;
  text-decoration: none;
  background-color: var(--bg-alt);
  border: 1px solid var(--accent-dim);
  padding: 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.link-card:hover, .link-card:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 156, 0.1);
  outline: none;
}

.link-card::before {
  content: "> ";
  color: var(--accent-dim);
  font-weight: bold;
  position: absolute;
  left: 1rem;
  transition: color 0.2s ease;
}

.link-card:hover::before, .link-card:focus::before {
  color: var(--accent);
}

.link-content {
  padding-left: 1.5rem;
}

.link-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-title {
  color: var(--accent);
  font-weight: bold;
  font-size: 1.1rem;
}

.link-command {
  font-size: 0.8rem;
  color: var(--accent-dim);
}

.link-desc {
  color: var(--fg);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  opacity: 0.9;
}

/* Interactive Command Palette */
.command-palette {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  border: 1px solid var(--accent-dim);
  padding: 0.5rem 1rem;
  background-color: var(--bg-alt);
  border-radius: 4px;
  transition: border-color 0.2s;
}

.command-palette:focus-within {
  border-color: var(--accent);
}

.command-prefix {
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: bold;
}

.command-input {
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 1rem;
  flex-grow: 1;
  outline: none;
}

.command-input::placeholder {
  color: var(--accent-dim);
}

.cmd-output {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--warn);
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--accent-dim);
  text-align: center;
  color: var(--accent-dim);
  font-size: 0.85rem;
}

/* Effects */

/* Scanlines */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.2)
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.4;
}

/* Matrix Canvas */
#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
}

/* Mobile & Reduced Motion Adjustments */
@media (max-width: 600px) {
  #matrix-bg {
    display: none !important; /* Disable on mobile for performance */
  }
  
  #app {
    padding: 1.5rem 1rem;
  }
  
  .link-header {
    flex-direction: column;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor-blink {
    animation: none;
    opacity: 1;
  }
  .scanlines, #matrix-bg {
    display: none !important;
  }
}
