@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg-primary: #05050a;
  --bg-secondary: #0b0c10;
  --bg-panel: rgba(16, 20, 28, 0.65);
  --border-subtle: rgba(45, 55, 72, 0.5);
  --border-glow: rgba(0, 255, 204, 0.3);
  
  --accent-cyan: #00ffcc;
  --accent-blue: #0088ff;
  --accent-green: #00ff66;
  --accent-red: #ff3366;
  --accent-yellow: #ffcc00;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  
  --glow-cyan: 0 0 15px rgba(0, 255, 204, 0.4);
  --glow-blue: 0 0 15px rgba(0, 136, 255, 0.4);
  --glow-red: 0 0 15px rgba(255, 51, 102, 0.4);
  
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(0, 255, 204, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 136, 255, 0.05), transparent 25%);
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 20px rgba(0, 255, 204, 0.05);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

h1 {
  font-size: 3.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(5, 5, 10, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: var(--glow-cyan);
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
  color: var(--text-main);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.2) 0%, rgba(0, 255, 204, 0.2) 100%);
  border: 1px solid var(--accent-cyan);
  box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.1), var(--glow-cyan);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.4) 0%, rgba(0, 255, 204, 0.4) 100%);
  box-shadow: inset 0 0 15px rgba(0, 255, 204, 0.3), 0 0 25px rgba(0, 255, 204, 0.6);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* index.html Layout */
.landing-container {
  max-width: 1000px;
  margin: 60px auto;
  padding: 0 20px;
  text-align: center;
}

.hero-section {
  margin-bottom: 50px;
  animation: fadeInDown 1s ease-out;
}

.hero-subtext {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.input-section {
  margin-bottom: 50px;
  animation: fadeInUp 1s ease-out 0.2s both;
  position: relative;
}

.input-box {
  width: 100%;
  height: 200px;
  background: rgba(10, 12, 16, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-main);
  resize: vertical;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.input-box:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.1);
}

.input-box::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.feature-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 60px;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.badge {
  background: rgba(0, 255, 204, 0.05);
  border: 1px solid rgba(0, 255, 204, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.badge:hover {
  background: rgba(0, 255, 204, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

.footer-text {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* analysis.html Layout */
.dashboard-container {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  animation: fadeIn 0.8s ease-out;
}

/* Top Section (Risk Score & Summary) */
.overview-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 30px;
}

.risk-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.circular-score {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: conic-gradient(var(--accent-red) 85%, rgba(255, 51, 102, 0.1) 0);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8), var(--glow-red);
}

.circular-score::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  background: var(--bg-secondary);
  border-radius: 50%;
}

.score-value {
  position: relative;
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-red);
  text-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
  font-family: var(--font-mono);
}

.score-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.verdict {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-red);
}

.summary-card h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-main);
}

.summary-text {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 25px;
  line-height: 1.8;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag {
  background: rgba(255, 51, 102, 0.1);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--accent-red);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Three Column Grid for Details */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Threat Vectors */
.vector-item {
  margin-bottom: 20px;
}

.vector-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
}

.vector-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.vector-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
}

.fill-red { background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.fill-yellow { background: var(--accent-yellow); box-shadow: 0 0 10px var(--accent-yellow); }
.fill-green { background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green); }

/* AI Insights */
.insight-row {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.insight-row:last-child {
  border-bottom: none;
}

.insight-label {
  color: var(--text-muted);
}

.insight-value {
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* Forensic Findings */
.findings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.finding-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-cyan);
}

.finding-card.high-risk {
  border-left-color: var(--accent-red);
}

.finding-title {
  font-weight: 700;
  margin-bottom: 5px;
}

.finding-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Simulation Section */
.simulation-section {
  grid-column: 1 / -1;
}

.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: 30px;
  padding: 0 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 150px;
  text-align: center;
}

.step-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
  font-family: var(--font-mono);
  font-weight: bold;
}

.step-active .step-icon {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: var(--glow-blue);
}

.step-danger .step-icon {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.step-danger.step-active .step-icon {
  background: var(--accent-red);
  color: #fff;
  box-shadow: var(--glow-red);
}

.step-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Title */
.section-title {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 24px;
  background: var(--accent-cyan);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

.section-title.danger::before {
  background: var(--accent-red);
  box-shadow: 0 0 8px rgba(255, 51, 102, 0.5);
}

/* Hackathon Upgrades CSS */

/* 1. Scanning Overlay */
.scanning-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.scanning-overlay.hidden { display: none; }
.scanning-content {
  width: 80%;
  max-width: 600px;
}
.scanning-title {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-bottom: 30px;
  text-shadow: var(--glow-cyan);
}
.scan-step {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeInLeft 0.3s forwards;
}
.scan-step.complete { color: var(--text-main); }
.loader-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  margin-top: 30px;
  position: relative;
  overflow: hidden;
}
.loader-fill {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: var(--accent-cyan);
  width: 0%;
  box-shadow: var(--glow-cyan);
  transition: width 0.6s linear;
}

/* 2. Animations */
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseRed {
  0% { box-shadow: inset 0 0 20px rgba(0,0,0,0.8), var(--glow-red); }
  50% { box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 30px rgba(255,51,102,0.8); }
  100% { box-shadow: inset 0 0 20px rgba(0,0,0,0.8), var(--glow-red); }
}

/* 5. JSON Modal */
.json-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5,5,10,0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
.json-modal.hidden { display: none; }
.json-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  padding: 30px;
  position: relative;
  overflow-y: auto;
  box-shadow: var(--glow-cyan);
}
.close-btn { position: absolute; top: 20px; right: 20px; }
#rawJsonOutput {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  white-space: pre-wrap;
  font-size: 0.9rem;
}

/* Extension Install Modal */
.install-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 10, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.install-modal.hidden {
  display: none;
}

.install-modal-content {
  width: 100%;
  max-width: 760px;
  position: relative;
}

.install-close-btn {
  position: absolute;
  right: 0;
  top: -55px;
}

.install-intro {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.install-steps-list {
  padding-left: 20px;
  color: var(--text-main);
  margin-bottom: 18px;
}

.install-steps-list li {
  margin-bottom: 10px;
}

.install-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.install-note {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 6. History Cards */
.history-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
}
.history-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}
.history-card {
  background: rgba(16, 20, 28, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.history-card:hover {
  background: rgba(0, 255, 204, 0.05);
  border-color: var(--accent-cyan);
}
.history-card-left { display: flex; flex-direction: column; text-align: left; gap: 5px; }
.history-card-right { display: flex; align-items: center; gap: 15px; }
.history-input { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.85rem; }

/* 7. Share Toast */
.share-toast {
  position: fixed;
  bottom: 30px; right: 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: var(--glow-cyan);
  z-index: 10000;
  animation: fadeInUp 0.3s forwards;
  font-weight: bold;
}
.share-toast.hidden { display: none; }

/* 4. Print Media */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .app-header .btn, .app-header .header-buttons { display: none !important; }
  .glass-panel { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; color: #000 !important; text-shadow: none !important; }
  h1, h2, h3, .score-value, .verdict, .insight-value, .step-title, .tag { color: #000 !important; text-shadow: none !important; border-color: #999 !important; }
  .vector-bar-bg { background: #eee !important; }
  .vector-bar-fill { background: #333 !important; box-shadow: none !important; }
  .circular-score { background: #eee !important; box-shadow: none !important; border: 2px solid #000 !important; }
  .circular-score::before { background: #fff !important; }
  #advanced-forensics-grid { page-break-inside: avoid; }
}

/* Responsive */
@media (max-width: 1024px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .circular-score { width: 140px; height: 140px; }
  .circular-score::before { width: 120px; height: 120px; }
  .score-value { font-size: 3rem; }
  .glass-panel { padding: 16px; }
  .app-header { flex-direction: column; gap: 15px; }
  .header-buttons { flex-direction: column; width: 100%; gap: 10px; display: flex !important; }
  .btn { width: 100%; }
  
  .timeline {
    flex-direction: column;
    gap: 30px;
  }
  .timeline::before {
    top: 0;
    bottom: 0;
    left: 40px;
    height: auto;
    width: 2px;
  }
  .timeline-step {
    flex-direction: row;
    width: 100%;
    text-align: left;
    gap: 20px;
  }
}
