/**
 * Black Raven - Matrix Mode Visual Effects
 * Progressive unlock styling
 */

/* Base Matrix Rain - Hidden by default */
.matrix-rain {
  opacity: 0 !important;
  transition: opacity 0.5s ease-in-out;
}

.matrix-rain.active {
  opacity: 0.3 !important;
}

/* ========================================
   LAYER 1: NERD MODE
   ======================================== */
.nerd-mode {
  /* Subtle green tint */
}

.nerd-mode::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 20, 0, 0.1) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   LAYER 2: INITIATE MODE
   ======================================== */
.initiate-mode .matrix-rain {
  opacity: 0.3 !important;
}

.initiate-mode .hero-content {
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

/* Scanline effect */
.initiate-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 255, 65, 0.03) 2px,
    rgba(0, 255, 65, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9998;
  animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* ========================================
   LAYER 3: ARCHITECT MODE
   ======================================== */
.architect-mode .matrix-rain {
  opacity: 0.6 !important;
}

/* Glitch effect for text */
.matrix-glitch {
  position: relative;
  animation: glitch 2s infinite;
}

.matrix-glitch::before,
.matrix-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.matrix-glitch::before {
  animation: glitchTop 1s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.matrix-glitch::after {
  animation: glitchBottom 1.5s infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  -webkit-clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitch {
  2%, 64% { transform: translate(2px, 0) skew(0deg); }
  4%, 60% { transform: translate(-2px, 0) skew(0deg); }
  62% { transform: translate(0, 0) skew(5deg); }
}

@keyframes glitchTop {
  2%, 64% { transform: translate(2px, -2px); }
  4%, 60% { transform: translate(-2px, 2px); }
  62% { transform: translate(13px, -1px) skew(-13deg); }
}

@keyframes glitchBottom {
  2%, 64% { transform: translate(-2px, 0); }
  4%, 60% { transform: translate(-2px, 0); }
  62% { transform: translate(-22px, 5px) skew(21deg); }
}

/* Architect grid overlay */
.architect-mode .hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  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: 50px 50px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

/* ========================================
   LAYER 4: ORACLE MODE
   ======================================== */
.oracle-mode .matrix-rain {
  opacity: 0.8 !important;
}

.oracle-mode {
  filter: hue-rotate(0deg);
  animation: oracleHue 10s infinite;
}

@keyframes oracleHue {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(20deg); }
}

/* Oracle vision - reveals hidden elements */
.oracle-hidden {
  display: none;
}

.oracle-mode .oracle-hidden {
  display: block !important;
  animation: fadeIn 1s ease-out;
}

/* Terminal cursor blink */
.oracle-mode input:focus::after,
.oracle-mode textarea:focus::after {
  content: '_';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Floating data particles */
.oracle-mode::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Ccircle cx='2' cy='2' r='1' fill='%2300ff41' fill-opacity='0.3'/%3E%3C/svg%3E");
  animation: dataFlow 30s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes dataFlow {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100vh); }
}

/* ========================================
   LAYER 5: MORPHEUS MODE
   ======================================== */
.morpheus-mode .matrix-rain {
  opacity: 1 !important;
}

.morpheus-mode .matrix-rain.morpheus-rain {
  animation: morpheusRain 0.5s linear infinite;
}

@keyframes morpheusRain {
  0% { filter: brightness(1) contrast(1); }
  50% { filter: brightness(1.2) contrast(1.1); }
  100% { filter: brightness(1) contrast(1); }
}

/* Full terminal mode */
.morpheus-mode {
  background: #000 !important;
}

.morpheus-mode * {
  font-family: 'Courier New', monospace !important;
}

.morpheus-mode .btn {
  border: 1px solid #00ff41 !important;
  background: transparent !important;
  color: #00ff41 !important;
}

.morpheus-mode .btn:hover {
  background: #00ff41 !important;
  color: #000 !important;
}

/* Inner circle badge */
.morpheus-mode .header::after {
  content: 'INNER CIRCLE';
  position: absolute;
  right: 100px;
  top: 50%;
  transform: translateY(-50%);
  color: #00ff41;
  font-size: 10px;
  font-family: monospace;
  border: 1px solid #00ff41;
  padding: 2px 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px #00ff41; }
  50% { opacity: 0.7; box-shadow: 0 0 20px #00ff41; }
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
@keyframes notifSlide {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.matrix-notification {
  animation: notifSlide 0.3s ease-out;
}

.matrix-notification .notif-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.matrix-notification .notif-message {
  font-size: 12px;
  opacity: 0.8;
}

/* ========================================
   REWARD DISPLAY
   ======================================== */
.morpheus-reward {
  animation: rewardAppear 1s ease-out;
}

@keyframes rewardAppear {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.morpheus-reward .ascii-art {
  font-size: 8px;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #00ff41;
  white-space: pre;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .morpheus-mode .header::after {
    display: none;
  }

  .morpheus-reward .ascii-art {
    font-size: 6px;
  }
}
