:root {
  --text-light: #e0e0e0;
  --text-muted: #a1a1aa;
  --text-secondary: #d1d5db;
  --primary-orange: #ffa500;
  --orange-hover: #ffcc33;
  --orange-tint-10: rgba(255, 165, 0, 0.1);
  --black-80: rgba(0, 0, 0, 0.8);
  --black-50: rgba(0, 0, 0, 0.5);
  --background-dark: #1a1a1a;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #000;
  color: var(--text-light);
  overflow-x: hidden;
}

/* Sci-Fi Memory System Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes matrixGlow {
  0%, 100% { box-shadow: 0 0 5px #00ff41; }
  50% { box-shadow: 0 0 25px #00ff41, 0 0 35px #00ff41; }
}

@keyframes scanLines {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes dataStream {
  0% { opacity: 0; transform: translateX(-20px) scale(0.8); }
  50% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0.8; transform: translateX(0) scale(1); }
}

@keyframes hologramFlicker {
  0%, 100% { opacity: 0.9; filter: hue-rotate(0deg); }
  25% { opacity: 1; filter: hue-rotate(5deg); }
  50% { opacity: 0.95; filter: hue-rotate(-3deg); }
  75% { opacity: 1; filter: hue-rotate(2deg); }
}

@keyframes neuralPulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3), 
                inset 0 0 20px rgba(0, 255, 65, 0.1);
  }
  50% { 
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.6), 
                inset 0 0 30px rgba(0, 255, 65, 0.2);
  }
}

/* Terminal cursor effect */
.terminal-cursor::after {
  content: '▋';
  animation: terminalBlink 1s infinite;
  color: #00ff41;
}

/* Sci-Fi Terminal Effects */
.memory-terminal {
  position: relative;
  animation: hologramFlicker 3s infinite, neuralPulse 4s infinite;
}

.memory-terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.03) 2px,
    rgba(0, 255, 65, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.memory-terminal::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #00ff41, transparent);
  animation: scanLines 2s linear infinite;
  pointer-events: none;
  z-index: 2;
}

.memory-message {
  animation: dataStream 0.5s ease-out;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.8);
  letter-spacing: 0.5px;
}

/* Overlay Styles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 26, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none; /* Prevent capturing events */
}

.overlay.hidden {
  opacity: 0;
  display: none;
}

.overlay-message {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-orange);
  text-shadow: 0 0 4px var(--black-80);
  animation: pulse 1.5s infinite;
  text-align: center; /* Ensure text is centered */
  max-width: 90%; /* Prevent overflow on small screens */
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.grok-badge {
  position: absolute;
  right: 4px;
  bottom: 2px;
  z-index: 999;
}

.location-button {
  position: fixed;
  bottom: 145px; /* Moved higher to clear timeline */
  right: 16px;
  background: rgba(26, 26, 26, 0.9); /* Matches timeline and filter drawer */
  border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
  border-radius: 8px; /* Rounded square */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); /* Consistent shadow */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 30;
}

.location-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  border-color: var(--primary-orange); /* Orange border on hover */
}

.location-button svg {
  color: var(--primary-orange); /* Orange icon to match app theme */
}

@media (max-width: 640px) {
  .overlay-message {
    font-size: 1.5rem;
    max-width: 80%; /* Tighter max-width for mobile */
    line-height: 1.2; /* Improve readability */
  }
  .location-button {
    bottom: 160px; /* Higher on mobile to avoid timeline overlap */
    right : 10px;
    width: 44px;
    height: 44px;
  }
}

.blog-post-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.blog-post-backdrop.open {
  opacity: 1;
  visibility: visible;
}