/**
 * MyLocalDev Web Design - Features & Hidden Layer Styles (Clean Rewrite v2)
 * Contains ONLY active interactive features:
 * - Floating Arcade Trigger & Dev Arcade Modal
 * - Engineering Terminal Modal
 * - Developer Control Room Modal
 * - Procedural Demolition Mode & HUD
 * - Full-Page X-Ray Mode & HUD
 * - Secret Easter Eggs
 * - Screen Morph & Vibration FX
 */

/* ==========================================================================
   1. FLOATING ARCADE TRIGGER & EASTER EGGS
   ========================================================================== */
.floating-arcade-trigger {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 90;
  background: var(--gradient-btn);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-arcade-trigger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon);
}

.floating-arcade-trigger.active {
  background: #10b981;
  border-color: #34d399;
}

@media (max-width: 640px) {
  .floating-arcade-trigger {
    bottom: 1rem;
    left: 1rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
    min-height: 44px;
  }
}

.secret-corner-screw {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #334155;
  border: 1px solid #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #94a3b8;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.secret-corner-screw:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.secret-traffic-cone {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  transition: transform 0.2s ease;
}

.secret-traffic-cone:hover {
  transform: scale(1.3) rotate(10deg);
}

.secret-tiny-question {
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.8rem;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.secret-tiny-question:hover {
  opacity: 1;
  color: var(--accent-cyan);
}

.secret-counter-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

/* ==========================================================================
   2. ARCADE, TERMINAL & DEVROOM MODALS
   ========================================================================== */
.arcade-modal,
.terminal-modal,
.devroom-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 9, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.arcade-modal.active,
.terminal-modal.active,
.devroom-modal.active {
  display: flex;
}

/* Arcade Box */
.arcade-box {
  background: var(--bg-card);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 40px var(--accent-glow);
  text-align: center;
}

@media (max-width: 480px) {
  .arcade-modal,
  .terminal-modal,
  .devroom-modal {
    padding: 0.75rem;
    align-items: flex-start;
  }
  .arcade-box {
    padding: 1rem 0.75rem;
    margin: auto 0;
  }
  .arcade-canvas {
    height: auto;
    aspect-ratio: 440 / 400;
    max-height: 42vh;
    margin: 0.5rem auto;
  }
  #arcade-close-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.arcade-canvas {
  width: 100%;
  height: 380px;
  background: #020205;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  display: block;
  margin: 1rem auto 0.75rem;
  touch-action: none;
}

.arcade-touch-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
  touch-action: manipulation;
}

.arcade-ctrl-btn {
  flex: 1;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: var(--surface-2, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #ffffff);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.1s ease;
}

.arcade-ctrl-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.18);
}

.arcade-ctrl-fire {
  background: #f43f5e;
  border-color: #fb7185;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.arcade-ctrl-fire:active {
  background: #e11d48;
}

/* Engineering Terminal Box */
.terminal-box {
  background: #030308;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  max-width: 700px;
  width: 100%;
  height: 460px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 25px rgba(6, 182, 212, 0.2);
  font-family: var(--font-mono);
  overflow: hidden;
}

.terminal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: rgba(6, 182, 212, 0.08);
  border-bottom: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.terminal-output {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.term-line { margin-bottom: 0.35rem; }
.term-input-echo { color: var(--accent-cyan); }
.term-response { color: #f8fafc; white-space: pre-wrap; }

.terminal-input-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(6, 182, 212, 0.2);
}

.term-prompt {
  color: #10b981;
  font-weight: bold;
  margin-right: 0.5rem;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
}

/* Devroom Box */
.devroom-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.devroom-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

@media (max-width: 480px) {
  .devroom-stat-grid {
    grid-template-columns: 1fr;
  }
}

.devroom-stat-card {
  padding: 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
}

.devroom-stat-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

/* ==========================================================================
   3. DEMOLITION MODE & HUD
   ========================================================================== */
body.demolition-mode-active {
  user-select: none;
}

body.cursor-hammer, body.cursor-hammer * {
  cursor: crosshair;
}

body.cursor-tnt, body.cursor-tnt * {
  cursor: crosshair;
}

body.cursor-wrecking, body.cursor-wrecking * {
  cursor: crosshair;
}

.demolition-hud {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.94);
  border: 1px solid rgba(239, 68, 68, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.25);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 95vw;
}

.demo-hud-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.demo-hud-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: 0.05em;
  background: rgba(239, 68, 68, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.demo-hud-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.demo-tools-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.demo-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
}

.demo-tool-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.demo-tool-btn.active {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   4. FULL-PAGE X-RAY MODE & HUD
   ========================================================================== */
body.xray-mode-active section {
  outline: 1px dashed rgba(6, 182, 212, 0.4);
  outline-offset: -1px;
}

body.xray-mode-active .project-card,
body.xray-mode-active .live-client-card,
body.xray-mode-active .service-card,
body.xray-mode-active .pricing-tier-card {
  outline: 1px dashed rgba(6, 182, 212, 0.5);
}

.xray-hover-inspector {
  position: absolute;
  pointer-events: none;
  z-index: 99997;
  border: 2px dashed var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
  transition: all 0.05s ease-out;
}

.xray-inspector-badge {
  position: absolute;
  top: -26px;
  left: 0;
  background: var(--accent-cyan);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  white-space: nowrap;
}

.xray-hud,
.xray-vision-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 8, 17, 0.94);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px var(--accent-cyan-glow);
  max-width: 95vw;
  flex-wrap: wrap;
  justify-content: center;
}

.xray-dock-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  white-space: nowrap;
}

.xray-dock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  display: inline-block;
}

.xray-dock-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.xray-dock-btn {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.xray-dock-btn:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--accent-cyan);
}

.xray-dock-btn.active {
  background: var(--accent-cyan);
  color: #000000;
  font-weight: 700;
}

.xray-dock-close {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.xray-dock-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* ==========================================================================
   5. SCREEN MORPH & VIBRATION FX
   ========================================================================== */
.screen-morph-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  background: radial-gradient(circle at center, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
  animation: morph-flash 0.35s ease-out forwards;
}

@keyframes morph-flash {
  from { opacity: 1; transform: scale(0.98); }
  to { opacity: 0; transform: scale(1.02); }
}

.screen-shake,
.shake-medium,
.shake-heavy {
  animation: screen-shake-anim 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screen-shake-anim {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
