@import url('/shared/tokens.css');

/* Base Reset & Variables */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography Headings */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  tracking: -0.025em;
  color: var(--fg);
}

p {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
}

/* Header & Footer Shared Style — mirrors the landing (design/) header identity */
header {
  border-bottom: 1px solid #171717;
  background-color: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo:hover { color: inherit; }

.logo-mark {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 22px;
  line-height: 1;
}
.logo-bracket { color: var(--accent); }
.logo-neuron {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #a78bfa;
  box-shadow: 0 0 10px #a78bfa;
  animation: logo-pulse 2s ease-in-out infinite;
}
@keyframes logo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.logo-wrap { display: flex; flex-direction: column; gap: 2px; }
.logo-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: #ffffff;
  line-height: 1;
}
.logo-tld { color: #a78bfa; font-weight: 300; }
.logo-sub {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6b7280;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-mono);
  color: #a3a3a3;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .nav-link[data-nav="api"], .nav-link[data-nav="pricing"] { display: none; }
  .logo-sub { display: none; }
}

footer {
  border-top: 1px solid #171717;
  background-color: rgba(10, 10, 10, 0.9);
  margin-top: auto;
  width: 100%;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.footer-desc {
  font-size: 12px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
}

.footer-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ok);
  background-color: var(--ok-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Custom Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Interactive Carousel Container */
.carousel-card-container {
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: linear-gradient(135deg, var(--accent-light) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-height: 480px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: border-color 200ms ease-out, background 200ms ease-out;
  overflow: hidden;
}

.carousel-card-container:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, var(--accent-hover-light) 0%, transparent 100%);
}

.carousel-card-container:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dots Styling & Position */
.carousel-dots {
  position: absolute;
  top: 16px;
  right: 28px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 200ms ease-out, transform 150ms ease-out, opacity 150ms ease-out;
}

.carousel-dot:hover {
  background-color: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

.carousel-dot.active {
  background-color: var(--accent);
  transform: scale(1);
  opacity: 1;
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Slide Transition Classes (using Vanilla Fade) */
.carousel-slide {
  transition: opacity 300ms ease-out;
  opacity: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.carousel-slide.fade-out {
  opacity: 0;
}

/* Example Typography */
.example-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Code Block Styling */
.code-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #ffffff;
  line-height: 1.6;
  max-height: 140px;
  min-height: 60px;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
  text-align: left;
}

.code-container:focus-visible {
  outline: 2px solid var(--accent);
}

/* Separator Line */
.separator-line {
  height: 1px;
  background: rgba(139, 92, 246, 0.15);
  margin: 16px 0;
}

/* Spans Detected Section */
.spans-section {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.spans-section.has-spans {
  background: var(--inj-light);
  border-left: 3px solid var(--inj);
}

.spans-section.safe-spans {
  background: var(--ok-light);
  border-left: 3px solid var(--ok);
}

.spans-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.spans-label.danger {
  color: var(--inj);
}

.spans-label.success {
  color: var(--ok);
}

.span-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ffffff;
  line-height: 1.6;
  word-break: break-word;
}

/* Latency Badge */
.latency-badge {
  position: absolute;
  bottom: 8px;
  right: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ok);
  display: flex;
  align-items: center;
}

.latency-badge .arrow {
  margin-right: 4px;
}

/* Main Layout of Public Pages */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

.hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 56px auto;
}

.hero-title {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(to right, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 18px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Buttons Component classes */
.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost:hover {
  color: var(--fg);
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background-color: var(--inj);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn-danger:hover {
  background-color: #dc2626;
}

/* Input Fields */
.inp {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--fg);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.15s ease;
}

.inp:focus {
  outline: none;
  border-color: var(--accent);
}

/* Grid section on landing */
.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 64px;
}

@media (min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card components */
.card {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card-h {
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 14px;
  color: var(--muted);
  flex-grow: 1;
}

/* Live Scanner UI */
.live-scanner {
  background: radial-gradient(circle at top left, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 64px;
}

.scanner-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Scanner Results Panel */
.scanner-results {
  margin-top: 24px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.scan-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scan-badge {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.scan-badge.safe {
  background-color: var(--ok-light);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.scan-badge.danger {
  background-color: var(--inj-light);
  color: var(--inj);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.scan-score {
  font-family: var(--font-mono);
  font-size: 14px;
}

.scan-reason {
  font-size: 13px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* Info Stats Section for MyIP and Landing */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.ip-display-box {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-bottom: 24px;
}

.ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

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

.ip-label {
  font-weight: 600;
  color: var(--muted);
}

.ip-val {
  font-family: var(--font-mono);
  color: #ffffff;
  font-size: 16px;
}

/* Tables style */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.tbl th {
  color: var(--muted);
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}

.tbl tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile Adjustments for < 768px */
@media (max-width: 768px) {
  /* Carousel Mobile Style */
  .carousel-card-container {
    padding: 20px;
    min-height: 400px;
  }
  
  .carousel-dots {
    top: auto;
    bottom: 16px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .example-label {
    font-size: 11px;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
  }

  .code-container {
    font-size: 12px;
    max-height: 100px;
    padding: 10px 12px;
  }

  .spans-section {
    padding: 10px 12px;
  }

  .latency-badge {
    font-size: 10px;
    bottom: 36px;
    right: 20px;
  }

  /* Structural paddings */
  main {
    padding: 24px 16px;
  }

  .hero-title {
    font-size: 30px;
  }
  
  .header-inner {
    padding: 12px 16px;
  }
}
