/* The Defence Wiki - Custom Stylesheet (SEO Multi-Page Edition) */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1422;
  --bg-card: rgba(20, 29, 47, 0.45);
  --bg-card-hover: rgba(28, 40, 65, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 255, 102, 0.4);
  
  --text-primary: #f3f4f6;
  --text-secondary: #a1a8b9;
  --text-muted: #6c7383;
  
  --accent-green: #00ff66;
  --accent-green-dim: rgba(0, 255, 102, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.12);
  --accent-red: #ef4444;
  
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --max-width-content: 1100px;
  --max-width-article: 850px;
  --transition-speed: 0.2s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) var(--bg-primary);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- HEADER NAVIGATION --- */
.header-nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 20px;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.nav-brand svg {
  color: var(--accent-green);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
}

.nav-logo-text span:first-child {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-logo-text span:last-child {
  font-size: 0.65rem;
  color: var(--accent-green);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-speed) ease;
  position: relative;
  padding: 8px 0;
}

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

.nav-link.active {
  color: var(--accent-green);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-green);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
}

/* --- MAIN CONTAINER --- */
.main-container {
  flex-grow: 1;
  max-width: var(--max-width-content);
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

/* --- SEO HERO / INTRO --- */
.hero-section {
  text-align: center;
  padding: 60px 20px 40px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-section h1 span {
  color: var(--accent-green);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 750px;
  margin: 0 auto 28px auto;
}

/* --- SEARCH BAR HOME --- */
.home-search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.home-search-input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 16px 20px 16px 52px;
  border-radius: 30px;
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-speed) ease;
}

.home-search-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 15px var(--accent-green-dim);
}

.home-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* --- CATEGORY LINKS (HOME) --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px 24px;
  text-decoration: none;
  color: var(--text-primary);
  text-align: center;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--accent-blue);
}

.category-card.land::before { background-color: var(--accent-amber); }
.category-card.sea::before { background-color: var(--accent-green); }

.category-card:hover {
  transform: translateY(-4px);
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.category-card.air .category-icon { background-color: var(--accent-blue-dim); color: var(--accent-blue); }
.category-card.land .category-icon { background-color: var(--accent-amber-dim); color: var(--accent-amber); }
.category-card.sea .category-icon { background-color: var(--accent-green-dim); color: var(--accent-green); }

.category-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* --- TRENDING SECTION --- */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #ffffff;
  border-left: 4px solid var(--accent-green);
  padding-left: 12px;
}

/* --- WIKI DIRECTORY CONTROLS --- */
.directory-controls {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.dir-search-wrapper {
  position: relative;
}

.dir-search-input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 16px 12px 42px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
}

.dir-search-input:focus {
  border-color: var(--accent-green);
}

.dir-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.dir-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

.dir-select:focus {
  border-color: var(--accent-green);
}

/* --- DIRECTORY CARDS GRID --- */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.dir-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed) ease;
}

.dir-card:hover {
  transform: translateY(-2px);
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.dir-card:hover .card-thumbnail-container img {
  transform: scale(1.05);
}

.dir-card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 12px;
}

.dir-card.air .dir-card-tag { background-color: var(--accent-blue-dim); color: var(--accent-blue); }
.dir-card.land .dir-card-tag { background-color: var(--accent-amber-dim); color: var(--accent-amber); }
.dir-card.sea .dir-card-tag { background-color: var(--accent-green-dim); color: var(--accent-green); }

.dir-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  margin-bottom: 6px;
  transition: color var(--transition-speed) ease;
}

.dir-card-title:hover {
  color: var(--accent-green);
}

.dir-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.dir-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dir-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 16px;
}

.dir-card-link {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dir-card-link:hover {
  text-decoration: underline;
}

/* --- STANDALONE ARTICLE / PROFILE PAGE --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

.article-content {
  max-width: var(--max-width-article);
}

.article-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 10px;
  display: flex;
  gap: 16px;
}

.article-body h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  margin: 32px 0 16px 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.article-body p {
  margin-bottom: 20px;
  font-size: 1.02rem;
  color: var(--text-secondary);
  text-align: justify;
}

.article-body ul, .article-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 8px;
}

/* --- SIDEBAR INFOBOX (Military Specs Card) --- */
.infobox {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 100px;
}

.infobox-title {
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.infobox-image-placeholder {
  width: 100%;
  height: 160px;
  background-color: rgba(255, 255, 255, 0.01);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.infobox-image-container {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #05070d;
}

.infobox-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.infobox-image-container:hover img {
  transform: scale(1.05);
}

.infobox-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.infobox-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.infobox-table tr:last-child {
  border-bottom: none;
}

.infobox-table td {
  padding: 12px 16px;
  vertical-align: top;
}

.infobox-table td:first-child {
  font-weight: 600;
  color: var(--text-muted);
  width: 110px;
}

.infobox-table td:last-child {
  color: var(--text-primary);
}

/* Compare matrix for multi-page compare */
.compare-select-wrapper {
  display: grid;
  grid-template-columns: 1fr 50px 1fr;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.compare-matrix-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.compare-col {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px 24px;
}

.compare-col-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.compare-col-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
}

.compare-col-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Compare items spec list */
.compare-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.compare-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.compare-row.better {
  border-color: rgba(0, 255, 102, 0.1);
}

.compare-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.compare-label {
  color: var(--text-muted);
}

.compare-value {
  color: #ffffff;
  font-weight: 600;
}

.compare-bar {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  overflow: hidden;
}

.compare-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 0.5s ease;
}

.compare-col:first-child .compare-bar-fill { background-color: var(--accent-blue); }
.compare-col:last-child .compare-bar-fill { background-color: var(--accent-red); }

.compare-row.better .compare-bar-fill {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* --- FOOTER --- */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  padding: 48px 20px 24px 20px;
}

.footer-container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-about h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
}

.footer-about p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 320px;
}

.footer-links h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

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

.footer-bottom {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- RESPONSIVE MEDIA --- */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .infobox {
    position: static;
    max-width: 450px;
    margin: 32px auto 0 auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* Can expand on mobile toggle */
  }
  .mobile-menu-toggle {
    display: block;
  }
  .hero-section h1 {
    font-size: 2rem;
  }
  .category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .directory-controls {
    grid-template-columns: 1fr;
  }
  .compare-select-wrapper {
    grid-template-columns: 1fr;
  }
  .compare-select-wrapper span {
    text-align: center;
  }
  .compare-matrix-view {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
