/* ─────────────────────────────────────────────────────────────────
   SE Theme — Homepage: Hero · Courses · Trending · Tools · LB
   ───────────────────────────────────────────────────────────────── */

/* ── Hero section ────────────────────────────────────────────── */
.se-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: var(--s9) 0 var(--s8);
}

/* Animated grid background */
.se-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,231,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,231,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: se-grid-scroll 24s linear infinite;
  z-index: var(--z-below);
}
/* Radial gradient overlay to fade grid at edges */
.se-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, transparent 20%, var(--bg) 80%);
  z-index: 0;
}
@keyframes se-grid-scroll {
  0%   { background-position: 0 0; }
  100% { background-position: 44px 44px; }
}

/* Two-column grid: copy left, terminal right */
.se-hero-grid {
  position: relative;
  z-index: var(--z-base);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.se-hero-content {
  position: relative;
  z-index: var(--z-base);
}

.se-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: 3px;
  color: var(--clr-neon);
  text-transform: uppercase;
  margin-bottom: var(--s4);
  animation: se-fade-in .6s ease both;
}
.se-hero-eyebrow::before { content: '>'; color: var(--text-dim); }

.se-hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.05;
  color: var(--text-bright);
  margin-bottom: var(--s4);
  animation: se-fade-in .6s .1s ease both;
}
.se-hero-title .accent {
  color: var(--clr-neon);
  text-shadow: 0 0 30px rgba(0,255,231,.4);
  display: block;
}

.se-hero-sub {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: var(--s6);
  animation: se-fade-in .6s .2s ease both;
}

.se-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  animation: se-fade-in .6s .3s ease both;
}
.se-hero-actions .se-btn {
  padding: var(--s3) var(--s6);
  font-size: .9rem;
}

/* Hero stats strip */
.se-hero-stats {
  display: flex;
  align-items: center;
  gap: var(--s6);
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  animation: se-fade-in .6s .4s ease both;
}
.se-hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--clr-neon);
  display: block;
  line-height: 1;
}
.se-hero-stat-label {
  font-family: var(--font-ui);
  font-size: .7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Kali Terminal Animation ──────────────────────────────────── */
.se-hero-terminal {
  position: relative;
  z-index: var(--z-base);
  animation: se-fade-in .8s .5s ease both;
  display: flex;
  justify-content: center;
}

.se-term-window {
  width: 100%;
  max-width: 560px;
  background: #0d0d14;
  border: 1px solid rgba(0,255,231,.2);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(0,255,231,.06),
    0 24px 60px rgba(0,0,0,.7),
    0 0 40px rgba(0,255,231,.06);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .82rem;
}

/* Title bar */
.se-term-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #181825;
  border-bottom: 1px solid rgba(0,255,231,.1);
  user-select: none;
}
.se-term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.se-term-dot--red    { background: #ff5f57; }
.se-term-dot--yellow { background: #febc2e; }
.se-term-dot--green  { background: #28c840; }
.se-term-title {
  margin-left: 8px;
  font-size: .72rem;
  letter-spacing: 1px;
  color: rgba(255,255,255,.35);
  font-family: var(--font-mono);
}

/* Terminal body */
.se-term-body {
  padding: 14px 16px 16px;
  min-height: 320px;
  max-height: 380px;
  overflow: hidden;
  line-height: 1.65;
  color: #c9d1d9;
}

/* Lines */
.se-term-line {
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.4em;
}

/* Prompt colours */
.se-term-prompt { color: #ff5f57; font-weight: 700; }
.se-term-sep    { color: rgba(255,255,255,.3); }
.se-term-dir    { color: #0affed; }
.se-term-dollar { color: rgba(255,255,255,.5); margin: 0 4px; }
.se-term-cmd    { color: #e6edf3; }

/* Cursor blink */
.se-term-cursor {
  display: inline-block;
  color: #0affed;
  animation: se-blink .9s step-start infinite;
  font-size: .9em;
  vertical-align: middle;
}
@keyframes se-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Output highlight classes */
.se-term-ok   { color: #0affed; }
.se-term-warn { color: #febc2e; }
.se-term-dim  { color: rgba(255,255,255,.35); }

/* Scanline overlay for CRT feel */
.se-term-window::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.04) 2px,
    rgba(0,0,0,.04) 4px
  );
  pointer-events: none;
  z-index: 10;
  border-radius: inherit;
}

/* ── Hero responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .se-hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .se-hero-terminal {
    order: 2; /* terminal below text on tablet */
  }
  .se-term-window { max-width: 100%; }
  .se-term-body { min-height: 200px; max-height: 240px; }
}
@media (max-width: 640px) {
  .se-hero-stats { gap: var(--s4); }
  .se-hero-terminal { display: none; }
}

/* Hero floating rank widget (kept for backward compat) */
.se-hero-rank-float {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-base);
  animation: se-slide-in-right .8s .5s ease both;
}
.se-hero-rank-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  backdrop-filter: blur(20px);
  width: 260px;
  box-shadow: var(--shadow-card), var(--glow-neon);
}
.se-hero-rank-card-title {
  font-family: var(--font-ui);
  font-size: .65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s4);
}

/* ── Course tracks section ───────────────────────────────────── */
.se-courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s4);
}

.se-course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-mid), transform var(--t-mid), box-shadow var(--t-mid);
}
.se-course-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--course-color, var(--clr-neon));
  box-shadow: 0 0 12px var(--course-color, var(--clr-neon));
  opacity: 0;
  transition: opacity var(--t-mid);
}
.se-course-card:hover {
  border-color: var(--course-color, var(--border-hover));
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.7), 0 0 0 1px var(--course-color, var(--border-hover));
}
.se-course-card:hover::before { opacity: 1; }

.se-course-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.se-course-tag {
  font-family: var(--font-ui);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--course-color, var(--clr-neon));
}
.se-course-name {
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--text-bright);
  line-height: 1.3;
  margin: 0;
}
.se-course-desc {
  font-size: .8rem;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}
.se-course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: .7rem;
  color: var(--text-dim);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
}
.se-course-meta-badge {
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 2px 8px;
}

/* Course color themes */
.se-course-card[data-course="kali"]    { --course-color: #00ffe7; }
.se-course-card[data-course="bugbounty"] { --course-color: #ff44cc; }
.se-course-card[data-course="ethical"] { --course-color: #ff8c00; }
.se-course-card[data-course="dvwa"]    { --course-color: #00ff88; }

/* ── Trending/Latest articles ─────────────────────────────────── */
.se-trending-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
}

/* ── Tools section ───────────────────────────────────────────── */
.se-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}
.se-tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s4);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--s3);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.se-tool-card:hover {
  border-color: var(--border-hover);
  background: var(--bg3);
}
.se-tool-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.se-tool-name {
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-bright);
}
.se-tool-desc {
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: 1px;
}

/* ── Leaderboard preview widget ─────────────────────────────── */
.se-lb-preview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.se-lb-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--border);
}
.se-lb-preview-title {
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--clr-neon);
}
.se-lb-preview-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background var(--t-fast);
}
.se-lb-preview-row:hover { background: var(--bg3); }
.se-lb-preview-row:last-child { border-bottom: none; }
.se-lb-rank {
  font-family: var(--font-mono);
  font-size: .7rem;
  min-width: 24px;
  text-align: center;
  color: var(--text-dim);
}
.se-lb-rank-1 { color: #ffd700; }
.se-lb-rank-2 { color: #c0c0c0; }
.se-lb-rank-3 { color: #cd7f32; }
.se-lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.se-lb-name {
  flex: 1;
  font-size: .85rem;
  color: var(--text-bright);
  font-family: var(--font-ui);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-lb-xp {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--clr-neon);
  flex-shrink: 0;
}
.se-lb-rank-badge {
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: .5px;
  flex-shrink: 0;
}

/* CTA band */
.se-cta-band {
  background: linear-gradient(135deg, rgba(0,255,231,.06), rgba(123,47,255,.06));
  border-top: 1px solid rgba(0,255,231,.1);
  border-bottom: 1px solid rgba(0,255,231,.1);
  padding: var(--s8) 0;
  text-align: center;
}
.se-cta-band h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: var(--s3);
}
.se-cta-band p {
  color: var(--text-dim);
  margin-bottom: var(--s5);
  font-size: 1rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Leaderboard section layout ─────────────────────────────────────────── */
.se-lb-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--s7);
  align-items: start;
}
@media (max-width: 1023px) {
  .se-lb-layout {
    grid-template-columns: 1fr;
  }
}
