/* ==========================================================================
   CTF CHALLENGES & WALKTHROUGHS - MODERN POSTER & DIRECTORY STYLES
   ========================================================================== */

:root {
  --ctf-vulnhub: #3b82f6;
  --ctf-vulnhub-glow: rgba(59, 130, 246, 0.2);
  --ctf-htb: #10b981;
  --ctf-htb-glow: rgba(16, 185, 129, 0.2);
  --ctf-thm: #ef4444;
  --ctf-thm-glow: rgba(239, 68, 68, 0.2);
}

/* Hero Section for CTF Pages */
.ctf-hero {
  position: relative;
  padding: 56px 0 40px;
  background: linear-gradient(135deg, #090d16 0%, #151c2e 50%, #090d16 100%);
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ctf-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.ctf-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a5b4fc;
  backdrop-filter: blur(8px);
  margin-bottom: 14px;
}

.ctf-hero-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ctf-hero-subtitle {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* CTF Search & Filter Bar */
.ctf-filter-bar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 750px;
}

.ctf-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.ctf-search-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
}

.ctf-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.ctf-search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.85);
}

.ctf-search-input::placeholder {
  color: #64748b;
}

.ctf-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ctf-pill {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctf-pill:hover,
.ctf-pill.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

.ctf-pill.pill-vulnhub.active,
.ctf-pill.pill-vulnhub:hover {
  background: var(--ctf-vulnhub);
  border-color: var(--ctf-vulnhub);
}

.ctf-pill.pill-htb.active,
.ctf-pill.pill-htb:hover {
  background: var(--ctf-htb);
  border-color: var(--ctf-htb);
}

.ctf-pill.pill-thm.active,
.ctf-pill.pill-thm:hover {
  background: var(--ctf-thm);
  border-color: var(--ctf-thm);
}

/* Platform Showcase Cards (Hub & Home) */
.ctf-platforms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

@media (max-width: 992px) {
  .ctf-platforms-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.ctf-platform-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 26px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.ctf-platform-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.ctf-platform-card.card-vulnhub {
  border-top: 4px solid var(--ctf-vulnhub);
}
.ctf-platform-card.card-vulnhub:hover {
  border-color: var(--ctf-vulnhub);
  box-shadow: 0 16px 36px var(--ctf-vulnhub-glow);
}

.ctf-platform-card.card-htb {
  border-top: 4px solid var(--ctf-htb);
}
.ctf-platform-card.card-htb:hover {
  border-color: var(--ctf-htb);
  box-shadow: 0 16px 36px var(--ctf-htb-glow);
}

.ctf-platform-card.card-thm {
  border-top: 4px solid var(--ctf-thm);
}
.ctf-platform-card.card-thm:hover {
  border-color: var(--ctf-thm);
  box-shadow: 0 16px 36px var(--ctf-thm-glow);
}

.ctf-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.card-vulnhub .ctf-card-icon {
  background: rgba(59, 130, 246, 0.12);
  color: var(--ctf-vulnhub);
}

.card-htb .ctf-card-icon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--ctf-htb);
}

.card-thm .ctf-card-icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--ctf-thm);
}

.ctf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ctf-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.ctf-card-count {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}

.card-vulnhub .ctf-card-count {
  background: rgba(59, 130, 246, 0.1);
  color: var(--ctf-vulnhub);
}

.card-htb .ctf-card-count {
  background: rgba(16, 185, 129, 0.1);
  color: var(--ctf-htb);
}

.card-thm .ctf-card-count {
  background: rgba(239, 68, 68, 0.1);
  color: var(--ctf-thm);
}

.ctf-card-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 18px;
  flex: 1;
}

.ctf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-vulnhub .ctf-card-footer { color: var(--ctf-vulnhub); }
.card-htb .ctf-card-footer { color: var(--ctf-htb); }
.card-thm .ctf-card-footer { color: var(--ctf-thm); }

/* ==========================================================================
   VISUAL POSTER CARDS GRID - RICH MULTIMEDIA CTF DIRECTORY
   ========================================================================== */
.ctf-posters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 20px 0 36px;
}

@media (max-width: 1300px) {
  .ctf-posters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .ctf-posters-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 576px) {
  .ctf-posters-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Poster Card */
.ctf-poster-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ctf-poster-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.12);
}

/* Poster Thumbnail Container */
.ctf-poster-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #0f172a;
  overflow: hidden;
}

.ctf-poster-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ctf-poster-card:hover .ctf-poster-img {
  transform: scale(1.06);
}

/* Badges on Poster Thumbnail */
.ctf-poster-badge-top-left {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.ctf-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
}

.badge-vulnhub {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.badge-htb {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.badge-thm {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.ctf-poster-badge-top-right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.ctf-diff-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
}

.ctf-poster-badge-bottom-right {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
}

.ctf-views-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.75);
  color: #f1f5f9;
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Poster Card Body */
.ctf-poster-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ctf-poster-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 8px;
}

.ctf-poster-meta-dot {
  font-size: 0.6rem;
  color: #cbd5e1;
}

.ctf-poster-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ctf-poster-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ctf-poster-card:hover .ctf-poster-title a {
  color: #4f46e5;
}

.ctf-poster-excerpt {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.ctf-poster-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}

.btn-read-walkthrough {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease, color 0.2s ease;
}

.btn-read-walkthrough i {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.ctf-poster-card:hover .btn-read-walkthrough {
  gap: 8px;
  color: #3730a3;
}

.ctf-poster-card:hover .btn-read-walkthrough i {
  transform: translateX(3px);
}

/* Series Accordion Modern */
.ctf-series-section {
  margin-bottom: 28px;
}

.ctf-series-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ctf-series-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.ctf-series-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background 0.2s ease;
}

.ctf-series-header:hover {
  background: #f8fafc;
}

.ctf-series-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctf-series-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ctf-series-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.ctf-series-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #64748b;
}

.ctf-toggle-arrow {
  color: #94a3b8;
  font-size: 0.95rem;
  transition: transform 0.3s ease;
}

.ctf-series-card.open .ctf-toggle-arrow {
  transform: rotate(180deg);
}

.ctf-series-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid #f1f5f9;
}

.ctf-series-card.open .ctf-series-body {
  display: block;
}

/* Setup Guide Callout */
.ctf-guide-callout {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(168, 85, 247, 0.04) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-left: 4px solid #6366f1;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 28px;
}

.ctf-guide-callout h5 {
  font-size: 1rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctf-guide-callout p {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   UNIFIED SEARCH PAGE STYLES
   ========================================================================== */
.search-hero {
  padding: 44px 0 36px;
  background: linear-gradient(135deg, #090d16 0%, #151c2e 50%, #090d16 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.search-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a5b4fc;
}

.search-form-unified {
  max-width: 780px;
  margin-top: 18px;
}

.search-input-group-modern {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 6px 8px 6px 44px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}

.search-input-group-modern:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28), 0 12px 32px rgba(0, 0, 0, 0.45);
  background: rgba(15, 23, 42, 0.98);
}

.search-lead-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #818cf8;
  font-size: 1.15rem;
  pointer-events: none;
}

.search-unified-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 10px;
  outline: none;
  width: 100%;
}

.search-unified-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.btn-clear-search {
  color: #64748b;
  font-size: 1.1rem;
  margin-right: 8px;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color 0.2s;
}

.btn-clear-search:hover {
  color: #e2e8f0;
}

.btn-search-unified {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.btn-search-unified:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.5);
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
}

/* Search Results Header */
.search-results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 28px;
}

/* Dark Theme Support for Search & CTF */
[data-theme="dark"] .search-hero,
.dark .search-hero,
.dark-mode .search-hero {
  background: linear-gradient(135deg, #070a12 0%, #0f172a 50%, #070a12 100%) !important;
}

[data-theme="dark"] .ctf-poster-card,
.dark .ctf-poster-card,
.dark-mode .ctf-poster-card {
  background: #111827 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .ctf-poster-title a,
.dark .ctf-poster-title a,
.dark-mode .ctf-poster-title a {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .ctf-poster-title a:hover,
.dark .ctf-poster-title a:hover,
.dark-mode .ctf-poster-title a:hover {
  color: #818cf8 !important;
}

[data-theme="dark"] .ctf-poster-excerpt,
.dark .ctf-poster-excerpt,
.dark-mode .ctf-poster-excerpt {
  color: #94a3b8 !important;
}

[data-theme="dark"] .ctf-poster-meta,
.dark .ctf-poster-meta,
.dark-mode .ctf-poster-meta {
  color: #64748b !important;
}

[data-theme="dark"] .course-card-modern,
.dark .course-card-modern,
.dark-mode .course-card-modern {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .course-title,
.dark .course-title,
.dark-mode .course-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .course-summary,
.dark .course-summary,
.dark-mode .course-summary {
  color: #94a3b8 !important;
}

