:root {
  --primary: #e42c8f;
  --accent: #59c5e6;
  --brand-dark: #22223b;
  --brand-green: #12bb74;
  --main-bg: #f7fafd;
}

html, body {
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Nunito', Arial, sans-serif;
  background: var(--main-bg);
  color: var(--brand-dark);
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* HEADER */
.header__info {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 8px 0;
}
.header__logo {
  color: #222 !important;
  font-weight: 700;
  font-size: 1.25rem;
}

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent);
  padding: 10px 24px;
}
.navbar__brand {
  display: flex;
  align-items: center;
  font-weight: 900;
  color: var(--brand-dark);
  text-decoration: none;
  gap: 10px;
  font-size: 1.1rem;
}
.navbar__brand img {
  border-radius: 12px;
  background: #fff;
  height: 36px;
  width: 36px;
}
.nav__list {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list li a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}
.nav__list li a.active,
.nav__list li a:hover,
.nav__list li a:focus {
  color: var(--primary);
  background: #fff;
}
.nav-toggle, .nav-toggle-label {
  display: none;
}

/* CATEGORIES */
.categories { margin: 24px auto; max-width: 800px; }
.section-title { text-align: center; font-size: 1.2rem; color: var(--brand-dark); margin: 30px 0 16px; font-weight: 700; letter-spacing: 1px; }
.category-list {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  box-sizing: border-box;
}
.category-card {
  background: #fff; color: var(--brand-dark); padding: 8px 18px; border-radius: 18px;
  border: 1.5px solid var(--accent); font-weight: 700; text-decoration: none;
  transition: background 0.15s, color 0.15s, border 0.15s;
}
.category-card:hover, .category-card:focus {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* GROUP LIST + CARDS */
.group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 100vw;
  margin-bottom: 24px;
  box-sizing: border-box;
}
.group-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 28px #00b97e25, 0 2px 8px #2222;
  max-width: 300px;
  min-width: 220px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 14px 18px 14px;
  margin: 18px 6px;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid #e7e7e7;
}
.group-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 32px #e42c8f33, 0 4px 20px #00b97e33;
  border-color: var(--primary);
  z-index: 2;
}
.group-avatar img {
  border-radius: 14px; width: 85px; height: 85px;
  margin: 8px auto 0 auto; object-fit: cover; display: block;
  background: #f7fafd; border: 2px solid #e7e7e7;
}
.group-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.group-info h3 {
  color: var(--brand-dark);
  font-size: 1.13rem;
  font-weight: 800;
  margin: 10px 0 4px;
  width: 100%;
  text-align: center;
}
.group-meta {
  display: flex;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--primary);
  margin-bottom: 2px;
  justify-content: center;
  width: 100%;
}
.group-card p {
  font-size: 0.98rem;
  color: #565;
  margin: 4px 0 6px;
  width: 100%;
  text-align: center;
}
.btn-join-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.btn-join {
  background: var(--brand-green);
  color: #fff;
  text-decoration: none;
  border-radius: 100px;
  padding: 10px 32px;
  display: inline-block;
  font-weight: 700;
  margin-top: 8px;
  transition: background 0.16s;
  border: none;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 4px 18px #12bb7433;
}
.btn-join:hover { background: #099f5a; }

.cta-main {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 32px;
  padding: 13px 38px;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 3px 16px #e42c8f22;
  transition: background .18s, color .18s;
  border: none;
}
.cta-main:hover { background: var(--brand-dark); color: #fff; }

/* FAB (Floating Add Button) */
.fab-add {
  position: fixed;
  bottom: 28px;
  right: 22px;
  background: var(--brand-green);
  color: #fff;
  border: none;
  border-radius: 100px;
  width: 62px;
  height: 62px;
  box-shadow: 0 6px 24px #0a9b6140;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  z-index: 99;
  transition: box-shadow .15s, background .15s;
}
.fab-add:hover { background: #099f5a; }

/* FOOTER */
.footer {
  width: 100%;
  background: #22223b;
  color: #fff;
  text-align: center;
  padding: 18px 0 10px 0;
  font-size: 1rem;
  font-family: 'Nunito', Arial, sans-serif;
  letter-spacing: 0.5px;
  margin-top: 40px;
  border-top: 4px solid #e42c8f;
}

img { max-width: 100%; height: auto; display: block; }

/* --- Responsive Fixes --- */
@media (max-width: 900px) {
  .nav__list {
    position: absolute;
    top: 60px;
    right: 0;
    left: 0;
    background: #fff;
    flex-direction: column;
    display: none;
    box-shadow: 0 4px 16px #0001;
    z-index: 99;
  }
  .nav-toggle:checked + .nav-toggle-label + .nav__list { display: flex; }
  .nav-toggle-label {
    display: block;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    margin-left: auto;
    margin-right: 8px;
    z-index: 100;
  }
  .nav-toggle-label span {
    display: block;
    height: 4px;
    width: 30px;
    background: #222;
    margin: 7px 0;
    border-radius: 3px;
    transition: 0.2s;
  }
}

/* MOBILE OPTIMIZATION */
@media (max-width: 700px) {
  .navbar { flex-wrap: wrap; padding: 8px 8px; }
  .group-list { gap: 10px; padding: 0 1vw; }
  .group-card {
    max-width: 97vw;
    min-width: 0;
    margin: 14px auto;
    box-sizing: border-box;
  }
  .fab-add {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    bottom: 16px;
    right: 8px;
  }
  .category-list { max-width: 100vw; padding: 0 2vw; }
}

/* Fix scroll lateral */
@media (max-width: 500px) {
  html, body { max-width: 100vw; overflow-x: hidden !important; }
  .group-card { margin-left: auto; margin-right: auto; }
}

.hero {
    max-width: 95vw;
    padding: 12px 3vw 6px 3vw;
    margin: 8px auto 10px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px #0001;
}
.hero h1 {
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 7px;
    line-height: 1.22;
    text-align: center;
    word-break: break-word;
    letter-spacing: 0;
}
  .subtitle {
    font-size: 1rem;
    text-align: center;
    margin: 6px 0 14px 0;
    color: #333;
  }
.search-form {
    flex-direction: row;
    max-width: 100%;
    width: 100%;
    margin: 0 auto 8px auto;
    border-radius: 9px;
    box-shadow: 0 1px 5px #0001;
    background: #f7fafd;
    padding: 0;
}
.search-form input[type="search"] {
    font-size: 0.96rem;
    padding: 11px 7px;
}
.search-form button {
    font-size: 1.07rem;
    padding: 0 14px;
    border-radius: 0 9px 9px 0;
}
.search-form {
  display: flex;
  max-width: 370px;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 5px #0001;
  margin: 0 auto 20px auto;
}

.search-form input[type="search"] {
  flex: 1;
  border: none;
  font-size: 1.06rem;
  padding: 13px 15px;
  background: #e0e1e1;
  outline: none;
  border-radius: 0;
  color: #22223b;
}

.search-form .search-btn {
  background: var(--brand-green);
  border: none;
  color: #fff;
  font-size: 1.35rem;
  padding: 0 20px;
  cursor: pointer;
  border-radius: 0 14px 14px 0;
  transition: background 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.search-form .search-btn:hover {
  background: #099f5a;
}

@media (max-width: 500px) {
  .search-form {
    max-width: 96vw;
    border-radius: 10px;
  }
  .search-form input[type="search"] {
    font-size: 1rem;
    padding: 12px 10px;
  }
  .search-form .search-btn {
    font-size: 1.18rem;
    padding: 0 14px;
    min-width: 42px;
    border-radius: 0 10px 10px 0;
  }
}
