/* ==========================================
   MADHAV CYBEROPS TERMINAL - CORE STYLES
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;600;700&display=swap');

:root {
  --green: #00FF41;
  --blue: #00D9FF;
  --red: #FF0033;
  --black: #050505;
  --gray-dark: #0d0d0d;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Fira Code', monospace;
  background-color: var(--black);
  color: var(--green);
}

/* ==========================================
   CRT / SCANLINE OVERLAY
   ========================================== */
.crt-overlay {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.10) 0px,
    rgba(0, 0, 0, 0.10) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}

.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

/* ==========================================
   GLOW EFFECTS
   ========================================== */
.glow-green {
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.4), 0 0 20px rgba(0, 255, 65, 0.15), inset 0 0 10px rgba(0, 255, 65, 0.05);
}

.glow-blue {
  box-shadow: 0 0 8px rgba(0, 217, 255, 0.4), 0 0 20px rgba(0, 217, 255, 0.15);
}

.glow-red {
  box-shadow: 0 0 8px rgba(255, 0, 51, 0.5), 0 0 20px rgba(255, 0, 51, 0.2);
}

.text-glow-green {
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.8), 0 0 20px rgba(0, 255, 65, 0.4);
}

.text-glow-blue {
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.8), 0 0 20px rgba(0, 217, 255, 0.4);
}

/* ==========================================
   ANTI-GRAVITY FLOATING ANIMATIONS
   ========================================== */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-18px) rotate(1.5deg); }
  75% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes float-delayed {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-14px) rotate(-2deg); }
  66% { transform: translateY(-5px) rotate(1.5deg); }
}

@keyframes float-fast {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

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

.floating { animation: float 6s ease-in-out infinite; }
.floating-delayed { animation: float-delayed 8s ease-in-out infinite; }
.floating-fast { animation: float-fast 4s ease-in-out infinite; }

/* ==========================================
   BACKGROUND PARTICLE GRID
   ========================================== */
.matrix-char {
  position: absolute;
  font-size: 12px;
  color: rgba(0, 255, 65, 0.08);
  animation: rain linear infinite;
  user-select: none;
}

@keyframes rain {
  0% { transform: translateY(-100px); opacity: 1; }
  80% { opacity: 0.4; }
  100% { transform: translateY(110vh); opacity: 0; }
}

/* Background floating shapes */
.bg-shape {
  position: absolute;
  border: 1px solid rgba(0, 255, 65, 0.06);
  border-radius: 4px;
  animation: float-delayed ease-in-out infinite;
  pointer-events: none;
}

/* ==========================================
   GLITCH EFFECT
   ========================================== */
@keyframes glitch {
  0%, 90%, 100% { clip-path: none; transform: none; }
  91% { clip-path: polygon(0 10%, 100% 10%, 100% 25%, 0 25%); transform: translate(-3px, 0); color: var(--blue); }
  92% { clip-path: polygon(0 50%, 100% 50%, 100% 65%, 0 65%); transform: translate(3px, 0); color: var(--red); }
  93% { clip-path: polygon(0 70%, 100% 70%, 100% 85%, 0 85%); transform: translate(-2px, 0); }
  94% { clip-path: none; transform: none; }
}

.glitch-text {
  animation: glitch 5s steps(1) infinite;
  display: inline-block;
}

/* ==========================================
   TERMINAL CURSOR BLINK
   ========================================== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--green);
  margin-left: 2px;
}

/* ==========================================
   TYPING ANIMATION SUPPORT
   ========================================== */
.typewriter {
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================
   SCROLLBAR
   ========================================== */
.scrollbar-custom::-webkit-scrollbar {
  width: 4px;
}

.scrollbar-custom::-webkit-scrollbar-track {
  background: #0d0d0d;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 65, 0.3);
  border-radius: 2px;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 65, 0.6);
}

/* ==========================================
   TERMINAL LINE ANIMATION
   ========================================== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-slide-up { animation: slideUp 0.3s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* ==========================================
   COMMAND LINE HISTORY
   ========================================== */
.cmd-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
  animation: fadeIn 0.2s ease-out;
}

.cmd-prompt {
  color: var(--green);
  font-weight: bold;
  flex-shrink: 0;
  white-space: nowrap;
}

.cmd-text {
  color: white;
}

.cmd-error {
  color: var(--red);
  font-size: 0.85em;
}

/* ==========================================
   SCENARIO OUTPUT STYLES
   ========================================== */
.scenario-line {
  animation: fadeIn 0.1s ease-out forwards;
  opacity: 0;
}

.scenario-ok { color: var(--green); }
.scenario-warn { color: #FFB800; }
.scenario-alert { color: var(--red); }
.scenario-info { color: var(--blue); }
.scenario-dim { color: #555; }

/* ==========================================
   HEX SHAPE
   ========================================== */
.hex-shape {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* ==========================================
   ASCII ART
   ========================================== */
.ascii-art {
  color: var(--green);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
  line-height: 1.2;
}

/* ==========================================
   PROGRESS BAR PULSE
   ========================================== */
@keyframes pulse-bar {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 255, 65, 0.5); }
  50% { box-shadow: 0 0 16px rgba(0, 255, 65, 0.9), 0 0 30px rgba(0, 255, 65, 0.3); }
}

#progress-bar {
  animation: pulse-bar 1.5s ease-in-out infinite;
}

.progress-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from { background-position: 1rem 0; }
  to { background-position: 0 0; }
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================
   STATUS BADGE
   ========================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-weight: 600;
}

.badge-online {
  color: var(--green);
  border-color: rgba(0, 255, 65, 0.4);
  background: rgba(0, 255, 65, 0.08);
}

.badge-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 1.5s ease-in-out infinite;
}

/* ==========================================
   HERO SECTION ANTI-GRAVITY CARDS
   ========================================== */
.hero-float-card {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.7rem;
  color: rgba(0, 255, 65, 0.7);
  white-space: nowrap;
  animation: float ease-in-out infinite;
  pointer-events: none;
  transition: all 0.5s ease;
}

body.antigravity-active #terminal-interface {
  transform: scale(0.98) translateY(-10px);
  filter: hue-rotate(45deg);
  box-shadow: 0 20px 50px rgba(0, 217, 255, 0.2);
}

body.antigravity-active .crt-overlay {
  opacity: 0.5;
}

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */
@media (max-width: 768px) {
  .ascii-art {
    font-size: 0.5rem;
  }

  #hero-graphics {
    display: none !important;
  }
}

/* ==========================================
   SELECTION
   ========================================== */
::selection {
  background: rgba(0, 255, 65, 0.2);
  color: white;
}

/* ==========================================
   INPUT FOCUS OUTLINE REMOVE
   ========================================== */
input:focus {
  outline: none;
  box-shadow: none;
}
