/* ====== CSS RESET & BASE STYLES ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --primary-color: #00ff88;
  --secondary-color: #ff6b6b;
  --accent-color: #78c2ff;
  --warning-color: #ffbd2e;
  --success-color: #27c93f;
  --error-color: #ff5f56;
  
  /* Background Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-quaternary: #0f3460;
  
  /* Terminal Colors */
  --terminal-bg: rgba(15, 15, 35, 0.95);
  --terminal-border: rgba(120, 119, 198, 0.4);
  --terminal-header: rgba(30, 30, 60, 0.95);
  --terminal-input: rgba(20, 20, 40, 0.95);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #c5c5c5;
  --text-muted: rgba(255, 255, 255, 0.6);
  
  /* Effects */
  --glow-primary: 0 0 20px var(--primary-color);
  --glow-secondary: 0 0 20px var(--secondary-color);
  --glow-accent: 0 0 20px var(--accent-color);
  
  /* Fonts */
  --font-mono: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  --font-display: 'Orbitron', 'Arial Black', sans-serif;
}

/* ====== BODY & LAYOUT ====== */
body {
  font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-quaternary) 75%, var(--bg-primary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ====== BACKGROUND EFFECTS ====== */
.bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(2px 2px at 20% 30%, var(--primary-color), transparent),
    radial-gradient(2px 2px at 40% 70%, var(--accent-color), transparent),
    radial-gradient(1px 1px at 90% 40%, var(--secondary-color), transparent),
    radial-gradient(1px 1px at 10% 80%, var(--warning-color), transparent);
  background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px;
  background-position: 0 0, 50px 50px, 100px 100px, 150px 150px;
  animation: twinkle 20s linear infinite;
  opacity: 0.6;
}

.twinkling {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: 
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
    radial-gradient(circle, rgba(120, 119, 198, 0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 119, 198, 0.4) 1px, transparent 1px);
  background-size: 100px 100px, 150px 150px, 200px 200px;
  animation: scroll 50s linear infinite;
  opacity: 0.3;
}

.clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 25% 25%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 119, 198, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(120, 219, 255, 0.06) 0%, transparent 50%);
  animation: drift 60s ease-in-out infinite alternate;
}

/* ====== FLOATING PARTICLES ====== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.7;
  animation: float 15s linear infinite;
  box-shadow: 0 0 10px var(--primary-color);
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 18s; background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 22s; background: var(--secondary-color); box-shadow: 0 0 10px var(--secondary-color); }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; animation-duration: 19s; }
.particle:nth-child(5) { left: 60%; animation-delay: 8s; animation-duration: 21s; background: var(--warning-color); box-shadow: 0 0 10px var(--warning-color); }
.particle:nth-child(6) { left: 70%; animation-delay: 10s; animation-duration: 17s; background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); }
.particle:nth-child(7) { left: 80%; animation-delay: 12s; animation-duration: 23s; background: var(--secondary-color); box-shadow: 0 0 10px var(--secondary-color); }
.particle:nth-child(8) { left: 90%; animation-delay: 14s; animation-duration: 20s; }

/* ====== TERMINAL CONTAINER ====== */
.terminal-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  z-index: 10;
}

/* ====== TERMINAL WRAPPER ====== */
.terminal-wrapper {
  background: var(--terminal-bg);
  border-radius: 20px;
  box-shadow: 
    0 0 60px rgba(120, 119, 198, 0.4),
    inset 0 0 60px rgba(255, 255, 255, 0.05),
    0 20px 40px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border: 2px solid var(--terminal-border);
  overflow: hidden;
  position: relative;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: terminalEntrance 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(120, 119, 198, 0.05) 0%, 
    transparent 30%, 
    transparent 70%, 
    rgba(255, 119, 198, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.terminal-wrapper:hover {
  box-shadow: 
    0 0 80px rgba(120, 119, 198, 0.6),
    inset 0 0 60px rgba(255, 255, 255, 0.08),
    0 25px 50px rgba(0, 0, 0, 0.9);
  border-color: rgba(120, 119, 198, 0.6);
  transform: translateY(-2px);
}

/* ====== TERMINAL HEADER ====== */
.terminal-header {
  background: linear-gradient(135deg, var(--terminal-header) 0%, rgba(20, 20, 40, 0.98) 100%);
  padding: 15px 25px;
  position: relative;
  z-index: 2;
  border-bottom: 2px solid var(--terminal-border);
}

.terminal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.control-buttons {
  display: flex;
  gap: 12px;
  z-index: 3;
}

.control-btn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
}

.control-btn:hover {
  transform: scale(1.2);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 15px currentColor;
}

.control-btn:hover::before {
  opacity: 1;
}

.control-btn:active {
  transform: scale(0.95);
}

.close {
  background: linear-gradient(135deg, #ff5f56, #ff3b30);
}

.minimize {
  background: linear-gradient(135deg, #ffbd2e, #ff9500);
}

.maximize {
  background: linear-gradient(135deg, #27c93f, #30d158);
}

/* ====== TERMINAL TITLE ====== */
.terminal-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.title-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: var(--glow-primary);
  animation: titleGlow 3s ease-in-out infinite alternate;
}

.status-led {
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: var(--glow-primary);
}

.title-text {
  font-size: 1.1em;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7em;
  color: var(--success-color);
  opacity: 0.8;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ====== TERMINAL INFO ====== */
.terminal-info {
  display: flex;
  gap: 15px;
  font-size: 0.8em;
  color: var(--text-muted);
  z-index: 3;
}

.cpu-usage, .memory-usage {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#cpu, #ram {
  color: var(--accent-color);
  font-weight: 600;
}

/* ====== SCAN LINE EFFECT ====== */
.scan-line {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--primary-color) 20%, 
    var(--accent-color) 50%, 
    var(--secondary-color) 80%, 
    transparent 100%);
  animation: scan 3s linear infinite;
}

/* ====== TERMINAL BODY ====== */
.terminal-body {
  position: relative;
  height: 70vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 25, 0.8);
}

/* ====== TERMINAL OUTPUT ====== */
.terminal-output {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* ====== TERMINAL INPUT SECTION - FIXED ====== */
.terminal-input-section {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 35, 0.98);
  border-top: 2px solid var(--terminal-border);
  padding: 15px 25px;
  z-index: 100;
  backdrop-filter: blur(10px);
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
  min-height: 60px;
}

.input-line {
  display: flex;
  align-items: center;
  position: relative;
}

.prompt {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 8px;
  white-space: nowrap;
  user-select: none;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(20, 20, 40, 0.6);
  border: 1px solid rgba(120, 119, 198, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  background: rgba(20, 20, 40, 0.8);
}

.input-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 6px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  filter: blur(8px);
}

.terminal-input:focus + .input-glow {
  opacity: 0.2;
}

/* ====== CUSTOM SCROLLBAR ====== */
.terminal-body::-webkit-scrollbar {
  width: 10px;
}

.terminal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: 5px;
  transition: background 0.3s ease;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

/* ====== TERMINAL OUTPUT ====== */
.terminal-output {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
  line-height: 1.6;
}

/* ====== BOOT SEQUENCE ====== */
.boot-sequence {
  animation: fadeInUp 2s ease-out;
}

.boot-logo {
  text-align: center;
  margin-bottom: 30px;
}

.ascii-art {
  font-family: var(--font-mono);
  font-size: 0.65em;
  color: var(--secondary-color);
  text-shadow: var(--glow-secondary);
  animation: logoGlow 4s ease-in-out infinite alternate;
  white-space: pre;
  line-height: 1.2;
}

/* ====== SYSTEM INFO ====== */
.system-info {
  margin: 30px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.9em;
}

.info-value {
  color: var(--accent-color);
  font-weight: 600;
}

.status-online {
  color: var(--success-color) !important;
  text-shadow: 0 0 5px var(--success-color);
}

/* ====== WELCOME MESSAGE ====== */
.welcome-message {
  text-align: center;
  margin: 30px 0;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 2.2em;
  margin-bottom: 15px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
}

.welcome-subtitle {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.welcome-instruction {
  color: var(--text-muted);
}

.command-highlight {
  color: var(--secondary-color);
  background: rgba(255, 107, 107, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ====== LOADING ANIMATION ====== */
.loading-container {
  margin-top: 30px;
  text-align: center;
}

.loading-text {
  color: var(--text-muted);
  margin-bottom: 15px;
  animation: typewriter 2s steps(20) infinite;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
  border-radius: 3px;
  animation: progressLoad 3s ease-in-out;
  box-shadow: 0 0 10px var(--primary-color);
}

.loading-percentage {
  color: var(--primary-color);
  font-weight: 600;
  animation: countUp 3s ease-in-out;
}

/* ====== TERMINAL INPUT ====== */
.terminal-input-container {
  margin-top: 30px;
  padding: 20px;
  background: var(--terminal-input);
  border-radius: 12px;
  border: 2px solid var(--terminal-border);
  position: relative;
}

.terminal-input-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--accent-color) 20%, 
    var(--secondary-color) 50%, 
    var(--primary-color) 80%, 
    transparent 100%);
  animation: scan 2.5s linear infinite reverse;
}

.input-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prompt {
  font-family: var(--font-display);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  animation: promptPulse 3s ease-in-out infinite;
}

.prompt-user {
  color: var(--success-color);
}

.prompt-separator {
  color: var(--text-muted);
}

.prompt-host {
  color: var(--accent-color);
}

.prompt-path {
  color: var(--warning-color);
}

.prompt-symbol {
  color: var(--primary-color);
  text-shadow: var(--glow-primary);
}

.command-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1em;
  outline: none;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  padding: 5px 0;
}

.command-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
}

.command-input:focus {
  text-shadow: 0 0 10px var(--primary-color);
}

.input-cursor {
  width: 2px;
  height: 20px;
  background: var(--primary-color);
  animation: blink 1.2s linear infinite;
  box-shadow: 0 0 8px var(--primary-color);
}

/* ====== QUICK ACTIONS ====== */
.quick-actions {
  margin-top: 20px;
  text-align: center;
}

.action-group {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--terminal-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  min-width: 80px;
}

.action-btn:hover {
  background: rgba(120, 119, 198, 0.2);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(120, 119, 198, 0.3);
}

.action-btn:active {
  transform: translateY(-1px);
}

.action-btn .icon {
  font-size: 1.5em;
}

.action-btn span {
  font-size: 0.8em;
  font-weight: 500;
}

/* ====== NOTIFICATIONS ====== */
.notification-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  max-width: 400px;
}

.notification {
  background: linear-gradient(135deg, rgba(120, 119, 198, 0.95) 0%, rgba(255, 119, 198, 0.9) 100%);
  color: var(--text-primary);
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 10px 30px rgba(120, 119, 198, 0.4);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.notification::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

.notification.success {
  background: linear-gradient(135deg, rgba(39, 201, 63, 0.95) 0%, rgba(48, 209, 88, 0.9) 100%);
}

.notification.error {
  background: linear-gradient(135deg, rgba(255, 95, 86, 0.95) 0%, rgba(255, 59, 48, 0.9) 100%);
}

.notification.warning {
  background: linear-gradient(135deg, rgba(255, 189, 46, 0.95) 0%, rgba(255, 149, 0, 0.9) 100%);
}

/* ====== THEME TOGGLE ====== */
.theme-toggle {
  position: fixed;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--terminal-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.theme-toggle:hover {
  background: rgba(120, 119, 198, 0.3);
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.theme-icon {
  font-size: 1.5em;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(180deg);
}

/* ====== LIGHT MODE ====== */
body.light-mode {
  --bg-primary: #f0f0f0;
  --bg-secondary: #e8e8f0;
  --bg-tertiary: #e0e0e8;
  --bg-quaternary: #d8d8e0;
  --terminal-bg: rgba(255, 255, 255, 0.95);
  --terminal-border: rgba(70, 130, 180, 0.4);
  --terminal-header: rgba(240, 240, 250, 0.95);
  --terminal-input: rgba(250, 250, 255, 0.95);
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-muted: rgba(0, 0, 0, 0.6);
  --primary-color: #007700;
  --accent-color: #4682b4;
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
  .terminal-container {
    padding: 10px;
  }
  
  .terminal-wrapper {
    border-radius: 15px;
  }
  
  .terminal-header {
    padding: 12px 20px;
  }
  
  .title-text {
    font-size: 0.9em;
    letter-spacing: 1px;
  }
  
  .terminal-body {
    padding: 20px 15px;
    max-height: 60vh;
  }
  
  .welcome-title {
    font-size: 1.8em;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .action-group {
    gap: 10px;
  }
  
  .action-btn {
    padding: 12px 15px;
    min-width: 70px;
  }
  
  .quick-actions {
    margin-top: 15px;
  }
  
  .notification-container {
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .terminal-header {
    padding: 10px 15px;
  }
  
  .terminal-info {
    display: none;
  }
  
  .connection-badge {
    display: none;
  }
  
  .ascii-art {
    font-size: 0.45em;
  }
  
  .welcome-title {
    font-size: 1.5em;
  }
}

/* ====== ANIMATIONS ====== */
@keyframes terminalEntrance {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(100px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

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

@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

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

@keyframes titleGlow {
  0% { text-shadow: 0 0 20px var(--primary-color); }
  100% { text-shadow: 0 0 30px var(--primary-color), 0 0 40px var(--primary-color); }
}

@keyframes logoGlow {
  0% { text-shadow: 0 0 20px var(--secondary-color); }
  100% { text-shadow: 0 0 30px var(--secondary-color), 0 0 40px var(--secondary-color); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ====== IMPROVED LIGHT THEME ====== */
.light-mode {
  --bg-primary: #f8f9fa;
  --bg-secondary: #e9ecef;
  --bg-tertiary: #dee2e6;
  --bg-quaternary: #ced4da;
  
  --terminal-bg: rgba(255, 255, 255, 0.95);
  --terminal-border: rgba(108, 117, 125, 0.4);
  --terminal-header: rgba(248, 249, 250, 0.95);
  --terminal-input: rgba(255, 255, 255, 0.95);
  
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: rgba(0, 0, 0, 0.6);
  
  --primary-color: #198754;
  --secondary-color: #dc3545;
  --accent-color: #0d6efd;
  --warning-color: #fd7e14;
  --success-color: #198754;
  --error-color: #dc3545;
}

.light-mode .terminal-output {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(25, 135, 84, 0.2);
}

.light-mode .terminal-input {
  background: rgba(248, 249, 250, 0.8);
  border: 1px solid rgba(108, 117, 125, 0.3);
  color: var(--text-primary);
}

.light-mode .terminal-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(25, 135, 84, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

.light-mode .terminal-input-section {
  background: rgba(248, 249, 250, 0.98);
  border-top: 2px solid var(--terminal-border);
}

.light-mode .stars {
  opacity: 0.2;
}

.light-mode .particles .particle {
  opacity: 0.3;
}

/* ====== ENHANCED MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
  .terminal-container {
    width: 100%;
    max-width: none;
    padding: 5px;
  }
  
  .terminal-wrapper {
    border-radius: 15px;
    margin: 0;
    height: 100vh;
    max-height: 100vh;
  }
  
  .terminal-body {
    height: calc(100vh - 120px);
  }
  
  .terminal-output {
    padding: 15px;
    font-size: 13px;
  }
  
  .terminal-header {
    padding: 10px 15px;
    flex-wrap: wrap;
  }
  
  .terminal-title .title-text {
    font-size: 0.9em;
    letter-spacing: 1px;
  }
  
  .terminal-title .subtitle {
    display: none;
  }
  
  .system-status {
    display: flex;
    gap: 8px;
  }
  
  .system-status .status-item {
    font-size: 11px;
  }
  
  .ascii-art {
    font-size: 0.4em;
    line-height: 1.2;
  }
  
  .welcome-title {
    font-size: 1.3em;
  }
  
  .welcome-subtitle {
    font-size: 0.9em;
  }
  
  .terminal-input {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .prompt {
    font-size: 12px;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .notification {
    right: 10px;
    max-width: calc(100vw - 20px);
    font-size: 14px;
  }
  
  /* Mobile responsive cho command và response */
  .command-line {
    max-width: 95%;
    font-size: 12px;
    padding: 8px 15px;
  }
  
  .response-container {
    max-width: 98%;
  }
  
  .response-container pre {
    font-size: 12px;
    padding: 10px 15px;
  }
}

@media (max-width: 480px) {
  .terminal-output {
    padding: 10px;
    font-size: 12px;
  }
  
  .terminal-input-section {
    padding: 8px 12px;
  }
  
  .ascii-art {
    font-size: 0.3em;
  }
  
  .welcome-title {
    font-size: 1.1em;
  }
  
  .welcome-subtitle {
    font-size: 0.8em;
  }
  
  .terminal-input {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* ====== LANDSCAPE MOBILE ====== */
@media (max-height: 500px) and (orientation: landscape) {
  .terminal-body {
    height: calc(100vh - 80px);
  }
  
  .ascii-art {
    display: none;
  }
  
  .system-info {
    display: none;
  }
  
  .welcome-message {
    margin: 10px 0;
  }
  
  .loading-container {
    display: none;
  }
}

/* ====== IMPROVED SCROLLING ====== */
.terminal-output::-webkit-scrollbar {
  width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

/* ====== PERFORMANCE OPTIMIZATIONS ====== */
.terminal-wrapper {
  will-change: transform;
  transform: translateZ(0);
}

/* ====== COMMAND LINE STYLING ====== */
.command-line {
  margin: 15px auto;
  max-width: 80%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
  font-family: var(--font-mono);
  animation: fadeInText 0.2s ease-in-out;
}

.response-container {
  contain: layout style;
  text-align: center;
  margin: 15px auto;
  max-width: 90%;
  animation: fadeInText 0.3s ease-in-out;
}

.response-container pre {
  display: inline-block;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fade-in-text {
  will-change: opacity;
}

/* ====== FOCUS IMPROVEMENTS ====== */
.terminal-input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes progressLoad {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes typewriter {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes countUp {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes promptPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

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

@keyframes slideInRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ====== SPECIAL EFFECTS ====== */
.glitch {
  animation: glitch 0.5s infinite;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.fade-in-text {
  animation: fadeInText 0.05s ease-in-out forwards;
}

@keyframes fadeInText {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
