/* ===== CSS Variables ===== */
:root {
  --bg-dark: #0f151f;
  --bg-card: #0d1117;
  --bg-section: #1a1f2e;
  --accent: #00e5ff;
  --accent-dark: #0b4350;
  --accent-glow: rgba(0, 229, 255, 0.3);
  --text-primary: #e2e8f0;
  --text-muted: #9ca3af;
  --border: #1e293b;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto Mono', monospace;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ===== Matrix Canvas ===== */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.25;
  pointer-events: none;
}

/* ===== Navbar ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding: 16px 0;
  transition: background 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
  background: rgba(15, 21, 31, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

.nav-logo span {
  color: var(--accent);
}

#nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

#nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

#nav-links a:hover,
#nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

/* Hamburger */
#hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 60;
}

#hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}

#hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger.open span:nth-child(2) { opacity: 0; }
#hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Sections ===== */
section {
  position: relative;
  z-index: 1;
  padding: 100px 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-line {
  width: 64px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto;
}

/* ===== Hero ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
}

.hero-content {
  max-width: 800px;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-content h1 .accent {
  color: var(--accent);
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 8px var(--accent-glow); }
  to { text-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(0, 229, 255, 0.15); }
}

.hero-content p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  background: var(--accent);
  color: var(--bg-dark);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}

.btn-primary:hover {
  background: #67e8f9;
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--accent-glow);
  text-decoration: none;
}

.scroll-arrow {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  color: var(--accent);
  font-size: 1.5rem;
  opacity: 0.6;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== Stats Section ===== */
#stats {
  background: rgba(15, 21, 31, 0.75);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
}

.stat-box .stat-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-box .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== Tags Grid ===== */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tag-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-dark);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.25s;
}

.tag-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.1);
}

.tag-card .tag-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.tag-card .tag-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: capitalize;
}

/* ===== Features Section ===== */
#features {
  background: rgba(26, 31, 46, 0.7);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
}

.feature-icon.teal { background: rgba(0, 229, 255, 0.15); }
.feature-icon.green { background: rgba(34, 197, 94, 0.15); }
.feature-icon.purple { background: rgba(168, 85, 247, 0.15); }

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Sponsor Section ===== */
#sponsor {
  background: rgba(15, 21, 31, 0.65);
  text-align: center;
}

.sponsor-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto 32px;
}

.sponsor-btn {
  display: inline-block;
  padding: 18px 48px;
  background: var(--accent);
  color: var(--bg-dark);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  box-shadow: 0 0 24px var(--accent-glow);
}

.sponsor-btn:hover {
  background: #67e8f9;
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(0, 229, 255, 0.5);
  text-decoration: none;
}

.sponsor-heart {
  margin-right: 8px;
}

.sponsor-link-text {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Footer ===== */
footer {
  position: relative;
  z-index: 1;
  background: rgba(13, 17, 23, 0.95);
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* ===== Explorer Page ===== */
#explorer-section {
  padding-top: 100px;
  min-height: 100vh;
  background: rgba(15, 21, 31, 0.65);
}

.search-bar {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 20px;
}

.search-bar:focus {
  border-color: var(--accent);
}

.search-bar::placeholder {
  color: var(--text-muted);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-row-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  width: 100%;
}

.filter-pill {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--accent-dark);
  border-radius: 9999px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
  font-weight: 600;
}

.clear-filters {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid #ef4444;
  border-radius: 9999px;
  color: #ef4444;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-filters:hover {
  background: rgba(239, 68, 68, 0.15);
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 16px 0;
}

.results-count span {
  color: var(--accent);
  font-weight: 700;
}

/* Tool Accordion List */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.tool-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s;
}

.tool-item:hover {
  border-color: var(--accent-dark);
}

.tool-item.open {
  border-color: var(--accent-dark);
}

.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  gap: 16px;
}

.tool-header-left {
  flex: 1;
  min-width: 0;
}

.tool-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tool-short-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-chevron {
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 4px;
}

.tool-item.open .tool-chevron {
  transform: rotate(90deg);
}

/* Expandable body */
.tool-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  border-top: 0 solid var(--border);
}

.tool-item.open .tool-body {
  max-height: 1500px;
  border-top-width: 1px;
}

.tool-long-desc {
  padding: 20px 24px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tool-section {
  padding: 16px 24px 0;
}

.tool-section:last-child {
  padding-bottom: 20px;
}

.tool-section h4 {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 600;
}

/* Code block with copy button */
.code-block {
  position: relative;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 48px 12px 16px;
  margin-bottom: 4px;
}

.code-block code {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  opacity: 0.6;
}

.copy-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-recon {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-exploitation {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-post {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-tag {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  border: 1px solid var(--accent-dark);
}

.badge-os {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* (modal removed — using inline accordion instead) */

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Scroll-to-Top ===== */
#scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Loading Spinner ===== */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .tags-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #hamburger { display: flex; }

  #nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(15, 21, 31, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
  }

  #nav-links.open { display: flex; }

  section { padding: 64px 16px; }

  .hero-content h1 { font-size: 2rem; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .tags-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }

  .tool-header { padding: 16px; }
  .tool-long-desc { padding: 16px 16px 0; }
  .tool-section { padding: 12px 16px 0; }

  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tags-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Admin Page ===== */
#admin-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
}

.admin-login-wrapper {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.admin-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

#clerk-sign-in {
  display: flex;
  justify-content: center;
}

.admin-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 32px;
}

.admin-user-bar span {
  color: var(--accent);
  font-weight: 600;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 8px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

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