/* Alien Geometry & UI Styles */
/* Extends the existing styles.css with alien-specific effects */

:root {
  /* Alien-specific CSS variables */
  --alien-glow: rgba(0, 255, 0, 0.3);
  --alien-pulse-duration: 4s;
  --alien-scan-speed: 5s;
  --geometry-opacity: 0.3;
  --message-duration: 4s;
  --cursor-size: 24px;
}

/* ===== ALIEN GEOMETRY OVERLAYS ===== */

#alien-geometry-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0.5;
  pointer-events: none;
  opacity: 1;
}

.hex-grid {
  opacity: 0.08;
  stroke: var(--secondary-color);
  fill: none;
}

.flower-of-life {
  stroke: var(--secondary-color);
  stroke-width: 1;
  fill: none;
  filter: drop-shadow(0 0 3px var(--secondary-color));
  animation: flowerPulse 6s ease-in-out infinite;
}

.metatrons-cube {
  stroke: var(--secondary-color);
  stroke-width: 0.5;
  fill: none;
  opacity: 0.3;
  filter: drop-shadow(0 0 3px var(--secondary-color));
  animation: cubeRotate 60s linear infinite, geometryBreath 4s ease-in-out infinite;
  transform-origin: center center;
}

.crop-circle {
  stroke: var(--secondary-color);
  stroke-width: 1;
  fill: none;
  opacity: 0;
  filter: drop-shadow(0 0 5px var(--secondary-color));
  animation: cropCircleAppear 14s ease-in-out forwards;
}

/* ===== GEOMETRY ANIMATIONS ===== */

@keyframes flowerPulse {
  0%, 100% {
    stroke-width: 1;
    filter: drop-shadow(0 0 3px var(--secondary-color));
    transform: scale(1);
  }
  50% {
    stroke-width: 1.5;
    filter: drop-shadow(0 0 8px var(--secondary-color));
    transform: scale(1.05);
  }
}

@keyframes cubeRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes geometryBreath {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes cropCircleAppear {
  0%, 10% {
    opacity: 0;
    transform: scale(0.8);
  }
  20%, 80% {
    opacity: 0.5;
    transform: scale(1);
  }
  90%, 100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

/* ===== ALIEN CONTROL PANEL HEADER ===== */

.alien-control-panel {
  border-bottom: 1px solid rgba(0, 255, 0, 0.3);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.status-indicator {
  display: inline-block;
  font-size: 1rem;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-indicator:nth-child(1) {
  animation-delay: 0s;
}

.status-indicator:nth-child(2) {
  animation-delay: 0.3s;
}

.status-indicator:nth-child(3) {
  animation-delay: 0.6s;
}

.status-indicator.active {
  text-shadow: 0 0 10px var(--secondary-color);
}

.connection-status {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.alien-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.alien-glyphs {
  font-size: 1.2rem;
  opacity: 0.8;
  animation: glyphShimmer 3s ease-in-out infinite;
}

.logo-text {
  font-size: 1.5rem;
}

.scanning-line {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
  animation: scanHorizontal var(--alien-scan-speed) linear infinite;
  box-shadow: 0 0 10px var(--secondary-color);
}

/* ===== HEADER ANIMATIONS ===== */

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.95);
  }
}

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

@keyframes scanHorizontal {
  from {
    left: -100%;
  }
  to {
    left: 100%;
  }
}

/* ===== CUSTOM ALIEN CURSOR ===== */

.alien-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  font-size: var(--cursor-size);
  color: var(--secondary-color);
  text-shadow: 0 0 10px var(--secondary-color);
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease-out;
  user-select: none;
}

.cursor-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: var(--cursor-size);
  color: var(--secondary-color);
  text-shadow: 0 0 8px var(--secondary-color);
  animation: trailFade 0.5s ease-out forwards;
  user-select: none;
}

.cursor-scan {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  border: 2px solid var(--secondary-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--secondary-color);
  animation: scanExpand 0.5s ease-out forwards;
}

@keyframes trailFade {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

@keyframes scanExpand {
  from {
    width: 0;
    height: 0;
    opacity: 1;
  }
  to {
    width: 100px;
    height: 100px;
    opacity: 0;
  }
}

/* ===== GLITCH EFFECTS ===== */

.glitch-active {
  animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes glitch {
  0%, 100% {
    transform: translate(0);
    filter: none;
  }
  10% {
    transform: translate(-2px, 2px);
  }
  20% {
    transform: translate(2px, -2px);
    filter: hue-rotate(90deg);
  }
  30% {
    transform: translate(-2px, -2px);
  }
  40% {
    transform: translate(2px, 2px);
    filter: hue-rotate(-90deg);
  }
  50% {
    transform: translate(-3px, 1px);
  }
  60% {
    transform: translate(3px, -1px);
  }
  70% {
    transform: translate(-1px, -2px);
  }
  80% {
    transform: translate(1px, 2px);
  }
  90% {
    transform: translate(-2px, 0px);
  }
}

/* ===== SCANNING ANIMATIONS ===== */

.radial-scan {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border: 2px solid rgba(0, 255, 0, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: radialExpand 2s ease-out forwards;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 0 10px var(--secondary-color);
}

@keyframes radialExpand {
  from {
    width: 0;
    height: 0;
    opacity: 1;
  }
  to {
    width: 200vmax;
    height: 200vmax;
    opacity: 0;
  }
}

.portal-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to bottom, transparent, var(--secondary-color), transparent);
  box-shadow: 0 0 10px var(--secondary-color);
  animation: verticalScan 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes verticalScan {
  0%, 100% {
    top: -2px;
  }
  50% {
    top: 100%;
  }
}

/* ===== ALIEN MESSAGES ===== */

.alien-message {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid var(--secondary-color);
  padding: 1rem 2rem;
  border-radius: 4px;
  box-shadow: 0 0 20px var(--alien-glow), inset 0 0 10px rgba(0, 255, 0, 0.1);
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.5s ease-out;
  z-index: 1000;
  letter-spacing: 0.05em;
  text-align: center;
  max-width: 90%;
  backdrop-filter: blur(5px);
}

.alien-message.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== ANIMATED GLYPHS ===== */

.orbiting-glyph {
  position: absolute;
  font-size: 20px;
  color: var(--secondary-color);
  text-shadow: 0 0 10px var(--secondary-color);
  pointer-events: none;
  animation: orbit 20s linear infinite, glyphMorph 3s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(150px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(150px) rotate(-360deg);
  }
}

@keyframes glyphMorph {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 600px) {
  .alien-control-panel {
    padding: 0.75rem;
  }

  .control-status {
    font-size: 0.7rem;
    gap: 0.5rem;
  }

  .connection-status {
    font-size: 0.65rem;
  }

  .alien-logo {
    gap: 0.3rem;
  }

  .alien-glyphs {
    font-size: 1rem;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .alien-message {
    font-size: 0.8rem;
    padding: 0.75rem 1.5rem;
    bottom: 1rem;
  }

  .orbiting-glyph {
    font-size: 16px;
  }
}

/* ===== ACCESSIBILITY: REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  .flower-of-life,
  .metatrons-cube,
  .crop-circle,
  .status-indicator,
  .alien-glyphs,
  .scanning-line,
  .portal-scan-line,
  .orbiting-glyph {
    animation: none !important;
  }

  .glitch-active {
    animation: none !important;
  }

  .radial-scan {
    display: none !important;
  }

  .cursor-trail {
    display: none !important;
  }

  .metatrons-cube {
    opacity: 0.2;
  }
}

/* ===== TOUCH DEVICE ADJUSTMENTS ===== */

@media (hover: none) and (pointer: coarse) {
  /* Hide custom cursor on touch devices */
  .alien-cursor,
  .cursor-trail,
  .cursor-scan {
    display: none !important;
  }

  body {
    cursor: auto !important;
  }
}

/* ===== INTERACTIVE FEATURES ===== */

/* Mouse Proximity Effects on Portal Images */
.portal-img {
  --proximity: 0;
  transition: all 0.3s ease-out;
}

.portal-img.proximity-active {
  transform: scale(calc(1 + var(--proximity) * 0.05));
  box-shadow: 0 0 calc(20px + var(--proximity) * 40px) rgba(0, 255, 0, calc(0.3 + var(--proximity) * 0.4));
  filter: brightness(calc(1 + var(--proximity) * 0.3));
}

/* Breathing Effect */
.portal-img.breathing {
  animation: portalBreath 4s ease-in-out infinite;
}

@keyframes portalBreath {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

/* Click Burst Rings */
.click-burst-ring {
  position: fixed;
  width: 0;
  height: 0;
  border: 2px solid var(--secondary-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1500;
  transform: translate(-50%, -50%);
  animation: burstExpand 1s ease-out forwards;
}

@keyframes burstExpand {
  from {
    width: 0;
    height: 0;
    opacity: 1;
  }
  to {
    width: 400px;
    height: 400px;
    opacity: 0;
  }
}

/* Particle Burst Effect */
.particle-burst {
  position: fixed;
  font-size: 24px;
  color: var(--secondary-color);
  text-shadow: 0 0 10px var(--secondary-color);
  pointer-events: none;
  z-index: 2000;
  animation: particleFly 2s ease-out forwards;
  --vx: 0;
  --vy: 0;
}

@keyframes particleFly {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--vx)), calc(-50% + var(--vy))) rotate(360deg);
    opacity: 0;
  }
}

/* Power-Up Progress Bar */
#powerup-progress {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  text-align: center;
}

.powerup-bar {
  width: 300px;
  height: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--secondary-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 20px var(--alien-glow);
}

.powerup-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), #0ff);
  transition: width 3s linear;
  box-shadow: 0 0 20px var(--secondary-color);
}

.powerup-text {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px var(--secondary-color);
  animation: pulse 1s ease-in-out infinite;
}

/* Portal Power Indicator */
.portal-power-indicator {
  position: fixed;
  top: 6rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--secondary-color);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 20px var(--alien-glow);
  z-index: 1500;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.5s ease-out;
}

.portal-power-indicator.visible {
  opacity: 1;
  transform: translateX(0);
}

.power-level {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--secondary-color);
  text-shadow: 0 0 10px var(--secondary-color);
}

.power-bar {
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  color: var(--secondary-color);
}

/* MAXIMUM ALIEN MODE Styles */
body.maximum-alien-mode {
  animation: maximumModePulse 2s ease-in-out infinite;
}

@keyframes maximumModePulse {
  0%, 100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(30deg);
  }
}

body.maximum-alien-mode .metatrons-cube {
  animation: cubeRotate 10s linear infinite, geometryBreath 1s ease-in-out infinite !important;
}

body.maximum-alien-mode .flower-of-life {
  animation: flowerPulse 2s ease-in-out infinite !important;
}

body.maximum-alien-mode .scanning-line {
  animation: scanHorizontal 0.5s linear infinite !important;
}

body.maximum-alien-mode .portal-scan-line {
  animation: verticalScan 0.5s ease-in-out infinite !important;
}

/* Power-Up Active State */
body.powerup-active {
  animation: powerupGlow 0.5s ease-in-out;
}

@keyframes powerupGlow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3) drop-shadow(0 0 20px var(--secondary-color));
  }
}

body.powerup-active .portal-img {
  animation: portalBreath 1s ease-in-out infinite, portalPulse 2s ease-in-out infinite;
}

@keyframes portalPulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 60px rgba(0, 255, 0, 0.9);
  }
}

/* Secret Message Styles */
.alien-message.secret-message {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(0, 50, 0, 0.95));
  border: 2px solid var(--secondary-color);
  font-size: 1rem;
  animation: secretPulse 0.5s ease-out;
}

@keyframes secretPulse {
  0% {
    transform: translateX(-50%) translateY(0) scale(0.5);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) translateY(0) scale(1.1);
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
}

.alien-message.maximum-mode {
  background: linear-gradient(135deg, rgba(100, 0, 0, 0.95), rgba(0, 100, 0, 0.95));
  border: 3px solid var(--secondary-color);
  font-size: 1.1rem;
  box-shadow: 0 0 40px rgba(0, 255, 0, 0.8), inset 0 0 20px rgba(0, 255, 0, 0.3);
}

.alien-message.powerup-message {
  background: linear-gradient(135deg, rgba(0, 0, 100, 0.95), rgba(0, 100, 100, 0.95));
  border: 2px solid #0ff;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
  color: #0ff;
}

/* Glyph Click Animation */
@keyframes glyphPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 5px var(--secondary-color);
  }
  50% {
    transform: scale(1.5);
    text-shadow: 0 0 20px var(--secondary-color), 0 0 30px var(--secondary-color);
  }
}

/* Reactive Geometry Smooth Transition */
.flower-of-life {
  transition: transform 0.3s ease-out;
}

/* Mobile Adjustments for Interactive Features */
@media (max-width: 600px) {
  .portal-power-indicator {
    top: 4rem;
    right: 1rem;
    left: 1rem;
    padding: 0.75rem;
  }

  #powerup-progress {
    bottom: 4rem;
  }

  .powerup-bar {
    width: 200px;
  }

  .powerup-text {
    font-size: 0.75rem;
  }
}

/* Disable Interactive Features for Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .portal-img.proximity-active,
  .portal-img.breathing,
  .click-burst-ring,
  .particle-burst,
  .powerup-active,
  body.maximum-alien-mode {
    animation: none !important;
    transform: none !important;
  }

  .flower-of-life {
    transition: none !important;
  }
}
