/* ==========================================================
   Cyber Slacker: Retro Corporate OS & Excel Camouflage Styling
   ========================================================== */

:root {
  --bg-dark: #0a0f1d;
  --window-bg: rgba(15, 23, 42, 0.95);
  --accent-cyan: #00f0ff;
  --accent-green: #22c55e;
  --accent-gold: #facc15;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --excel-green: #107c41;
  --excel-bg: #ffffff;
  --excel-border: #d4d4d4;
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
}

#desktopContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0a0f1d 100%);
  padding: 12px;
}

/* ==========================================
   MENUBAR & STATS HUD
   ========================================== */
.os-menubar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 8px;
}

.os-logo {
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.hud-stats-group {
  display: flex;
  gap: 16px;
}

.stat-badge {
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.stat-badge .val {
  font-family: var(--font-mono);
  font-weight: 800;
  margin-left: 4px;
}

.text-gold { color: var(--accent-gold); }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }

.top-nav-controls {
  display: flex;
  gap: 8px;
}

.icon-btn, .lang-dropdown {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

/* ==========================================
   BOSS PATROL & SUSPICION BAR
   ========================================== */
.boss-patrol-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 16px;
  margin-bottom: 8px;
}

.boss-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 14px;
}

.status-indicator {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.suspicion-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 260px;
}

.suspicion-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.meter-bar {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #facc15, #ef4444);
  transition: width 0.1s linear;
}

/* ==========================================
   PRAISE BANNER
   ========================================== */
.praise-banner {
  position: absolute;
  top: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(16, 185, 129, 0.95);
  color: white;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 50;
}

.praise-banner.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================
   MAIN WORKSTATION WINDOW
   ========================================== */
.workstation-window {
  flex: 1;
  background: var(--window-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.window-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.window-buttons {
  display: flex;
  gap: 8px;
}

.win-btn {
  display: inline-block;
  width: 14px;
  height: 14px;
  line-height: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
}

.win-btn.close:hover {
  background: #ef4444;
  color: white;
}

/* Tabs */
.app-tabs-nav {
  display: flex;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px 0;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: #1e293b;
  color: var(--accent-cyan);
  border-top: 2px solid var(--accent-cyan);
}

.tab-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

/* Crypto Panel */
.crypto-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.coin-selector-bar {
  display: flex;
  gap: 6px;
}

.coin-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.coin-pill.active {
  background: var(--accent-cyan);
  color: black;
  border-color: var(--accent-cyan);
}

.coin-quote {
  text-align: right;
}

.current-price {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-cyan);
  display: block;
}

.quote-holdings {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

#cryptoCanvas {
  width: 100%;
  height: 190px;
  display: block;
}

.trading-action-bar {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.action-btn:active {
  transform: scale(0.97);
}

.buy-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.sell-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Runner Panel */
.runner-box {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

#runnerCanvas {
  width: 100%;
  height: 220px;
  display: block;
}

.runner-instructions {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Gossip Panel */
.gossip-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gossip-msg-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
}

.gossip-sender {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.gossip-text {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.gossip-replies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reply-btn {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reply-btn:hover {
  background: var(--accent-cyan);
  color: black;
}

/* Shop Panel */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.shop-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
}

.shop-icon {
  font-size: 26px;
}

.shop-info {
  flex: 1;
}

.shop-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.shop-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.buy-btn {
  background: var(--accent-gold);
  color: black;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.buy-btn:disabled {
  background: #475569;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ==========================================
   BOTTOM DOCK & PANIC BUTTON
   ========================================== */
.bottom-dock {
  margin-top: 8px;
}

.panic-emergency-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: white;
  border: 2px solid #fca5a5;
  border-radius: 12px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
  animation: pulseGlow 2s infinite ease-in-out;
}

.panic-emergency-btn.active {
  background: linear-gradient(135deg, #107c41 0%, #064e3b 100%);
  border-color: #86efac;
  box-shadow: 0 8px 24px rgba(16, 124, 65, 0.5);
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

/* ==========================================
   ULTRA-REALISTIC EXCEL CAMOUFLAGE OVERLAY
   ========================================== */
.excel-camouflage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--excel-bg);
  color: #000;
  display: flex;
  flex-direction: column;
  z-index: 100;
  font-family: 'Segoe UI', Arial, sans-serif;
  cursor: pointer;
}

.excel-header-ribbon {
  background: var(--excel-green);
  color: white;
  padding: 4px 12px 0;
}

.excel-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  padding-bottom: 4px;
}

.excel-logo {
  font-weight: 800;
}

.excel-ribbon-tabs {
  display: flex;
  gap: 16px;
  font-size: 12px;
  background: #f3f2f1;
  color: #333;
  padding: 4px 12px;
  border-top: 1px solid #e1dfdd;
}

.excel-ribbon-tabs span.active {
  color: var(--excel-green);
  font-weight: 700;
  border-bottom: 2px solid var(--excel-green);
}

.excel-formula-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--excel-border);
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #333;
}

.cell-name {
  border-right: 1px solid var(--excel-border);
  padding-right: 8px;
  margin-right: 8px;
  font-weight: 700;
}

.fx-icon {
  color: #666;
  font-style: italic;
  font-weight: 800;
  margin-right: 8px;
}

.excel-sheet-grid {
  flex: 1;
  overflow: auto;
  background: #fff;
}

.excel-sheet-grid table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.excel-sheet-grid th, .excel-sheet-grid td {
  border: 1px solid var(--excel-border);
  padding: 4px 8px;
  text-align: left;
}

.excel-sheet-grid th {
  background: #f3f2f1;
  color: #666;
  font-weight: normal;
  text-align: center;
  width: 35px;
}

.excel-sheet-grid .bold { font-weight: 700; }
.excel-sheet-grid .highlight-row { background: #e6f4ea; }

.excel-status-bar {
  background: #f3f2f1;
  border-top: 1px solid var(--excel-border);
  display: flex;
  justify-content: space-between;
  padding: 4px 12px;
  font-size: 11px;
  color: #666;
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 16px;
}

.modal-content {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

.rules-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 20px;
  color: #cbd5e1;
}

.primary-start-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: black;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.primary-start-btn:hover {
  transform: scale(1.02);
}

.results-stats-box {
  display: flex;
  justify-content: space-around;
  background: rgba(15, 23, 42, 0.6);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.res-label {
  font-size: 12px;
  color: var(--text-muted);
}

.res-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.secondary-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
}
