/* ============================================================
   CODECHOMPER V2 — Shared Components
   Navbar · Footer · Buttons · Badges · Cards · Input · Section Header
   ============================================================ */


/* ============================
   NAVBAR
   Design ref: zX7cq
   ============================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--nav-height);
  background-color: var(--background);
  border-bottom: 2px solid var(--primary);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding: 0 var(--spacing-l);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  border-radius: var(--radius-none);
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--primary-foreground);
  flex-shrink: 0;
}

.nav-brand-code {
  font-family: var(--font-primary);
  font-size: 15px;
  letter-spacing: 0.13em;
  color: var(--foreground);
}

.nav-brand-chomper {
  font-family: var(--font-primary);
  font-size: 15px;
  letter-spacing: 0.13em;
  color: var(--accent);
}

/* Links */
.nav-links {
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 var(--spacing-m);
  font-family: var(--font-secondary);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--spacing-m);
  right: var(--spacing-m);
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: var(--foreground);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link--disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

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

/* CTA */
.nav-cta {
  flex-shrink: 0;
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--foreground);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background);
  border-top: 1px solid var(--border);
  flex-direction: column;
  padding: var(--spacing-xl) var(--spacing-l);
  z-index: 99;
  overflow-y: auto;
}

.nav-drawer.is-open {
  display: flex;
}

.nav-drawer .nav-link {
  height: auto;
  padding: var(--spacing-m) 0;
  font-size: 24px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.nav-drawer .nav-link::after {
  display: none;
}

.nav-drawer .btn-primary {
  margin-top: var(--spacing-xl);
  width: 100%;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
}


/* ============================
   FOOTER
   Design ref: lPTGg
   ============================ */

.footer {
  width: 100%;
  background-color: var(--background);
  border-top: 2px solid var(--primary);
}

.footer-body {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  grid-template-areas: "logo nav connect tools";
  gap: 60px;
  padding: 60px 80px;
  max-width: var(--container-max);
  margin-inline: auto;
}

.footer-col-logo {
  grid-area: logo;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-m);
}

.footer-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--primary);
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-brand-code {
  font-family: var(--font-primary);
  font-size: 15px;
  letter-spacing: 0.13em;
  color: var(--foreground);
}

.footer-brand-chomper {
  font-family: var(--font-primary);
  font-size: 15px;
  letter-spacing: 0.13em;
  color: var(--accent);
}

.footer-tagline {
  font-family: var(--font-secondary);
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.footer-col-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border);
}

.footer-col-nav {
  grid-area: nav;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-connect {
  grid-area: connect;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-heading {
  font-family: var(--font-primary);
  font-size: 11px;
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: var(--primary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-s);
}

.footer-link {
  font-family: var(--font-secondary);
  font-size: 13px;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--foreground);
}

.footer-link--disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.footer-connect-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  padding: 6px 0;
  font-family: var(--font-secondary);
  font-size: 13px;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.footer-connect-link:hover {
  color: var(--foreground);
}

.footer-connect-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.footer-bottom {
  width: 100%;
  background-color: var(--bg-surface);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-m) 80px;
  max-width: var(--container-max);
  margin-inline: auto;
}

.footer-copyright {
  font-family: var(--font-secondary);
  font-size: 11px;
  letter-spacing: 0.09em;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.footer-built-with {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}

.footer-built-dot {
  width: 4px;
  height: 4px;
  background-color: var(--primary);
  flex-shrink: 0;
}

.footer-built-text {
  font-family: var(--font-secondary);
  font-size: 11px;
  letter-spacing: 0.09em;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

/* Tools grid column */
.footer-col-tools {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 cols × 3 rows = 12 */
  gap: 10px;
  justify-items: center;
}

.footer-tools-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  max-width: 40px;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-tools-grid img:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Responsive footer */
@media (max-width: 1024px) {
  .footer-body {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "logo  logo"
      "nav   connect"
      "tools tools";
    padding: 40px 40px;
    gap: var(--spacing-xl);
  }
  /* 6 cols × 2 rows = 12 */
  .footer-tools-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-body {
    padding: 40px var(--spacing-l);
  }
  .footer-bottom-inner {
    flex-direction: column;
    gap: var(--spacing-s);
    padding: var(--spacing-l);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "nav"
      "connect"
      "tools";
  }
  /* Narrow mobile: 4 cols × 3 rows = 12 */
  .footer-tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ============================
   BUTTONS
   Design refs: Adzg0, TQnKT, swKN5, lWB4M, 3ntGm
   ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-primary);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
}

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

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

.btn-outline:hover {
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  border: none;
}

.btn-ghost:hover {
  background-color: var(--bg-elevated);
}

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

.btn-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  border: none;
}

/* Size variants */
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 14px;
}


/* ============================
   BADGES
   Design refs: 1Nq3S, 7sHMG, A5Wwc, hv8kD, hraW7, BWglm
   ============================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  transition: filter 0.2s ease;
}

.badge:hover {
  filter: brightness(1.15);
}

.badge-default {
  background-color: var(--secondary);
  color: var(--foreground);
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-accent {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

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

.badge-ghost {
  background-color: transparent;
  color: var(--muted-foreground);
}

.badge-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

/* Clickable badge (filter UI) */
.badge-filter {
  cursor: pointer;
  user-select: none;
}

.badge-filter.is-active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}


/* ============================
   CARD
   Design ref: XmiGU
   ============================ */

.card {
  display: flex;
  flex-direction: column;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-none);
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.card:hover {
  border-color: var(--primary);
}

.card-top-bar {
  width: 100%;
  height: 4px;
  background-color: var(--primary);
  flex-shrink: 0;
}

.card-image {
  width: 100%;
  height: 350px;
  overflow: hidden;
  flex-shrink: 0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.card:hover .card-image img {
  transform: scale(1.04);
}

.card-top-bar-accent {
  background-color: var(--accent);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--spacing-l);
  flex: 1;
}

.card-meta {
  font-family: var(--font-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
}

.card-title {
  font-family: var(--font-primary);
  font-size: 24px;
  color: var(--foreground);
}

.card-desc {
  font-family: var(--font-secondary);
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--spacing-l);
  border-top: 1px solid var(--border);
}

.card-stat {
  font-family: var(--font-secondary);
  font-size: 12px;
  color: var(--muted-foreground);
}


/* ============================
   INPUT
   Design ref: fkZym
   ============================ */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.input-label {
  font-family: var(--font-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.input-field {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-family: var(--font-secondary);
  font-size: 14px;
  color: var(--foreground);
  border-radius: var(--radius-none);
  transition: border-color 0.2s ease;
}

.input-field::placeholder {
  color: var(--muted-foreground);
}

.input-field:focus {
  border-color: var(--primary);
  outline: none;
}

textarea.input-field {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}


/* ============================
   SECTION HEADER
   Reusable pattern across all pages
   ============================ */

.section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  width: 100%;
}

.section-accent-bar {
  width: 6px;
  flex-shrink: 0;
  background-color: var(--primary);
  /* Height set inline or via modifier */
  align-self: stretch;
  min-height: 48px;
}

.section-accent-bar--accent {
  background-color: var(--accent);
}

.section-accent-bar--dark {
  background-color: var(--dark-green);
}

.section-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-overline {
  font-family: var(--font-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.section-overline--primary {
  color: var(--primary);
}

.section-overline--accent {
  color: var(--accent);
}

.section-title {
  font-family: var(--font-primary);
  font-size: clamp(32px, 3.33vw, 48px);
  color: var(--foreground);
}

/* Numbered section label pattern (e.g. "001 / PLANJAM.GAMES") */
.entry-number {
  font-family: var(--font-primary);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--primary);
}

.entry-number--accent {
  color: var(--accent);
}

/* Title row with accent bar (used in project/game entries) */
.entry-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-accent-bar {
  width: 4px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 46px;
  background-color: var(--primary);
}

.entry-accent-bar--accent {
  background-color: var(--accent);
}

.entry-title {
  font-family: var(--font-primary);
  font-size: clamp(28px, 3vw, 42px);
  color: var(--foreground);
}


/* ============================
   TAG CHIP
   Simple tech/category tags used in project/game cards
   ============================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-m);
  font-family: var(--font-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background-color: var(--bg-elevated);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-s);
}


/* ============================
   GLITCH DECORATION ROW
   Horizontal colored bars used as design accents
   ============================ */

.glitch-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.glitch-bar {
  height: 2px;
  background-color: var(--primary);
  opacity: 0.7;
}

.glitch-bar--accent {
  background-color: var(--accent);
  opacity: 0.9;
}

.glitch-bar--dark {
  background-color: var(--primary);
  opacity: 0.5;
}
