/* ============================================================
   Main Stylesheet - Network Security & Privacy Protection Tool Site
   Architecture: BEM-inspired, utility-first approach
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: var(--space-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text);
  text-decoration: underline;
}

code, pre {
  font-family: var(--font-mono);
  background: var(--code-bg);
  border-radius: var(--radius-sm);
}

code {
  padding: 2px 6px;
  font-size: var(--font-size-sm);
  color: var(--accent);
}

pre {
  padding: var(--space-lg);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
}

pre code {
  background: none;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-3xl);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: var(--space-md) auto 0;
  border-radius: var(--radius-full);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   Header / Navigation
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header__logo {
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.header__nav-link {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--accent);
  text-decoration: none;
}

.header__nav-link--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.header__search {
  position: relative;
}

.header__search-input {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 36px;
  color: var(--text);
  font-size: var(--font-size-sm);
  width: 200px;
  transition: all var(--transition-base);
}

.header__search-input:focus {
  outline: none;
  border-color: var(--accent);
  width: 280px;
  box-shadow: var(--shadow-glow);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================================
   Hero Section - Security Terminal
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg) 70%);
}

.hero__content {
  text-align: center;
  max-width: 800px;
  padding: var(--space-2xl);
}

.hero__title {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-lg);
  color: var(--accent);
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
  line-height: 1.8;
}

/* Terminal Input */
.terminal {
  background: var(--code-bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: left;
  box-shadow: var(--shadow-glow);
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot--red { background: var(--danger); }
.terminal__dot--yellow { background: var(--warning); }
.terminal__dot--green { background: var(--accent); }

.terminal__title {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-left: var(--space-sm);
  margin-bottom: 0;
}

.terminal__input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.terminal__prompt {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.terminal__input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  outline: none;
}

.terminal__input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.terminal__cursor {
  width: 8px;
  height: 18px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

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

.btn--primary:hover {
  background: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--bg);
}

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

.btn--secondary:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--large {
  padding: 16px 32px;
  font-size: var(--font-size-base);
}

/* ============================================================
   Tool Cards Grid
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.tool-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
}

.tool-card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.tool-card__desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.tool-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

/* ============================================================
   Security Scan Progress Bar
   ============================================================ */
.scan-progress {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}

.scan-progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.scan-progress__label {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--accent);
}

.scan-progress__percentage {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text);
}

.scan-progress__bar {
  height: 8px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.scan-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.5s ease;
  position: relative;
}

.scan-progress__fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
  animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
  0% { transform: translateX(0); }
  100% { transform: translateX(20px); }
}

.scan-progress__status {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  margin-top: var(--space-sm);
}

/* ============================================================
   Vulnerability Report Card
   ============================================================ */
.vuln-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
}

.vuln-card__severity {
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.vuln-card__severity--critical { background: var(--danger); color: #fff; }
.vuln-card__severity--high { background: var(--warning); color: #000; }
.vuln-card__severity--medium { background: #FFC107; color: #000; }
.vuln-card__severity--low { background: var(--accent); color: #000; }

.vuln-card__body {
  padding: var(--space-xl);
}

.vuln-card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.vuln-card__meta {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ============================================================
   Metrics / Statistics
   ============================================================ */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

.metric-card {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.metric-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.metric-card__number {
  font-family: var(--font-mono);
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.metric-card__label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ============================================================
   Code Block Component
   ============================================================ */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.code-block__lang {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

.code-block__copy {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-block__copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.code-block__content {
  padding: var(--space-lg);
  overflow-x: auto;
}

/* ============================================================
   Trust & Compliance Banner
   ============================================================ */
.trust-banner {
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid var(--info);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.trust-banner__icon {
  font-size: 2rem;
  color: var(--info);
  flex-shrink: 0;
}

.trust-banner__text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.8;
}

/* ============================================================
   Threat Intelligence Panel
   ============================================================ */
.threat-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.threat-panel__map {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 300px;
  background: var(--bg);
}

.threat-panel__feed {
  max-height: 400px;
  overflow-y: auto;
}

.threat-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.threat-item:hover {
  background: var(--bg-elevated);
}

.threat-item__badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.threat-item__badge--critical { background: var(--danger); }
.threat-item__badge--high { background: var(--warning); }
.threat-item__badge--medium { background: #FFC107; }

.threat-item__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.threat-item__time {
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--code-bg);
  border-top: 1px solid var(--border-color);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.footer__desc {
  font-size: var(--font-size-sm);
  color: var(--text-dim);
  line-height: 1.8;
}

.footer__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer__links {
  list-style: none;
}

.footer__links li {
  margin-bottom: var(--space-sm);
}

.footer__links a {
  font-size: var(--font-size-sm);
  color: var(--text-dim);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer__bottom {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-xs);
  color: var(--text-dim);
}

.footer__pgp {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  background: var(--bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-top: var(--space-md);
  word-break: break-all;
}

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: var(--text-dim);
  margin-top: var(--header-height);
}

.breadcrumb a {
  color: var(--text-dim);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb__separator {
  color: var(--border-color);
}

/* ============================================================
   Sidebar
   ============================================================ */
.page-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
  padding-top: var(--space-2xl);
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-xl));
  height: fit-content;
}

.sidebar__widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.sidebar__widget-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--accent);
}

/* ============================================================
   Article Styles
   ============================================================ */
.article {
  max-width: 800px;
}

.article__header {
  margin-bottom: var(--space-2xl);
}

.article__title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

.article__meta {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-dim);
}

.article__content {
  font-size: var(--font-size-base);
  line-height: 2;
}

.article__content h2 {
  margin-top: var(--space-2xl);
}

.article__content h3 {
  margin-top: var(--space-xl);
}

/* ============================================================
   Download Page
   ============================================================ */
.download-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
}

.download-card__platform {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-dim);
  margin-bottom: var(--space-md);
}

.download-card__hash {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  background: var(--bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-top: var(--space-md);
  word-break: break-all;
}

/* ============================================================
   404 Page
   ============================================================ */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.error-page__terminal {
  max-width: 600px;
  width: 100%;
}

.error-page__code {
  font-family: var(--font-mono);
  font-size: var(--font-size-5xl);
  color: var(--danger);
  margin-bottom: var(--space-md);
}

.error-page__message {
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* ============================================================
   Radar Chart Container
   ============================================================ */
.radar-container {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-xl);
}

/* ============================================================
   Tags / Badges
   ============================================================ */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.tag--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text);
}

/* ============================================================
   Form Elements
   ============================================================ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--bg-elevated) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mt-3 { margin-top: var(--space-2xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.mb-3 { margin-bottom: var(--space-2xl); }
.hidden { display: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
