/* GroupFinder — core stylesheet. WhatsApp-inspired green, plain & uncluttered. */

:root {
  --green: #25D366;
  --green-dark: #128C7E;
  --green-darker: #075E54;
  --white: #FFFFFF;
  --bg-light: #F5F7F6;
  --text: #222222;
  --text-muted: #667a75;
  --border: #E3E9E7;
  --danger: #E53935;
  --warning: #F0A500;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(7, 94, 84, 0.08), 0 1px 2px rgba(7, 94, 84, 0.06);
  --shadow-md: 0 4px 12px rgba(7, 94, 84, 0.10);
  --max-width: 1140px;
  --header-h: 64px;
  --bottom-nav-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.5;
  padding-bottom: calc(var(--bottom-nav-h) + 70px);
}
img { max-width: 100%; display: block; }
a { color: var(--green-darker); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--green-darker); color: #fff;
  padding: 8px 16px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: var(--header-h);
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.15rem; color: var(--green-darker);
  text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-text { display: inline-flex; align-items: baseline; gap: 6px; }
.logo-hint { font-size: .62rem; font-weight: 500; color: var(--text-muted); letter-spacing: .02em; }
.main-nav { display: flex; gap: 20px; flex: 1; }
.main-nav a { color: var(--text); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--green-dark); text-decoration: none; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; }
.mobile-nav { display: none; flex-direction: column; border-top: 1px solid var(--border); }
.mobile-nav a { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.mobile-nav.open { display: flex; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
  min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: transparent; color: var(--green-darker); border-color: var(--green); }
.btn-outline:hover { background: rgba(37, 211, 102, .08); }
.btn-text { background: none; color: var(--text-muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; min-height: 32px; font-size: .85rem; }

/* ---------- Search result list (name + View) ---------- */
.group-result-list { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.group-result-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fff;
}
.group-result-row:last-child { border-bottom: none; }
.group-result-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-light); }
.group-result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.group-result-name { font-weight: 600; font-size: .98rem; }
.group-result-distance { font-size: .8rem; color: var(--text-muted); }

/* ---------- Flash ---------- */
.flash-wrap { margin-top: 12px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: .95rem; }
.flash-success { background: #E7F8EE; color: var(--green-darker); border: 1px solid #B7E8CB; }
.flash-error { background: #FDECEA; color: #B71C1C; border: 1px solid #F5C6C3; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #E9FBF0 0%, var(--white) 100%);
  padding: 40px 0 32px;
  text-align: center;
}
.hero h1 { font-size: 2rem; color: var(--green-darker); }
.hero p.sub { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto 24px; }
.search-box {
  max-width: 640px; margin: 0 auto; display: flex; gap: 8px; flex-wrap: wrap;
}
.search-box input[type="text"], .search-box input[type="search"] {
  flex: 1 1 260px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; min-height: 48px;
}
.search-box input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.hero-secondary { margin-top: 14px; }

/* ---------- Find Groups search/filter panel ---------- */
.search-filter-panel {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px;
}
.search-filter-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch;
}
.search-filter-input {
  flex: 1 1 260px; min-width: 0; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem; min-height: 46px;
}
.search-filter-input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.search-filter-submit { flex: 0 0 auto; }
.search-filter-select {
  flex: 1 1 200px; min-width: 0; min-height: 46px;
}
.search-filter-apply { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 600px) {
  .search-filter-row { flex-direction: column; }
  .search-filter-input, .search-filter-submit, .search-filter-select, .search-filter-apply { width: 100%; flex-basis: auto; }
}

/* ---------- Online counter ---------- */
.online-counter {
  text-align: center; padding: 10px 0; font-size: .92rem; color: var(--text-muted);
}
.online-dot { color: var(--green); }

/* ---------- Suggested keywords (homepage) ---------- */
.suggested-keywords { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; text-align: center; }
.suggested-keywords-title {
  font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin: 0 0 8px;
}
.suggested-keywords-list { margin: 0; padding: 0; color: var(--text-muted); font-size: .92rem; font-weight: 500; }

/* ---------- Sections ---------- */
.section { padding: 32px 0; }
.section-title { font-size: 1.4rem; margin-bottom: 18px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-alt { background: var(--bg-light); }

/* ---------- Popular links / chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--bg-light); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: .9rem; color: var(--text);
}
.chip:hover { background: #E9FBF0; border-color: var(--green); text-decoration: none; }

/* ---------- Cards grid ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px;
}

/* ---------- Group card ---------- */
.group-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.group-card-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--bg-light); }
.group-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.group-card-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.group-card-title a { color: var(--text); }
.group-card-meta { font-size: .87rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.group-card-tags { font-size: .83rem; color: var(--green-darker); }
.group-card-actions { display: flex; gap: 8px; margin-top: 8px; }
.group-card-actions .btn { flex: 1; }

/* ---------- Location explorer ---------- */
.location-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.location-grid a {
  display: block; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); font-weight: 500;
}
.location-grid a:hover { border-color: var(--green); text-decoration: none; }

/* ---------- Ads ---------- */
.ad-placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-light);
  color: var(--text-muted); text-align: center; padding: 28px 14px; font-size: .85rem;
}
.ad-slot { margin: 24px 0; }

/* Direct Advertisement Space rotation widget — separate from Google AdSense */
.ad-rotation-widget {
  max-width: 600px; width: 100%; margin: 0 auto; transition: opacity .3s ease;
}
.ad-rotation-img {
  width: 100%; height: auto; display: block; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .ad-rotation-widget { max-width: 100%; }
}
.sticky-ad {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 8px 12px; box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.sticky-ad-inner { max-width: var(--max-width); margin: 0 auto; }
.ad-rotation-footer-row {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px;
}
.ad-rotation-hint { font-size: .78rem; color: var(--text-muted); }
.ad-rotation-placeholder {
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-light);
  color: var(--text-muted); text-align: center; padding: 10px; font-size: .82rem;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 95;
  background: var(--white); border-top: 1px solid var(--border);
  height: var(--bottom-nav-h);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .68rem; gap: 2px;
}
.bottom-nav-item:hover { text-decoration: none; color: var(--green-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-light); border-top: 1px solid var(--border); padding: 32px 0 12px; margin-top: 24px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer-brand p { color: var(--text-muted); margin: 4px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--text-muted); font-size: .9rem; }
.footer-bottom { color: var(--text-muted); font-size: .8rem; padding-top: 16px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.help-text { color: var(--text-muted); font-size: .82rem; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="search"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit; background: var(--white); color: var(--text); min-height: 44px;
}
textarea { min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.card-form {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); max-width: 640px; margin: 0 auto;
}
.tag-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px; background: #E9FBF0; color: var(--green-darker);
  border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .85rem;
}
.tag-pill button { background: none; border: none; cursor: pointer; color: var(--green-darker); font-size: 1rem; }
.tag-input-wrap input { border: none; flex: 1 1 120px; min-width: 100px; min-height: 32px; padding: 4px; }
.tag-input-wrap input:focus { outline: none; }

/* map */
#mapPicker { width: 100%; height: 320px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-light); }

/* ---------- Tables (dashboard/admin) ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; background: var(--white); }
table.data-table th, table.data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .9rem; }
table.data-table th { background: var(--bg-light); font-weight: 600; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.status-active { background: #E7F8EE; color: var(--green-darker); }
.status-hidden { background: #FFF3CD; color: #8a6900; }
.status-auto_removed { background: #FDECEA; color: #B71C1C; }
.status-deleted { background: #EEE; color: #666; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0; }
.page-link {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  font-size: .9rem; min-width: 40px; text-align: center;
}
.page-link.active { background: var(--green); color: #fff; border-color: var(--green); }
.page-link:hover { border-color: var(--green); text-decoration: none; }
.page-dots { padding: 8px 4px; color: var(--text-muted); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--text-muted); margin: 14px 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--border); }
.breadcrumbs a { color: var(--text-muted); }

/* ---------- Group detail ---------- */
.group-hero { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.group-hero img { border-radius: var(--radius); border: 1px solid var(--border); aspect-ratio: 1/1; object-fit: cover; }
.group-hero-meta { display: flex; flex-direction: column; gap: 10px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span { background: var(--bg-light); border-radius: 999px; padding: 4px 12px; font-size: .82rem; color: var(--green-darker); }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(7,94,84,.45); z-index: 200;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius); padding: 24px; max-width: 480px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.modal-close { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); }
fieldset { border: none; padding: 0; margin: 0 0 12px; }
.radio-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.radio-row input { width: auto; min-height: auto; }

/* ---------- Stat cards (dashboard/admin) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-card .num { font-size: 1.6rem; font-weight: 700; color: var(--green-darker); }
.stat-card .label { font-size: .82rem; color: var(--text-muted); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--text-muted); }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.badge-admin { background: var(--green-darker); color: #fff; font-size: .7rem; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .group-hero { grid-template-columns: 1fr; }
  .group-hero img { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .main-nav, .header-actions { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .bottom-nav { display: flex; }
  .sticky-ad { bottom: var(--bottom-nav-h); } /* stack above the fixed bottom nav instead of overlapping it */
  body { padding-bottom: calc(var(--bottom-nav-h) + 90px); }
  .hero h1 { font-size: 1.55rem; }
  .search-box input[type="text"], .search-box input[type="search"] { flex-basis: 100%; }
  .card-form { padding: 18px; }
}
@media (min-width: 761px) {
  .sticky-ad { padding-bottom: 12px; }
}
