/* public/styles.css v77 - RESTORED TTP HALO & ADJUSTED QUOTES */

:root {
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Big Shoulders Display", system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", monospace;

  --text: #e7ecf2;
  --muted: #9fb1c6;
  --bg-1: #16161D;
  --bg-2: #12121A;
  --bg-3: #0B0B10;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border-color: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html { color-scheme: dark; height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 700px at 50% -200px, var(--bg-1), var(--bg-2) 40%, var(--bg-3));
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   LAYOUT & STICKY FOOTER HELPERS
   ========================================= */
.container {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

.upload-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* =========================================
   1. HERO SECTION
   ========================================= */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column; 
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  width: 100%;
}

.hero-stack {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 920px;
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 6vw, 5.5rem); 
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #fff;
}

.tagline {
  color: var(--muted);
  margin: 0 .5rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  white-space: nowrap;
}

/* Mobile: allow tagline to wrap */
@media (max-width: 768px) {
  .tagline {
    white-space: normal;
    font-size: 0.9rem;
    padding: 0 1rem;
  }
}

.fun-fact-line {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.75rem; 
  font-style: italic; 
  text-align: center;
  margin-top: 8rem;     
  margin-bottom: 0;
  min-height: 1.6em;
  transition: opacity 0.5s ease-in-out;
  opacity: 0.75;
  max-width: 600px;
}

.tagline-gradient {
  background: linear-gradient(90deg, #5cc2ff, #a16eff, #ff6bd6, #ffb86b, #65f3a6, #5cc2ff);
  background-size: 200% auto;
  color: #000;
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: ttfGradient 5s linear infinite;
}
@keyframes ttfGradient { to { background-position: 200% center; } }

/* =========================================
   2. BUTTONS & UTILS
   ========================================= */
.btn {
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 9999px;
  padding: 10px 24px; font-weight: 500; cursor: pointer; font-family: var(--font-sans);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 0.95rem; box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}
.btn:hover { 
  background: #f8f9fa; 
  box-shadow: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  transform: translateY(-1px);
}
.btn[disabled], .is-disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

.btn-ghost {
    background: transparent !important; border: 1px solid rgba(255, 255, 255, 0.6) !important;
    color: white !important; transition: all 0.2s ease;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1) !important; transform: translateY(-1px); }

.panel {
  background: #1A1A23; border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

.tag { font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); }
.hidden { display: none !important; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.cta-row { display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; }

/* =========================================
   3. RAINBOW HALO & GOOGLE BUTTON
   ========================================= */
.drop-zone {
  border: 1px dashed rgba(255,255,255,.32); border-radius: 16px; padding: 40px 20px;
  text-align: center; color: var(--muted); font-size: .95rem; transition: all 0.2s;
  background: rgba(255,255,255,0.02); cursor: pointer; margin-bottom: 2rem;
}
.drop-zone:hover, .drop-zone.highlight { border-color: var(--accent); background: rgba(59, 130, 246, 0.1); }

@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.rainbow-pill { border-radius: 9999px; }
.rainbow-ultratight > * { margin: -1px; clip-path: inset(2px round 9999px); }

.rainbow-halo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 9999px;
  background: transparent;
}
.rainbow-halo::before, .rainbow-halo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--a), #5cc2ff, #a16eff, #ff6bd6, #ffb86b, #65f3a6, #5cc2ff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: ttfSpin 2s linear infinite;
}
.rainbow-halo::before { filter: blur(4px); opacity: .85; }
@keyframes ttfSpin { to { --a: 360deg; } }

/* GOOGLE BUTTON CLEANUP */
#gsi-btn, .g_id_signin, .gsi-host-clean, #gsi-btn iframe {
    display: inline-block;
    background: transparent !important;
    border-radius: 9999px !important;
    box-shadow: none !important;
    vertical-align: middle;
}
#gsi-btn > div {
    background: transparent !important;
    border-radius: 9999px !important;
    box-shadow: none !important;
}

/* =========================================
   4. UI COMPONENTS (Tabs, Cards, Chat)
   ========================================= */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; padding-bottom: 10px; }
.tab-btn {
    background: transparent; border: none; color: #94a3b8; font-family: var(--font-sans);
    font-size: 1rem; font-weight: 600; cursor: pointer; padding: 8px 12px;
    border-radius: 6px; transition: all 0.2s;
}
.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.tab-btn.active { color: #60a5fa; background: rgba(59, 130, 246, 0.1); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.items-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 20px; }

.ttp-card {
  background: var(--bg-2); border: 1px solid var(--border-color); border-radius: 12px;
  overflow: visible; display: flex; flex-direction: column; position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ttp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); border-color: rgba(59, 130, 246, 0.3); z-index: 20; }

.ttp-header {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
  background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border-color); border-radius: 12px 12px 0 0;
}
.ttp-title-row { display: flex; align-items: center; gap: 10px; flex: 1; }

/* --- RESTORED: Rainbow Halo for TTP ID --- */
.ttp-id-badge {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: #fff;
  text-decoration: none; padding: 4px 12px; border-radius: 999px; background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1); display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; overflow: visible;
}
.ttp-id-badge::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--angle), #5cc2ff, #a16eff, #ff6bd6, #ffb86b, #65f3a6, #5cc2ff);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  animation: spinHalo 3s linear infinite;
}
@keyframes spinHalo { to { --angle: 360deg; } }

.ttp-name { font-weight: 600; font-size: 1rem; color: #fff; margin: 0; }
.ttp-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ttp-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.evidence-box { background: rgba(0,0,0,0.3); border-radius: 6px; padding: 10px; border: 1px solid var(--border-color); font-family: var(--font-mono); font-size: 0.75rem; max-height: 120px; overflow-y: auto; white-space: pre-wrap; color: #cbd5e1; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font-size: 0.75rem; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid transparent; transition: all 0.2s; }
.chip:hover { border-color: var(--accent); background: rgba(59, 130, 246, 0.15); color: #fff; cursor: pointer; }
.chip.actor { border-left: 2px solid #a78bfa; }
.chip.atomic { border-left: 2px solid #ef4444; }
.chip.defense { border-left: 2px solid #34d399; }
.chip.target { border-left: 2px solid #06b6d4; }

/* Metrics & Kill Chain */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-panel { background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.metric-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fff; line-height: 1; }
.metric-lbl { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }

.kc-container { margin-top: 24px; padding: 20px; background: rgba(0, 0, 0, 0.2); border-radius: 12px; border: 1px solid var(--border-color); overflow-x: auto; }
.kc-track { display: flex; gap: 4px; min-width: max-content; padding-bottom: 10px; }
.kc-step { position: relative; height: 60px; min-width: 160px; padding: 0 10px 0 25px; display: flex; flex-direction: column; justify-content: center; background: rgba(255, 255, 255, 0.05); clip-path: polygon(0% 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 0% 100%, 15px 50%); }
.kc-step:first-child { padding-left: 15px; clip-path: polygon(0% 0%, calc(100% - 15px) 0%, 100% 50%, calc(100% - 15px) 100%, 0% 100%); }
.kc-heat-0 { background: rgba(30, 41, 59, 0.6); color: #64748b; }
.kc-heat-1 { background: linear-gradient(90deg, #1e3a8a, #172554); color: #bfdbfe; }
.kc-heat-2 { background: linear-gradient(90deg, #2563eb, #1e40af); color: #fff; }
.kc-heat-3 { background: linear-gradient(90deg, #60a5fa, #3b82f6); color: #fff; box-shadow: 0 0 10px #3b82f6; }
.kc-label { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; text-transform: uppercase; }
.kc-count { font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.8; }

/* Vulnerabilities Grid */
.vuln-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 24px; }
.vuln-card { background: #1A1A23; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }

/* Context Panels (LOLBAS, AD CS) */
.context-panel { border-radius: 8px; padding: 12px; margin-bottom: 16px; }

/* Code blocks for detection rules */
.code-block { background: #0B0B10; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px; font-family: var(--font-mono); font-size: 0.75rem; color: #bfe2ff; overflow-x: auto; white-space: pre-wrap; }

/* Chat Styles */
.embedded-chat-container { display: flex; flex-direction: column; height: 500px; background: rgba(0,0,0,0.2); border-radius: 12px; border: 1px solid var(--border-color); overflow: hidden; }
.embedded-chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.message { max-width: 80%; padding: 12px 16px; border-radius: 12px; font-size: 0.95rem; line-height: 1.5; }
.message.bot { align-self: flex-start; background: #1e293b; color: #e2e8f0; border: 1px solid rgba(255,255,255,0.1); }
.message.user { align-self: flex-end; background: #2563eb; color: white; }
.embedded-chat-input { padding: 15px; background: rgba(0,0,0,0.3); border-top: 1px solid var(--border-color); display: flex; gap: 10px; }
#chat-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 10px 14px; color: white; font-family: var(--font-sans); }
#chat-input:focus { outline: none; border-color: var(--accent); }

footer { margin-top: 4rem; padding: 2rem; text-align: center; color: var(--muted); font-size: 0.8rem; font-family: var(--font-display); font-weight: 600; text-transform: uppercase; }
footer a { color: inherit; text-decoration: none; }

/* === PHASE 3: FLOATING CHAT WIDGET === */
.chat-widget-toggle {
  position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
  border-radius: 50%; background: rgba(10, 10, 10, 0.9); border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer; z-index: 1000; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.chat-widget-toggle:hover { transform: scale(1.1); }
.chat-widget-toggle::before {
  content: ""; position: absolute; inset: -3px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--a), #5cc2ff, #a16eff, #ff6bd6, #ffb86b, #65f3a6, #5cc2ff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  animation: ttfSpin 3s linear infinite; opacity: 0.8;
}
.chat-icon { width: 28px; height: 28px; fill: white; pointer-events: none; }

.chat-window {
  position: fixed; bottom: 100px; right: 30px; width: 400px; height: 600px; max-height: calc(100vh - 120px);
  background: rgba(11, 26, 43, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 1000; display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none;
  transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-window.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.chat-header { padding: 16px 20px; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; align-items: center; }
.chat-title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.02em; color: white; margin: 0; }
.chat-close { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 1.5rem; line-height: 1; }

.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; line-height: 1.5; position: relative; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: rgba(255, 255, 255, 0.08); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.05); border-bottom-left-radius: 4px; }

.sources-list { margin-top: 8px; font-size: 0.75rem; color: var(--muted); border-top: 1px solid rgba(255,255,255,0.1); padding-top: 6px; }
.source-item { display: inline-block; background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; margin-right: 4px; margin-bottom: 4px; font-family: var(--font-mono); }

.chat-input-area { padding: 16px; background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; gap: 10px; }
.chat-input { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 99px; padding: 10px 16px; color: white; font-family: var(--font-sans); outline: none; transition: border-color 0.2s; }
.chat-input:focus { border-color: var(--accent); }
.chat-send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.1s; }
.chat-send:active { transform: scale(0.95); }
.chat-send:disabled { filter: grayscale(1); opacity: 0.5; }

.typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
.dot { width: 6px; height: 6px; background: #9fb1c6; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* =========================================================
   Sticky footer + "no scroll just to see footer" fix
   ========================================================= */

/* The fun fact spacing is huge on short screens; make it responsive */
.fun-fact-line{
  margin-top: clamp(2rem, 10vh, 8rem) !important;
}

/* Make footer behave like a sticky footer in flex layouts */
footer{
  margin-top: auto !important;              /* key change */
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom)) !important;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem !important;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;

  /* Make it compact so it fits without pushing the page taller */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;

  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.12);
  backdrop-filter: blur(8px);
}

footer p{
  margin: 0 !important;
}
