/**
 * CyberGuard Pro — Stealth Mode (Calculator Disguise)
 * Mode discret : interface de calculatrice pour camouflage
 */

/* ============ STEALTH MODE ACTIVE ============ */
body.stealth-mode {
  --bg: #f5f5f5;
  --bg2: #ffffff;
  --bg3: #fafafa;
  --txt: #1a1a1a;
  --txt2: #666666;
  --accent: #007aff;
}

body.stealth-mode::after {
  display: none; /* Remove scanline effect */
}

/* Hide main app content */
body.stealth-mode .navbar,
body.stealth-mode .mobile-header,
body.stealth-mode #app,
body.stealth-mode .footer,
body.stealth-mode .modal-overlay,
body.stealth-mode .btt,
body.stealth-mode .bottom-nav,
body.stealth-mode .mobile-menu,
body.stealth-mode .mobile-menu-overlay,
body.stealth-mode .emergency-fab,
body.stealth-mode .whatsapp-fab,
body.stealth-mode .tutorial-overlay,
body.stealth-mode .auth-screen {
  display: none !important;
}

/* Show calculator */
body.stealth-mode .stealth-calculator {
  display: flex !important;
}

/* ============ CALCULATOR INTERFACE ============ */
.stealth-calculator {
  display: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #2c2c2c 0%, #1c1c1c 100%);
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  z-index: 99999;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Display area */
.calc-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 20px 24px;
  min-height: 180px;
}

.calc-expression {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  min-height: 1.5rem;
  word-break: break-all;
  text-align: right;
  width: 100%;
}

.calc-result {
  font-size: 4rem;
  font-weight: 300;
  color: #ffffff;
  line-height: 1;
  word-break: break-all;
  text-align: right;
  width: 100%;
}

@media (max-width: 380px) {
  .calc-result {
    font-size: 3rem;
  }
}

/* Button grid */
.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px;
  background: #000000;
}

.calc-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 400;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.calc-btn:active {
  opacity: 0.6;
  transform: scale(0.95);
}

/* Number buttons */
.calc-btn.num {
  background: #333333;
  color: #ffffff;
}

/* Operator buttons */
.calc-btn.op {
  background: #ff9f0a;
  color: #ffffff;
}

.calc-btn.op.active {
  background: #ffffff;
  color: #ff9f0a;
}

/* Function buttons */
.calc-btn.fn {
  background: #a5a5a5;
  color: #000000;
}

/* Zero button spans 2 columns */
.calc-btn.zero {
  grid-column: span 2;
  border-radius: 40px;
  aspect-ratio: auto;
  justify-content: flex-start;
  padding-left: 32px;
}

/* Secret exit button - tap 5 times on "AC" */
.calc-btn.secret-exit {
  position: relative;
}

/* Hidden indicator after 3 taps */
.calc-btn.secret-exit.hint::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgba(0, 122, 255, 0.5);
  border-radius: 50%;
}

/* ============ STATUS BAR FAKE ============ */
.stealth-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  background: transparent;
}

.stealth-statusbar .time {
  font-variant-numeric: tabular-nums;
}

.stealth-statusbar .icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.stealth-statusbar .icons i {
  font-size: 0.9rem;
}

/* ============ ANIMATIONS ============ */
@keyframes stealthFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.stealth-mode .stealth-calculator {
  animation: stealthFadeIn 0.2s ease;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 500px) {
  .stealth-calculator {
    max-width: 400px;
    max-height: 700px;
    margin: auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
}

/* ============ LIGHT THEME VARIABLES ============ */
:root {
  --light-bg: #f5f5f7;
  --light-bg2: #ffffff;
  --light-bg3: #e5e5ea;
  --light-txt: #1c1c1e;
  --light-txt2: #8e8e93;
  --light-accent: #007aff;
  --light-border: #d1d1d6;
}

/* Light theme toggle */
body.light-theme {
  --bg: var(--light-bg);
  --bg2: var(--light-bg2);
  --bg3: var(--light-bg3);
  --bg4: #d1d1d6;
  --txt: var(--light-txt);
  --txt2: var(--light-txt2);
  --txt3: #aeaeb2;
  --brd: var(--light-border);
}

body.light-theme::after {
  display: none;
}

body.light-theme .navbar {
  background: rgba(255, 255, 255, 0.92);
}

body.light-theme .card,
body.light-theme .nav-card,
body.light-theme .scenario-card,
body.light-theme .diag-box,
body.light-theme .chk-group,
body.light-theme .faq-item,
body.light-theme .fp-card,
body.light-theme .tl-card {
  background: var(--light-bg2);
  border-color: var(--light-border);
}

body.light-theme .alert-danger {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.08), rgba(255, 45, 85, 0.02));
}

body.light-theme .alert-info {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(0, 122, 255, 0.02));
}

body.light-theme .alert-success {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.08), rgba(52, 199, 89, 0.02));
}

body.light-theme .code-block {
  background: #1c1c1e;
}

body.light-theme .hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0, 122, 255, 0.05), transparent),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(255, 45, 85, 0.03), transparent);
}
