/* ============================================
   MineForum — Styles
   Color palette: Minecraft grass green + sky blue
   ============================================ */

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

:root {
  /* Grass greens */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #3cb947;
  --green-600: #2d8f36;
  --green-700: #1a7a24;
  --green-800: #166534;
  --green-900: #14532d;

  /* Sky blues */
  --blue-50: #f0f9ff;
  --blue-100: #e0f2fe;
  --blue-200: #bae6fd;
  --blue-300: #7dd3fc;
  --blue-400: #38bdf8;
  --blue-500: #0ea5e9;
  --blue-600: #0284c7;
  --blue-700: #0369a1;

  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Accents */
  --orange-500: #f59e0b;
  --red-500: #ef4444;
  --purple-500: #a855f7;

  /* Semantic */
  --bg-body: #f0f4f8;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f8fafb;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: .2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.92);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .95rem;
}

.logo-text {
  letter-spacing: -.02em;
}

.logo-accent {
  color: var(--green-600);
}

.header__nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--green-50);
  color: var(--green-700);
}

.nav-link.active {
  background: var(--green-100);
  color: var(--green-700);
}

.header__actions {
  display: flex;
  gap: 8px;
}

.header__burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn--primary {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: #fff;
  border-color: var(--green-600);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(60, 185, 71, .35);
}

.btn--outline {
  background: transparent;
  color: var(--green-600);
  border-color: var(--green-300);
}

.btn--outline:hover {
  background: var(--green-50);
  border-color: var(--green-400);
}

.btn--full {
  width: 100%;
}

/* --- Mobile Menu --- */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  z-index: 99;
  padding: 24px 20px;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-link {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-link:hover, .mobile-link.active {
  background: var(--green-50);
  color: var(--green-700);
}

.mobile-menu__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* --- Hero Banner --- */
.hero {
  background: linear-gradient(160deg, var(--green-500) 0%, var(--blue-500) 60%, var(--blue-400) 100%);
  color: #fff;
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.hero__content {
  max-width: 560px;
}

.hero__title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -.02em;
}

.text-accent {
  color: var(--green-200);
}

.hero__desc {
  font-size: 1.05rem;
  opacity: .9;
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero__stats {
  display: flex;
  gap: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat__number {
  font-size: 1.5rem;
  font-weight: 800;
}

.stat__label {
  font-size: .85rem;
  opacity: .8;
}

/* Hero decorations */
.hero__decoration {
  position: absolute;
  right: -40px;
  top: 0;
  bottom: 0;
  width: 400px;
  pointer-events: none;
}

.grass-block {
  position: absolute;
  bottom: 0;
  right: 60px;
  width: 120px;
  height: 80px;
  background: linear-gradient(to bottom, var(--green-500) 0%, var(--green-700) 40%, #8B5E3C 40%, #6B4226 100%);
  border-radius: 8px 8px 0 0;
  opacity: .5;
  animation: float 4s ease-in-out infinite;
}

.grass-block--2 {
  right: 0;
  width: 90px;
  height: 60px;
  animation-delay: -2s;
  opacity: .35;
}

.cloud {
  position: absolute;
  background: rgba(255,255,255,.35);
  border-radius: 50px;
  height: 24px;
}

.cloud--1 {
  top: 40px;
  right: 20px;
  width: 120px;
  animation: drift 8s linear infinite;
}

.cloud--2 {
  top: 80px;
  right: 100px;
  width: 80px;
  animation: drift 12s linear infinite;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-30px); }
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 16px 20px;
  font-size: .85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--green-600);
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--green-700);
}

.breadcrumb__sep {
  color: var(--gray-300);
}

/* --- Forum --- */
.forum {
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* --- Category --- */
.category {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.category:hover {
  box-shadow: var(--shadow-md);
}

.category__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.category__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}

.category__icon--servers {
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
}

.category__icon--basics {
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
}

.category__icon--features {
  background: linear-gradient(135deg, var(--purple-500), #7c3aed);
}

.category__info {
  flex: 1;
  min-width: 200px;
}

.category__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.category__desc {
  font-size: .85rem;
  color: var(--text-muted);
}

.category__stats {
  display: flex;
  gap: 20px;
  font-size: .85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.category__stats strong {
  color: var(--text-primary);
  font-weight: 700;
}

.category__threads {
  display: flex;
  flex-direction: column;
}

/* --- Thread --- */
.thread {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.thread:last-child {
  border-bottom: none;
}

.thread:hover {
  background: var(--green-50);
}

/* Avatar */
.thread__avatar {
  flex-shrink: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
}

.avatar--green { background: linear-gradient(135deg, var(--green-400), var(--green-600)); }
.avatar--blue { background: linear-gradient(135deg, var(--blue-400), var(--blue-600)); }
.avatar--purple { background: linear-gradient(135deg, var(--purple-500), #7c3aed); }
.avatar--orange { background: linear-gradient(135deg, var(--orange-500), #ea580c); }
.avatar--yellow { background: linear-gradient(135deg, #eab308, #ca8a04); }
.avatar--pink { background: linear-gradient(135deg, #ec4899, #be185d); }
.avatar--red { background: linear-gradient(135deg, var(--red-500), #b91c1c); }

/* Thread content */
.thread__content {
  flex: 1;
  min-width: 0;
}

.thread__tags {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.tag--hot {
  background: #fef2f2;
  color: #dc2626;
}

.tag--pinned {
  background: var(--green-100);
  color: var(--green-700);
}

.tag--resolved {
  background: var(--blue-100);
  color: var(--blue-700);
}

.tag--new {
  background: #fefce8;
  color: #a16207;
}

.thread__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}

.thread__title a {
  color: var(--text-primary);
  transition: var(--transition);
}

.thread__title a:hover {
  color: var(--green-600);
}

.thread__preview {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread__meta {
  display: flex;
  gap: 16px;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.thread__meta i {
  margin-right: 4px;
}

/* Thread last post */
.thread__last-post {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 100px;
}

.thread__last-author {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.thread__last-date {
  font-size: .75rem;
  color: var(--text-muted);
}

/* --- Online Users --- */
.online {
  margin-bottom: 48px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.online__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.online__dot {
  font-size: .6rem;
  color: var(--green-500);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.online__title {
  font-size: .95rem;
  font-weight: 600;
}

.online__users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.online__user {
  padding: 5px 12px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--green-700);
  transition: var(--transition);
}

.online__user:hover {
  background: var(--green-100);
  cursor: pointer;
}

.online__user:last-child {
  background: var(--blue-50);
  border-color: var(--blue-200);
  color: var(--blue-600);
}

/* --- Footer --- */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 48px 0 0;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer__about {
  font-size: .87rem;
  color: var(--gray-400);
  line-height: 1.6;
}

.footer__heading {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.footer__link {
  display: block;
  font-size: .87rem;
  color: var(--gray-400);
  padding: 5px 0;
  transition: var(--transition);
}

.footer__link:hover {
  color: var(--green-400);
}

.footer__socials {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--gray-400);
  transition: var(--transition);
}

.social-link:hover {
  background: var(--green-600);
  color: #fff;
}

.footer__bottom {
  border-top: 1px solid var(--gray-800);
  padding: 20px;
  text-align: center;
  font-size: .82rem;
  color: var(--gray-500);
}

/* --- Modal --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal__close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.modal__title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

/* --- Form --- */
.form__group {
  margin-bottom: 16px;
}

.form__label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form__input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: var(--transition);
}

.form__input:focus {
  outline: none;
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(60, 185, 71, .12);
}

.form__input::placeholder {
  color: var(--gray-400);
}

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: .85rem;
}

.form__checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.form__checkbox input {
  accent-color: var(--green-500);
}

.form__forgot {
  color: var(--green-600);
  font-weight: 500;
}

.form__forgot:hover {
  text-decoration: underline;
}

.form__switch {
  text-align: center;
  margin-top: 16px;
  font-size: .85rem;
  color: var(--text-muted);
}

.form__switch a {
  color: var(--green-600);
  font-weight: 600;
}

.form__switch a:hover {
  text-decoration: underline;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-900);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: transform .3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero__decoration {
    display: none;
  }

  .hero__title {
    font-size: 1.7rem;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .category__stats {
    display: none;
  }

  .thread__last-post {
    display: none;
  }
}

@media (max-width: 640px) {
  .header__nav,
  .header__actions {
    display: none;
  }

  .header__burger {
    display: block;
  }

  .hero {
    padding: 36px 0 44px;
  }

  .hero__title {
    font-size: 1.4rem;
  }

  .hero__desc {
    font-size: .92rem;
  }

  .hero__stats {
    gap: 20px;
  }

  .stat__number {
    font-size: 1.2rem;
  }

  .category__header {
    padding: 16px;
  }

  .category__icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .thread {
    padding: 14px 16px;
    gap: 12px;
  }

  .thread__avatar {
    display: none;
  }

  .thread__meta {
    gap: 10px;
    font-size: .75rem;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .online {
    padding: 16px;
  }

  .modal__content {
    margin: 20px;
    padding: 28px 24px;
  }
}