/* ==========================================================================
   Homepage Stylesheet (Under Development - Dark/Orange Theme)
   ========================================================================== */

/* Font Definitions */
@font-face {
  font-family: 'Montserrat';
  src: url('Fonts/Montserrat/montserrat-v31-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('Fonts/Montserrat/montserrat-v31-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Open Sans';
  src: url('Fonts/Open_Sans/open-sans-v44-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Custom Properties */
:root {
  --color-home-bg: #0B0F19;
  --color-home-surface: #111827;
  --color-text-main: #E2E8F0;
  --color-text-dim: #6B7280;
  --color-accent-orange: #F97316;
  --color-accent-red: #EF4444;
  --color-accent-green: #22C55E;
  --font-title: 'Montserrat', sans-serif;
  --font-text: 'Open Sans', sans-serif;
  --font-mono: 'Consolas', 'Courier New', Courier, monospace;
}

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

body {
  background-color: var(--color-home-bg);
  color: var(--color-text-main);
  font-family: var(--font-text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  line-height: 1.6;
  transition: background-color 0.6s ease;
}

/* ==========================================================================
   FULL PAGE THEME STATES
   ========================================================================== */

/* --- HACKED (Green/Black) --- */
body.hacked-theme { background-color: #020a04 !important; }
body.hacked-theme .matrix-grid {
  background-image:
    linear-gradient(to right, rgba(34,197,94,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34,197,94,0.04) 1px, transparent 1px) !important;
}
body.hacked-theme .status-indicator { border-color: rgba(34,197,94,0.35) !important; background-color: rgba(34,197,94,0.06) !important; }
body.hacked-theme .status-dot { background-color: var(--color-accent-green) !important; box-shadow: 0 0 10px var(--color-accent-green) !important; }
body.hacked-theme .status-text { color: var(--color-accent-green) !important; }
body.hacked-theme .terminal-window { border-color: var(--color-accent-green) !important; box-shadow: 0 20px 45px -10px rgba(0,0,0,0.8), 0 0 40px rgba(34,197,94,0.35) !important; }
body.hacked-theme .terminal-bar { background-color: rgba(34,197,94,0.08) !important; border-color: rgba(34,197,94,0.2) !important; }
body.hacked-theme .terminal-title { color: #4ADE80 !important; }
body.hacked-theme .terminal-body { background-color: #010d04 !important; }
body.hacked-theme .terminal-body .terminal-line,
body.hacked-theme .terminal-body .terminal-line span:not(.text-highlight-warn):not(.text-highlight-error) { color: #4ADE80 !important; text-shadow: 0 0 4px rgba(74,222,128,0.25); }
body.hacked-theme .cmd-prompt { color: #22C55E !important; }
body.hacked-theme .blinking-cursor { color: #22C55E !important; }
body.hacked-theme .home-footer, body.hacked-theme .home-footer p { color: rgba(74,222,128,0.3) !important; border-color: rgba(34,197,94,0.08) !important; }
body.hacked-theme .btn-terminal.primary { border-color: var(--color-accent-green) !important; color: var(--color-accent-green) !important; }
body.hacked-theme .btn-terminal.danger { border-color: #F87171 !important; color: #F87171 !important; }
body.hacked-theme .scanlines { background: linear-gradient(rgba(2,10,4,0) 50%, rgba(0,20,0,0.2) 50%) !important; }

/* --- CRASHED (Red/Black) --- */
body.crashed-theme { background-color: #1a0505 !important; }
body.crashed-theme .matrix-grid {
  background-image:
    linear-gradient(to right, rgba(239,68,68,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(239,68,68,0.04) 1px, transparent 1px) !important;
}
body.crashed-theme .status-indicator { border-color: rgba(239,68,68,0.35) !important; background-color: rgba(239,68,68,0.06) !important; }
body.crashed-theme .status-dot { background-color: var(--color-accent-red) !important; box-shadow: 0 0 10px var(--color-accent-red) !important; animation: none !important; }
body.crashed-theme .status-text { color: var(--color-accent-red) !important; }
body.crashed-theme .terminal-window { border-color: var(--color-accent-red) !important; box-shadow: 0 0 50px rgba(239,68,68,0.5) !important; transform: rotate(2deg) scale(0.97) !important; }
body.crashed-theme .terminal-bar { background-color: rgba(239,68,68,0.1) !important; border-color: rgba(239,68,68,0.3) !important; }
body.crashed-theme .terminal-title { color: var(--color-accent-red) !important; animation: textFlicker 0.15s infinite !important; }
body.crashed-theme .terminal-body { background-color: #0d0202 !important; }
body.crashed-theme .terminal-body .terminal-line,
body.crashed-theme .terminal-body .terminal-line span:not(.text-highlight-warn):not(.text-highlight-error) { color: #F87171 !important; }
body.crashed-theme .home-footer, body.crashed-theme .home-footer p { color: rgba(239,68,68,0.3) !important; border-color: rgba(239,68,68,0.08) !important; }

@keyframes textFlicker { 0%, 100% { opacity: 0.8; } 50% { opacity: 0.3; } }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.matrix-grid {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-image:
    linear-gradient(to right, rgba(249,115,22,0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(249,115,22,0.02) 1px, transparent 1px);
  background-size: 50px 50px; z-index: -2; pointer-events: none; transition: background-image 0.5s;
}

.scanlines {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(11,15,25,0) 50%, rgba(0,0,0,0.15) 50%);
  background-size: 100% 4px; z-index: 1000; pointer-events: none; opacity: 0.6;
}

.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }

.home-main {
  flex-grow: 1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: 2rem 1.5rem; text-align: center; position: relative;
}

/* Status Indicator Badge */
.status-indicator {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1.25rem; border-radius: 50px;
  border: 1px solid rgba(249,115,22,0.25); background-color: rgba(249,115,22,0.05);
  margin-bottom: 2rem; box-shadow: 0 0 20px rgba(249,115,22,0.03); transition: all 0.5s ease;
}

.status-dot {
  width: 8px; height: 8px; background-color: var(--color-accent-orange);
  border-radius: 50%; box-shadow: 0 0 8px var(--color-accent-orange);
  animation: pulse 1.5s infinite alternate ease-in-out; transition: all 0.5s ease;
}

.status-text {
  font-size: 0.75rem; font-weight: 700; color: var(--color-accent-orange);
  letter-spacing: 0.08em; transition: color 0.5s ease;
}

/* ==========================================================================
   TERMINAL
   ========================================================================== */
.terminal-window {
  width: 100%; max-width: 720px; background-color: var(--color-home-surface);
  border: 1px solid rgba(249,115,22,0.15); border-radius: 8px; overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.7), 0 0 30px rgba(249,115,22,0.03);
  text-align: left; transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
}

.terminal-bar {
  background-color: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0.75rem 1.25rem; display: flex; align-items: center; position: relative; transition: all 0.5s ease;
}

.terminal-buttons { display: flex; gap: 0.4rem; }
.terminal-buttons .btn { width: 10px; height: 10px; border-radius: 50%; display: inline-block; cursor: pointer; }
.terminal-buttons .btn.close { background-color: var(--color-accent-red); opacity: 0.85; transition: transform 0.1s; }
.terminal-buttons .btn.close:hover { transform: scale(1.15); }
.terminal-buttons .btn.minimize { background-color: #EAB308; opacity: 0.75; cursor: not-allowed; }
.terminal-buttons .btn.expand { background-color: #22C55E; opacity: 0.75; cursor: not-allowed; }

.terminal-title {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--color-text-dim);
  position: absolute; left: 50%; transform: translateX(-50%); transition: color 0.5s ease;
}

.terminal-body {
  padding: 1.5rem; font-family: var(--font-mono); font-size: 0.8125rem;
  height: 280px; overflow-y: auto; scroll-behavior: smooth; transition: background-color 0.5s ease;
}

.terminal-line { margin-bottom: 0.5rem; color: var(--color-text-main); transition: color 0.3s; }
.cmd-prompt { color: var(--color-accent-orange); transition: color 0.5s; }
.log-entry { opacity: 0.9; }
.timestamp { color: var(--color-text-dim); margin-right: 0.5rem; }
.text-info { color: #38BDF8; }
.text-success { color: #4ADE80; }
.text-warn { color: #FB7185; }

/* Highlights */
.text-highlight-warn {
  display: inline-block; border: 1px dashed var(--color-accent-orange);
  background-color: rgba(249,115,22,0.12); padding: 0.2rem 0.6rem; border-radius: 4px;
  color: #FB923C !important; font-weight: 700; box-shadow: 0 0 10px rgba(249,115,22,0.1);
  margin: 0.25rem 0; animation: logGlow 0.3s ease-out;
}

.text-highlight-error {
  display: inline-block; border: 1px dashed var(--color-accent-red);
  background-color: rgba(239,68,68,0.15); padding: 0.25rem 0.75rem; border-radius: 4px;
  color: #F87171 !important; font-weight: 700; box-shadow: 0 0 15px rgba(239,68,68,0.15);
  margin: 0.25rem 0; animation: logGlow 0.3s ease-out, logPulse 1.5s infinite alternate ease-in-out;
}

@keyframes logGlow {
  from { transform: scale(0.97); opacity: 0; filter: brightness(1.5); }
  to { transform: scale(1); opacity: 1; filter: brightness(1); }
}

@keyframes logPulse {
  0% { border-color: rgba(239,68,68,0.4); box-shadow: 0 0 5px rgba(239,68,68,0.1); }
  100% { border-color: var(--color-accent-red); box-shadow: 0 0 15px rgba(239,68,68,0.25); }
}

.blinking-cursor { font-weight: 700; color: var(--color-accent-orange); animation: blink 1s step-end infinite; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.terminal-controls {
  margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.terminal-controls.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.btn-terminal {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 2rem; background-color: transparent;
  font-family: var(--font-title); font-weight: 700; font-size: 0.875rem;
  text-transform: uppercase; letter-spacing: 0.08em; border-radius: 4px;
  cursor: pointer; transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.btn-terminal.primary { border: 1px solid var(--color-accent-orange); color: var(--color-accent-orange); box-shadow: 0 0 15px rgba(249,115,22,0.05); }
.btn-terminal.primary:hover:not(:disabled) { background-color: var(--color-accent-orange); color: var(--color-home-bg); box-shadow: 0 0 25px rgba(249,115,22,0.35); transform: translateY(-2px); }
.btn-terminal.danger { border: 1px solid var(--color-accent-red); color: var(--color-accent-red); box-shadow: 0 0 15px rgba(239,68,68,0.05); }
.btn-terminal.danger:hover:not(:disabled) { background-color: var(--color-accent-red); color: var(--color-home-bg); box-shadow: 0 0 25px rgba(239,68,68,0.35); transform: translateY(-2px); }
.btn-terminal.warning { border: 1px solid #EAB308; color: #EAB308; box-shadow: 0 0 15px rgba(234,179,8,0.05); }
.btn-terminal.warning:hover:not(:disabled) { background-color: #EAB308; color: var(--color-home-bg); box-shadow: 0 0 25px rgba(234,179,8,0.35); transform: translateY(-2px); }
.btn-terminal:active { transform: translateY(0); }
.btn-terminal:disabled { border-color: var(--color-text-dim); color: var(--color-text-dim); box-shadow: none; cursor: not-allowed; background-color: transparent; transform: none !important; }

/* Reboot button */
.btn-reboot-container { display: flex; justify-content: center; margin-top: 1.5rem; animation: logGlow 0.5s ease-out; }
.btn-terminal.reboot {
  border: 2px solid var(--color-accent-red); background-color: rgba(239,68,68,0.1);
  color: #FFFFFF; font-size: 1rem; padding: 1.25rem 3rem;
  box-shadow: 0 0 30px rgba(239,68,68,0.4); animation: rebootBlink 1s step-end infinite;
}
.btn-terminal.reboot:hover { background-color: var(--color-accent-red); color: #FFFFFF; box-shadow: 0 0 45px rgba(239,68,68,0.7); transform: scale(1.03) translateY(-2px); }
@keyframes rebootBlink { 50% { border-color: transparent; box-shadow: none; } }

/* ==========================================================================
   INTERACTIVE MINIGAME ASSETS
   ========================================================================== */

/* Code Debris */
.mess-element {
  position: absolute; font-family: var(--font-mono); font-size: 0.9375rem;
  color: var(--color-accent-orange); opacity: 0.35; cursor: pointer; user-select: none;
  z-index: 10; transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s; padding: 4px;
}
.mess-element:hover { opacity: 0.85; transform: scale(1.15) rotate(0deg) !important; color: #FFFFFF; text-shadow: 0 0 8px var(--color-accent-orange); }
.mess-element.popped { transform: scale(0) !important; opacity: 0 !important; transition: transform 0.3s cubic-bezier(0.36,0.07,0.19,0.97), opacity 0.3s; }

/* Bugs */
.bug-element {
  position: absolute; width: 32px; height: 32px; cursor: pointer; z-index: 20;
  transition: left 0.3s linear, top 0.3s linear, transform 0.3s ease; user-select: none;
}
.bug-pink { color: #FB7185 !important; }
.bug-green { color: #4ADE80 !important; filter: drop-shadow(0 0 6px #4ADE80) !important; }
.bug-red { color: var(--color-accent-red) !important; filter: drop-shadow(0 0 6px var(--color-accent-red)) !important; }
.bug-svg { width: 100%; height: 100%; display: block; }

@keyframes legWiggleLeft { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes legWiggleRight { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-10deg); } }
.bug-leg-left { animation: legWiggleLeft 0.12s infinite alternate ease-in-out; transform-origin: 15px 20px; }
.bug-leg-right { animation: legWiggleRight 0.12s infinite alternate ease-in-out; transform-origin: 25px 20px; }

.bug-glitchy { width: 42px; height: 42px; }
.bug-glitchy .bug-leg-left { animation-duration: 0.06s; }
.bug-glitchy .bug-leg-right { animation-duration: 0.06s; }

.leg-1, .leg-6 { animation-delay: 0s; }
.leg-2, .leg-5 { animation-delay: 0.04s; }
.leg-3, .leg-4 { animation-delay: 0.08s; }

.bug-element:hover { filter: brightness(1.3) drop-shadow(0 0 5px rgba(251,113,133,0.6)); }
.bug-element.popped { transform: scale(0) rotate(720deg) !important; opacity: 0; pointer-events: none; transition: transform 0.4s ease-out, opacity 0.4s; }

/* Feature badge (green) */
.feature-element {
  position: fixed; z-index: 15; background-color: rgba(74,222,128,0.15);
  border: 1px solid #4ADE80; color: #4ADE80;
  font-family: var(--font-title); font-weight: 700; font-size: 0.6875rem;
  padding: 0.25rem 0.5rem; border-radius: 4px; text-transform: uppercase;
  letter-spacing: 0.05em; box-shadow: 0 0 10px rgba(74,222,128,0.2);
  pointer-events: none; user-select: none; animation: featureFly 1.5s forwards ease-out;
}

/* Removed badge (red) */
.removed-element {
  position: fixed; z-index: 15; background-color: rgba(239,68,68,0.15);
  border: 1px solid var(--color-accent-red); color: #F87171;
  font-family: var(--font-title); font-weight: 700; font-size: 0.6875rem;
  padding: 0.25rem 0.5rem; border-radius: 4px; text-transform: uppercase;
  letter-spacing: 0.05em; box-shadow: 0 0 10px rgba(239,68,68,0.2);
  pointer-events: none; user-select: none; animation: featureFly 1.5s forwards ease-out;
}

@keyframes featureFly {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  15% { transform: translateY(-10px) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.9); opacity: 0; }
}

/* Reboot Overlay */
.reboot-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: #000000; opacity: 0; z-index: 9999;
  pointer-events: none; transition: opacity 0.8s ease-in;
}
.reboot-overlay.active { opacity: 1; pointer-events: auto; }

/* [TESTING] Cursor trail particle style */
.cursor-trail-particle {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-orange);
  text-shadow: 0 0 5px var(--color-accent-orange);
  transition: transform 0.6s cubic-bezier(0.1, 0.8, 0.3, 1), opacity 0.6s ease-out;
  transform: scale(1) translateY(0);
}
.cursor-trail-particle.fade {
  opacity: 0;
  transform: scale(0.4) translateY(-20px) rotate(45deg);
}

/* Footer */
.home-footer { padding: 2.5rem 0; border-top: 1px solid rgba(255,255,255,0.03); text-align: center; transition: all 0.5s ease; }
.home-footer p { font-size: 0.8125rem; color: var(--color-text-dim); letter-spacing: 0.02em; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes pulse {
  0% { transform: scale(0.9); box-shadow: 0 0 4px rgba(249,115,22,0.4); }
  100% { transform: scale(1.1); box-shadow: 0 0 12px rgba(249,115,22,0.95); }
}
@keyframes blink { from, to { color: transparent; } 50% { color: var(--color-accent-orange); } }

/* Scrollbar */
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.01); }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(249,115,22,0.15); border-radius: 4px; }
.terminal-body::-webkit-scrollbar-thumb:hover { background: rgba(249,115,22,0.35); }

/* ==========================================================================
   MEDIA QUERIES
   ========================================================================== */
@media (min-width: 768px) { .terminal-body { height: 380px; } }
@media (max-width: 480px) {
  .terminal-window { height: 350px; }
  .terminal-body { height: calc(100% - 35px); font-size: 0.75rem; }
  .terminal-controls { flex-direction: column; width: 100%; max-width: 320px; gap: 0.75rem; }
  .btn-terminal { width: 100%; padding: 0.85rem 1.5rem; font-size: 0.8125rem; }
}
