/* ════════════════════════════════════════════════════════════════
   TOWERS AI - Stylesheet
   Intelligent Pattern Analysis System
   ════════════════════════════════════════════════════════════════ */

/* ── Back Button ──────────────────────────────── */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  font-family: inherit;
  z-index: 1000;
}
.back-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-4px);
}

/* ── Login Card ────────────────────────────────── */
#loginCard {
  display: block !important;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}
#loginCard:empty { display: none; }
#loginCard.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* ── VIP Badge ────────────────────────────────── */
.vip-badge {
  display: none;
  background: linear-gradient(135deg, #facc15, #fb7185);
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  margin-bottom: 20px;
  animation: slideInUp 0.5s ease 0.1s backwards;
}
.vip-badge.show { display: block; }

/* ── Towers Container ────────────────────────────────── */
.towers-container {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 120px;
  display: none;
  opacity: 0;
}
.towers-container.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.4s ease-out;
}

/* ── Header ────────────────────────────────── */
.towers-header {
  text-align: center;
  margin-bottom: 28px;
  animation: fadeIn 0.6s ease;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.towers-header h1 {
  font-size: 28px;
  margin: 0;
  background: linear-gradient(135deg, #6cf2c2, #5aa2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-version {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
  background: rgba(108, 242, 194, 0.1);
  border: 1px solid rgba(108, 242, 194, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.header-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 10px;
}
.header-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.meta-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-family: 'Courier New', monospace;
}
.meta-chip:first-child {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.08);
}

/* ── Demo Counter ────────────────────────────────── */
.demo-counter {
  background: linear-gradient(135deg, rgba(108, 242, 194, 0.08), rgba(90, 162, 255, 0.08));
  border: 2px solid rgba(108, 242, 194, 0.25);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: slideInUp 0.5s ease 0.1s backwards;
}
.quota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quota-left {}
.demo-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.demo-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Courier New', monospace;
}
.demo-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(108, 242, 194, 0.15);
  transition: all 0.3s ease;
}
.demo-dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.demo-dot.used { background: rgba(108, 242, 194, 0.08); }
.demo-dot.vip-mode {
  background: linear-gradient(135deg, #facc15, #fb7185);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

/* ── Sections ────────────────────────────────── */
.ai-load-section {
  background: var(--card);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  animation: slideInUp 0.5s ease 0.2s backwards;
}
.section-header {
  margin-bottom: 14px;
}
.ai-load-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-load-title::before { content: '⚡'; font-size: 16px; }
.section-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── Load Buttons ────────────────────────────────── */
.load-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.load-btn {
  padding: 10px 8px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.25s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.btn-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.btn-desc {
  font-size: 10px;
  color: var(--muted);
  display: block;
  font-weight: 400;
}
.load-btn:hover:not(.locked) {
  border-color: var(--accent2);
  background: rgba(90, 162, 255, 0.08);
  transform: translateY(-2px);
}
.load-btn.active {
  border-color: var(--accent);
  background: rgba(108, 242, 194, 0.12);
  box-shadow: 0 0 14px rgba(108, 242, 194, 0.2);
}
.load-btn.active .btn-name { color: var(--accent); }
.load-btn.locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.load-btn.locked:hover { transform: none; border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); }

/* ── AI Status ────────────────────────────────── */
.ai-status {
  background: rgba(108, 242, 194, 0.04);
  border: 2px solid rgba(108, 242, 194, 0.18);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInUp 0.5s ease 0.3s backwards;
  position: relative;
  overflow: hidden;
}
.ai-status.analyzing {
  border-color: var(--accent);
  background: rgba(108, 242, 194, 0.08);
  animation: pulse-border 1.5s infinite;
}
.ai-status-icon { font-size: 18px; flex-shrink: 0; }
.ai-status-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  flex: 1;
}
.status-ping {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  flex-shrink: 0;
  animation: blink 1.4s infinite;
}

/* ── Inference Log ────────────────────────────────── */
.inference-log-wrap {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(108, 242, 194, 0.15);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  animation: slideInUp 0.5s ease 0.35s backwards;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(108, 242, 194, 0.06);
  border-bottom: 1px solid rgba(108, 242, 194, 0.1);
}
.log-title {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.log-live {
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  animation: blink 1.2s infinite;
}
.inference-log {
  padding: 10px 14px;
  height: 130px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 242, 194, 0.2) transparent;
}
.inference-log::-webkit-scrollbar { width: 4px; }
.inference-log::-webkit-scrollbar-thumb { background: rgba(108, 242, 194, 0.2); border-radius: 2px; }
.log-line {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.2s ease;
}
.log-line.log-idle .log-msg { color: rgba(255,255,255,0.2); }
.log-ts {
  color: rgba(108, 242, 194, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}
.log-msg { color: rgba(255,255,255,0.7); }

/* ── Meta Stats Row ────────────────────────────────── */
.meta-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  animation: slideInUp 0.5s ease 0.4s backwards;
}
.meta-stat {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
}
.meta-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  font-weight: 600;
}
.meta-stat-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.meta-stat-val.mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--accent); }
.confidence-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.confidence-bar-bg {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.confidence-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6cf2c2, #5aa2ff);
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(108, 242, 194, 0.5);
}
.confidence-val {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
  min-width: 30px;
  text-align: right;
}

/* ── Controls ────────────────────────────────── */
.controls-section {
  margin-bottom: 20px;
  animation: slideInUp 0.5s ease 0.45s backwards;
}
.control-btn {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-icon { font-size: 16px; }
.control-btn:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(108, 242, 194, 0.45);
  transform: translateY(-2px);
}
.control-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.control-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Analysis Section ────────────────────────────────── */
.analysis-section {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  display: none;
}
.analysis-section.show {
  display: block;
  animation: slideInUp 0.5s ease;
}
.analysis-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.analysis-badge {
  font-size: 10px;
  background: rgba(108, 242, 194, 0.15);
  border: 1px solid rgba(108, 242, 194, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
}
.towers-grid-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ── Towers Field ────────────────────────────────── */
.towers-field {
  background: linear-gradient(135deg, rgba(15, 20, 45, 0.9), rgba(20, 27, 60, 0.9));
  border: 2px solid rgba(108, 242, 194, 0.15);
  border-radius: 14px;
  padding: 20px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  justify-content: center;
  min-height: 100px;
}
.tower-block {
  flex: 1;
  height: 64px;
  background: rgba(90, 162, 255, 0.12);
  border: 2px solid rgba(90, 162, 255, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--muted);
  animation: slideInUp 0.3s ease backwards;
}
.tower-block.sequence {
  background: linear-gradient(135deg, rgba(108, 242, 194, 0.2), rgba(90, 162, 255, 0.2));
  border-color: var(--accent);
  height: 78px;
  box-shadow: 0 0 16px rgba(108, 242, 194, 0.2);
}
.tower-block.normal {
  opacity: 0.5;
}
.sequence-step {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 10px;
  background: var(--accent);
  color: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}
.block-x {
  font-size: 16px;
  color: rgba(251, 113, 133, 0.4);
}

/* ── AI Insights ────────────────────────────────── */
.ai-insights {
  background: rgba(108, 242, 194, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
}
.ai-insights strong { color: var(--accent); }
.insight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
}
.insight-row:last-of-type { border-bottom: none; }
.insight-label { color: var(--muted); font-size: 12px; }
.insight-val {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.insight-note {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
  font-style: italic;
}

/* ── Load Display ────────────────────────────────── */
.ai-load-display {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(108, 242, 194, 0.12);
  border-radius: 10px;
  padding: 14px;
}
.load-display-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  font-weight: 600;
}
.load-bars { display: flex; flex-direction: column; gap: 10px; }
.load-bar-item {}
.load-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}
.load-val-inline {
  font-family: 'Courier New', monospace;
  color: var(--accent);
  font-weight: 700;
}
.load-bar {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.load-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(108, 242, 194, 0.4);
  background: linear-gradient(90deg, #6cf2c2, #5aa2ff);
}
.load-fill.model-1_0 { background: linear-gradient(90deg, #6cf2c2, #6cf2c2aa); }
.load-fill.model-2_0 { background: linear-gradient(90deg, #5aa2ff, #6cf2c2); }
.load-fill.model-2_1 { background: linear-gradient(90deg, #fb7185, #facc15); box-shadow: 0 0 10px rgba(251,113,133,0.5); }

/* ── Demo Limit Message ────────────────────────────────── */
.demo-limit-message {
  display: none;
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.08), rgba(250, 204, 21, 0.08));
  border: 2px solid rgba(251, 113, 133, 0.25);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}
.demo-limit-message.show { display: block; animation: slideInUp 0.4s ease; }
.demo-limit-title { font-size: 16px; font-weight: 700; color: #fb7185; margin-bottom: 10px; }
.demo-limit-text { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.6; }
.upgrade-btn {
  display: inline-block;
  padding: 12px 28px;
  background: linear-gradient(135deg, #fb7185, #facc15);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.upgrade-btn:hover { box-shadow: 0 0 22px rgba(251, 113, 133, 0.4); transform: translateY(-2px); }

/* ── Animations ────────────────────────────────── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes pulse-border {
  0%, 100% { border-color: rgba(108, 242, 194, 0.4); box-shadow: none; }
  50%       { border-color: var(--accent); box-shadow: 0 0 12px rgba(108, 242, 194, 0.2); }
}
@keyframes thinking {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.thinking { animation: thinking 1s infinite; }

/* ── Quota Urgency ────────────────────────────────── */
.quota-urgent {
  border-color: rgba(239,68,68,0.4) !important;
  animation: quotaPulse 1.2s ease-in-out infinite;
}
@keyframes quotaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.2); }
}
.demo-dot.amber { background: #facc15 !important; box-shadow: 0 0 8px #facc1580 !important; }
.demo-dot.red { background: #ef4444 !important; box-shadow: 0 0 8px #ef444480 !important; animation: pulse 1s ease-in-out infinite; }

/* ── Social Proof Line ────────────────────────────────── */
.social-proof-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  margin: 8px 0;
}
.social-proof-line::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  display: inline-block;
}

/* ── Upsell Card ────────────────────────────────── */
.upsell-card {
  text-align: center;
  padding: 24px 20px;
  background: rgba(108,242,194,0.03);
  border: 1px solid rgba(108,242,194,0.12);
  border-radius: 16px;
}
.upsell-icon {
  font-size: 32px;
  margin-bottom: 10px;
}
.upsell-title {
  font-size: 18px;
  font-weight: 700;
  color: #fb7185;
  margin-bottom: 8px;
}
.upsell-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.upsell-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
  display: inline-block;
}
.upsell-features li {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
}
.upsell-features li::marker { content: ''; }
.upsell-social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}
.upsell-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e80;
  animation: blink 1.4s infinite;
  flex-shrink: 0;
}
.upsell-cta-btn {
  display: block;
  width: 100%;
  padding: 13px 28px;
  background: linear-gradient(135deg, #fb7185, #facc15);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.upsell-cta-btn:hover { box-shadow: 0 0 22px rgba(251, 113, 133, 0.4); transform: translateY(-2px); }
.upsell-back-link {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.upsell-back-link:hover { opacity: 1; }

/* ── Floating Advisor Card ────────────────────────────────── */
.floating-advisor {
  position: fixed; bottom: 20px; right: 16px;
  width: 160px;
  background: var(--card);
  border: 1px solid rgba(108,242,194,0.3);
  border-radius: 14px;
  padding: 14px 14px 12px;
  z-index: 200;
  text-align: center;
  font-size: 13px;
}
.floating-advisor-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer;
}
.floating-advisor-name { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.floating-advisor-status {
  font-size: 12px; color: #22c55e;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  margin-bottom: 10px;
}
.live-dot-sm {
  width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
  animation: pulse 1.5s ease-in-out infinite;
}
.floating-advisor-btn {
  display: block;
  background: var(--accent); color: #0b0f1a;
  border-radius: 8px; padding: 7px 12px;
  font-weight: 600; font-size: 13px;
  text-decoration: none;
}
.advisor-slide-in { animation: slideInUp 0.4s ease; }
.floating-advisor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
  border: 2px solid rgba(108,242,194,0.3);
}