/*
 * Lumon Corporate Terminal - Visual Effects
 * CRT screen effects, scanlines, flicker, and glow
 * Version: 1.0.0
 */

/* Base body styling with terminal effects */
body {
  background-color: var(--lumon-bg-primary);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* CRT Scanlines Effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.2) 50%
  );
  background-size: 100% 4px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.3;
  animation: lumon-scanlines 0.1s linear infinite;
}

/* Screen Vignette/Glow Effect */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
  z-index: 999;
  pointer-events: none;
  animation: lumon-flicker 0.3s infinite;
}

/* Scanlines Animation */
@keyframes lumon-scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

/* CRT Flicker Animation */
@keyframes lumon-flicker {
  0% { opacity: 0.9; }
  5% { opacity: 0.8; }
  10% { opacity: 0.9; }
  15% { opacity: 0.85; }
  20% { opacity: 0.9; }
  100% { opacity: 1; }
}

/* Terminal Screen Container */
.lumon-terminal {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

.terminal-screen {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.terminal-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* Blinking Cursor Effect */
.blink {
  animation: lumon-blink 1s infinite;
  display: inline-block;
  color: var(--lumon-text-primary);
  text-shadow: 0 0 15px var(--lumon-glow-intense);
}

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

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  margin: 0 auto;
  animation: lumon-typing 3.5s steps(40, end);
  max-width: min(90vw, 800px);
  width: fit-content;
  font-size: clamp(1.2rem, 4vw, 2.5rem);
  line-height: 1.2;
  word-break: break-word;
}

@keyframes lumon-typing {
  from {
    width: 0;
    max-width: 0;
  }
  to {
    width: 100%;
    max-width: min(90vw, 800px);
  }
}

/* Glow Effects for Interactive Elements */
.lumon-glow {
  text-shadow: 0 0 10px var(--lumon-glow-primary);
  transition: text-shadow 0.3s ease;
}

.lumon-glow:hover {
  text-shadow: 0 0 20px var(--lumon-glow-intense);
}

/* Button Glow Effects */
button, .button {
  background: var(--lumon-text-primary);
  color: var(--lumon-bg-primary);
  border: 1px solid var(--lumon-border-color);
  padding: 0.8rem 1.5rem;
  font-family: var(--lumon-font-family);
  font-size: 1.2rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  outline: none;
}

button:hover, .button:hover {
  opacity: 0.8;
  box-shadow: 0 0 15px var(--lumon-glow-intense);
  text-shadow: 0 0 5px var(--lumon-bg-primary);
}

button:focus, .button:focus {
  box-shadow: 0 0 20px var(--lumon-glow-intense);
}

/* Input Field Effects */
input, textarea {
  background: transparent;
  border: 1px solid var(--lumon-border-color);
  color: var(--lumon-text-primary);
  padding: 0.8rem;
  font-family: var(--lumon-font-family);
  font-size: 1.2rem;
  outline: none;
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  border-color: var(--lumon-text-primary);
  box-shadow: 0 0 10px var(--lumon-glow-primary);
  text-shadow: 0 0 5px var(--lumon-glow-secondary);
}

input::placeholder, textarea::placeholder {
  color: var(--lumon-text-secondary);
  opacity: 0.7;
}

/* Card/Section Glow Effects */
.lumon-card, .section {
  background-color: var(--lumon-bg-secondary);
  border: 1px solid var(--lumon-border-color);
  padding: 2rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(143, 226, 255, 0.1);
  transition: all 0.3s ease;
}

.lumon-card:hover, .section:hover {
  border-color: var(--lumon-text-primary);
  box-shadow: 0 0 30px rgba(143, 226, 255, 0.2);
}

/* Loading/Processing Animation */
.lumon-loading {
  position: relative;
  overflow: hidden;
}

.lumon-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(143, 226, 255, 0.3),
    transparent
  );
  animation: lumon-scan 2s infinite;
}

@keyframes lumon-scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Responsive Effects */
@media (max-width: 767px) {
  .terminal-screen {
    padding: 1rem;
  }
  
  .typewriter {
    font-size: clamp(0.9rem, 3.5vw, 1.4rem);
    max-width: 95vw;
  }
}

@media (max-width: 480px) {
  .typewriter {
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    max-width: 98vw;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .blink,
  .typewriter,
  .lumon-loading::after {
    animation: none !important;
  }
  
  .typewriter {
    width: 100%;
    max-width: min(90vw, 800px);
    white-space: normal;
    word-break: break-word;
  }
  
  .blink {
    opacity: 1;
  }
  
  button, .button,
  input, textarea,
  .lumon-card, .section {
    transition: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  body::before,
  body::after {
    display: none;
  }
  
  .terminal-screen::before {
    display: none;
  }
  
  button, .button {
    border: 2px solid var(--lumon-text-primary);
  }
  
  input, textarea {
    border: 2px solid var(--lumon-text-primary);
  }
}