/* ==========================================================================
   SynergyCompass™ Core Stylesheet [DEV BUILD]
   ========================================================================== */

:root {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --card-hover: #273549;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --catalyst: #a855f7;
  --connector: #10b981;
  --strategist: #3b82f6;
  --operator: #f59e0b;
  --cyan: #38bdf8;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-stack);
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 40px 12px;
}

.container {
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.version-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 5-Mode Navigation Bar */
.mode-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #0b1120;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.mode-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 2px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  white-space: nowrap;
}

.mode-nav-btn:hover {
  color: #cbd5e1;
}

.mode-nav-btn.active {
  background: var(--card-bg);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.instruction-banner {
  font-size: 0.82rem;
  color: #cbd5e1;
  text-align: center;
  margin-top: 4px;
  line-height: 1.4;
}

/* Wheel Container */
.wheel-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 14px auto 10px auto;
  touch-action: none;
}

canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0b1120;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  cursor: grab;
  display: block;
}

canvas:active {
  cursor: grabbing;
}

.axis-label {
  position: absolute;
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  pointer-events: none;
}

.axis-top { top: -14px; left: 50%; transform: translateX(-50%); }
.axis-bottom { bottom: -14px; left: 50%; transform: translateX(-50%); }
.axis-left { left: -10px; top: 50%; transform: translate(-100%, -50%); }
.axis-right { right: -10px; top: 50%; transform: translate(100%, -50%); }

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.metric-card {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.metric-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  width: 25%;
  border-radius: 3px;
  transition: width 0.08s ease-out;
}

.catalyst-accent { border-color: var(--catalyst); color: var(--catalyst); }
.connector-accent { border-color: var(--connector); color: var(--connector); }
.strategist-accent { border-color: var(--strategist); color: var(--strategist); }
.operator-accent { border-color: var(--operator); color: var(--operator); }

.catalyst-fill { background: var(--catalyst); }
.connector-fill { background: var(--connector); }
.strategist-fill { background: var(--strategist); }
.operator-fill { background: var(--operator); }

/* Buttons */
.action-btn {
  width: 100%;
  padding: 11px;
  background: #2563eb;
  color: white;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s ease;
  margin-top: 12px;
}

.action-btn:hover {
  background: #1d4ed8;
}

.action-btn.secondary-btn {
  background: #0284c7;
}

.action-btn.secondary-btn:hover {
  background: #0369a1;
}

.action-btn.outline-btn {
  background: #0b1120;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  margin-top: 0;
}

.action-btn.outline-btn:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* Reveal Card */
.reveal-card {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.match-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.mo-box {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid var(--operator);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #e2e8f0;
  margin-top: 8px;
}

.icebreaker-box {
  background: rgba(15, 23, 42, 0.7);
  border-left: 3px solid var(--cyan);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #e2e8f0;
  margin-top: 8px;
}

/* Info Banners */
.banner-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banner-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  display: flex;
  justify-content: space-between;
}

/* Rolodex & Perception View */
.rolodex-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perception-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.perception-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.78rem;
}

.contacts-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}

.contact-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.15s ease;
}

.contact-item:hover {
  border-color: #475569;
}

.contact-info { display: flex; flex-direction: column; gap: 2px; }
.contact-name { font-size: 0.84rem; font-weight: 700; color: #fff; }
.badge-tag { font-size: 0.68rem; color: #94a3b8; font-weight: normal; }
.contact-role { font-size: 0.72rem; color: var(--text-muted); }
.contact-meta { font-size: 0.7rem; color: var(--cyan); margin-top: 2px; }
.contact-meta a { color: var(--cyan); text-decoration: none; }
.contact-meta a:hover { text-decoration: underline; }
.contact-score { font-size: 0.75rem; font-weight: 700; color: var(--cyan); white-space: nowrap; }

/* Badge Picker Bar */
.badge-picker-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.badge-quick-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-pill {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.badge-pill:hover {
  color: #fff;
  border-color: #64748b;
}

.badge-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.badge-input-wrap {
  display: flex;
  gap: 6px;
}

.badge-input-wrap input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #fff;
  text-transform: uppercase;
}

.badge-input-wrap button {
  background: var(--cyan);
  border: none;
  border-radius: 6px;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.badge-input-wrap button:hover {
  background: #7dd3fc;
}

/* Cloud Status */
.cloud-status-container {
  display: flex;
  justify-content: center;
  margin: 4px 0 10px 0;
}

.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 4px 12px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cloud-status-badge:hover {
  border-color: var(--cyan);
  background: rgba(30, 41, 59, 0.95);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
}

.status-dot.live {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.status-gear {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Legal Footer & Modals */
footer {
  margin-top: 36px;
  padding: 20px 12px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-links {
  margin: 8px 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--cyan);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

.trademark-notice {
  font-size: 0.65rem;
  color: #64748b;
  margin-top: 8px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.legal-modal-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}

.legal-modal-header h3 {
  font-size: 0.95rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.legal-modal-close:hover { color: #fff; }

.legal-modal-tabs {
  display: flex;
  background: #0b1120;
  border-bottom: 1px solid #334155;
}

.legal-tab-btn {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.legal-tab-btn.active {
  color: var(--cyan);
  border-bottom: 2px solid var(--cyan);
  background: rgba(56, 189, 248, 0.08);
}

.legal-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.legal-modal-body h4 {
  color: #f8fafc;
  margin: 14px 0 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  padding-bottom: 3px;
}

.legal-modal-body h4:first-child { margin-top: 0; }
.legal-modal-body p { margin-bottom: 8px; }
.legal-modal-body ul { padding-left: 18px; margin-bottom: 10px; }
.legal-modal-body li { margin-bottom: 4px; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 11000;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: toastSlideUp 0.25s ease-out;
  pointer-events: auto;
  line-height: 1.4;
}

.toast-success {
  border-left: 4px solid var(--connector);
}

.toast-warning {
  border-left: 4px solid var(--operator);
}

.toast-info {
  border-left: 4px solid var(--cyan);
}

.toast-fadeout {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsiveness for small screens (<360px) */
@media (max-width: 360px) {
  .mode-nav-btn {
    font-size: 0.62rem;
    padding: 6px 1px;
  }
  .wheel-container {
    width: 270px;
    height: 270px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Camera QR Badge Scanner & Digital Badge Pass UI
   ============================================================================= */
.qr-scan-btn {
  background: var(--cyan);
  color: #0f172a;
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.qr-scan-btn:hover {
  background: #7dd3fc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.qr-modal-card {
  max-width: 440px;
}

.qr-viewfinder-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

#qr-reader {
  width: 100% !important;
  border: none !important;
}

#qr-reader video {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 10px;
}

#qr-reader__scan_region {
  background: transparent !important;
}

#qr-reader__dashboard {
  display: none !important;
}

.qr-target-overlay {
  position: absolute;
  top: 14%;
  left: 14%;
  width: 72%;
  height: 72%;
  pointer-events: none;
  box-sizing: border-box;
}

.qr-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #38bdf8;
  border-style: solid;
}

.qr-top-left {
  top: 0;
  left: 0;
  border-width: 3.5px 0 0 3.5px;
  border-top-left-radius: 6px;
}

.qr-top-right {
  top: 0;
  right: 0;
  border-width: 3.5px 3.5px 0 0;
  border-top-right-radius: 6px;
}

.qr-bottom-left {
  bottom: 0;
  left: 0;
  border-width: 0 0 3.5px 3.5px;
  border-bottom-left-radius: 6px;
}

.qr-bottom-right {
  bottom: 0;
  right: 0;
  border-width: 0 3.5px 3.5px 0;
  border-bottom-right-radius: 6px;
}

.qr-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #38bdf8, #a855f7, transparent);
  box-shadow: 0 0 10px #38bdf8, 0 0 18px #a855f7;
  animation: qrLaserScan 2s ease-in-out infinite alternate;
}

@keyframes qrLaserScan {
  0% { top: 5%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 95%; opacity: 0.3; }
}

.badge-qr-display-box {
  background: #ffffff;
  padding: 14px;
  border-radius: 12px;
  display: inline-block;
  margin: 10px 0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.badge-qr-display-box img {
  display: block;
  width: 190px;
  height: 190px;
}

/* =============================================================================
   Diagnostic Assessment Quiz UI
   ============================================================================= */
.quiz-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #0f172a;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 16px 0;
  border: 1px solid #334155;
}

.quiz-progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--cyan), var(--catalyst));
  transition: width 0.3s ease;
}

.quiz-option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
  color: #f1f5f9;
  font-size: 0.82rem;
  line-height: 1.45;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.quiz-option-btn:hover {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}

.quiz-option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #475569;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.72rem;
}

.quiz-option-btn:hover .quiz-option-key {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #0f172a;
}


