/* ---------- Global ---------- */

/* Default Light Theme Variables */
:root {
    --bg:#f5f7fb;
    --text:#1f2937;
    --card-bg:#ffffff;
    --card-border:#e5e7eb;
    --tag-bg:#f1f5f9;
    --tag-hover:#e2e8f0;
}

body {
    font-family: "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ---------- DARK MODE ---------- */
body.dark {
    --bg:#121212;
    --text:#eee;
    --card-bg:#1f1f1f;
    --card-border:#333;
    --tag-bg:#2d2d2d;
    --tag-hover:#444;
}

/* Toggle */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    background:#0078ff;
    color:#fff;
    border:none;
    padding:12px 15px;
    border-radius:50%;
    cursor:pointer;
    font-size:18px;
    z-index:999;
}

/* ---------- Layout Container ---------- */
.container { 
  width: 95%;
  max-width: 1100px;
  margin: 18px auto;
}

/* ---------- Header / Topbar ---------- */
.header {
  background: #128c7e;
  color: #fff;
  padding: 14px 18px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow: 0 6px 26px rgba(2,6,23,0.07);
}

.header .topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.logo {
  font-weight:700;
  font-size:1.25rem;
  color: #fff;
  text-decoration:none;
}

.header .actions a {
  color: #fff;
  background: rgba(255,255,255,0.08);
  padding:8px 12px;
  border-radius:10px;
  text-decoration:none;
  font-weight:600;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform .12s ease;
}

.header .actions a:hover {
  transform: translateY(-2px);
}

/* ---------- Search Section ---------- */
.search-section {
  width:100%;
  display:flex;
  justify-content:center;
}

.search-form {
  width:100%;
  max-width:760px;
  display:flex;
  gap:8px;
  align-items:center;
}

.search-input {
  flex:1;
  padding:12px 16px;
  border-radius:999px;
  border:none;
  background:#ffffff;
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
  font-size:1rem;
}

.search-input::placeholder { color: #9aa4b2; }

.search-input:focus {
  outline: none;
  transform: scale(1.01);
}

.search-icon-btn {
  background: linear-gradient(135deg,#667eea,#764ba2);
  border:none;
  padding:10px 12px;
  border-radius:50%;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 6px 18px rgba(102,126,234,0.15);
}

.search-icon {
  width:20px;
  height:20px;
  fill:#fff;
}

/* ---------- Filters ---------- */
.filters {
  margin: 14px auto;
  width: 100%;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:10px;
  align-items:center;
}

.filters select,
.filters button.search-btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.95rem;
}

.filters .search-btn {
  background: linear-gradient(90deg,#ff416c,#ff4b2b);
  color: #fff;
  border: none;
  font-weight:700;
  cursor:pointer;
}

/* ---------- Groups Grid ---------- */

.groups-container {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
    gap:22px;
}

/* ---------- Group Card ---------- */

.group-card {
    background:var(--card-bg);
    border:1px solid var(--card-border);
    border-radius:18px;
    padding:20px;
    display:flex;
    flex-direction:column;
    gap:16px;
    transition:all 0.25s ease;
    box-shadow:0 4px 14px rgba(0,0,0,0.06);
}

.group-card:hover {
    transform:translateY(-6px);
    box-shadow:0 10px 24px rgba(0,0,0,0.12);
}

body.dark .group-card {
    box-shadow:0 4px 14px rgba(0,0,0,0.4);
}

body.dark .group-card:hover {
    box-shadow:0 10px 24px rgba(0,0,0,0.6);
}

.group-card-top {
    display:flex;
    gap:14px;
    align-items:flex-start;
}

.group-dp {
    width:50px;
    height:50px;
    border-radius:50%;
    object-fit:cover;
    border:2px solid #25D366;
    transition:0.2s ease;
}

.group-card:hover .group-dp {
    transform:scale(1.08);
}

.group-name {
    font-weight:600;
    font-size:17px;
    color:var(--text);
    text-decoration:none;
    line-height:1.3;
}

.group-name:hover {
    color:#25D366;
}

.group-meta-row {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:6px;
}

.meta-pill {
    background:var(--tag-bg);
    padding:4px 10px;
    font-size:12px;
    border-radius:999px;
    font-weight:500;
    color:#475569;
}

body.dark .meta-pill {
    color:#ccc;
}

.group-desc {
    font-size:14px;
    color:#555;
    line-height:1.5;
}

body.dark .group-desc {
    color:#ccc;
}

.tags-container {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.tag {
  background:#e0f7ec;
  color:#128c7e;
  font-weight:500;
  padding:5px 10px;
  border-radius:999px;
  font-size:0.75rem;
  text-decoration:none; 
  transition:0.2s ease;
}

.tag:hover {
  background:#25D366;
  color:#fff;
}

.group-footer {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:auto;
}

.join-btn {
    background:#25D366;
    color:#fff;
    padding:7px 18px;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    transition:0.2s ease;
}

.join-btn:hover {
    background:#1ebe5d;
    transform:translateY(-2px);
}

.load-more {
    display:inline-block;
    background:#0078ff;
    color:#fff;
    padding:8px 20px;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    margin:20px auto;
    cursor:pointer;
    transition:0.2s ease;
}

.load-more:hover {
    transform:translateY(-2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .group-dp { width:70px; height:70px; }
}

@media (max-width: 640px) {
  .group-dp { width:60px; height:60px; }
}