/* Extracted Groups page styles. Kept from page-level blocks during migration. */

/* create_group.php */
html,
body {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
header,
footer {
  width: 100% !important;
  max-width: none !important;
}
.groups-page {
  width: 100%;
  max-width: 760px;
  margin: 40px auto;
  padding: 0 16px;
}
.group-form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  overflow: hidden;
}
.group-form-card .card-header {
  background: #007bff;
  color: #fff;
  padding: 14px 18px;
}
.group-form-card .card-header h5 {
  margin: 0;
}
.group-form-card .card-body {
  padding: 22px;
}
.group-form-card .form-group {
  margin-bottom: 18px;
}
.group-form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.group-form-card .form-control,
.group-form-card .form-select {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
}
.group-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
html[data-theme="dark"] body {
  color: #e8eef5;
  background: #0f141b;
}
html[data-theme="dark"] .group-form-card,
html[data-theme="dark"] .group-form-card .card-body {
  color: #e8eef5;
  background: #171e27;
  border-color: #303b48;
  box-shadow: none;
}
html[data-theme="dark"] .group-form-card label { color: #f4f7fb; }
html[data-theme="dark"] .group-form-card .form-control,
html[data-theme="dark"] .group-form-card .form-select {
  color: #fff;
  background: #10161d;
  border-color: #46515f;
}
html[data-theme="dark"] .group-form-card .form-select option {
  color: #fff;
  background: #171e27;
}
html[data-theme="dark"] .group-form-card .form-control:focus,
html[data-theme="dark"] .group-form-card .form-select:focus {
  color: #fff;
  background: #10161d;
  border-color: #5b9dff;
  box-shadow: 0 0 0 3px rgba(91, 157, 255, .18);
}
html[data-theme="dark"] .group-form-actions .btn-outline-secondary {
  color: #e8eef5;
  border-color: #526173;
}
html[data-theme="dark"] footer {
  color: #a9b5c2;
  background: #0f141b;
}

/* detail.php */
html,
    body {
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
    }
    header { width: 100% !important; max-width: none !important; }
    .group-icon { width:60px; height:60px; object-fit:cover; border-radius:50%; }
    .group-detail-page {
      width: calc(100% - 32px) !important;
      max-width: 1180px !important;
      margin: 24px auto 48px !important;
    }
    html[data-theme="dark"] body { color: #e8eef5; background: #0f141b; }
    html[data-theme="dark"] h2 { color: #f4f7fb; }
    html[data-theme="dark"] hr,
    html[data-theme="dark"] .nav-tabs { border-color: #303b48; }
    html[data-theme="dark"] .text-muted { color: #a9b5c2 !important; }
    html[data-theme="dark"] .nav-tabs .nav-link { color: #c8d4e1; }
    html[data-theme="dark"] .nav-tabs .nav-link.active {
      color: #fff;
      background: #1c2530;
      border-color: #46515f #46515f #1c2530;
    }
    html[data-theme="dark"] .table,
    html[data-theme="dark"] .table th,
    html[data-theme="dark"] .table td {
      color: #e8eef5;
      border-color: #303b48;
    }
    html[data-theme="dark"] .table-hover tbody tr:hover {
      color: #fff;
      background: #202a35;
    }
    html[data-theme="dark"] .table a { color: #9ac5ff; }

/* index.php */
:root {
      --groups-accent: #1769aa;
      --groups-accent-strong: #0d4f83;
      --groups-accent-soft: #eaf4fb;
      --groups-canvas: #f5f7fa;
      --groups-surface: #ffffff;
      --groups-border: #dfe7ef;
      --groups-heading: #17324d;
      --groups-text: #3e5062;
      --groups-muted: #6b7c8f;
      --groups-radius: 16px;
      --groups-control-radius: 10px;
      --groups-shadow: 0 14px 35px rgba(25, 58, 91, .08);
    }
    html[data-theme="dark"] {
      --groups-accent: #2f8bd2;
      --groups-accent-strong: #8bc7f4;
      --groups-accent-soft: #1b3550;
      --groups-canvas: #0f141b;
      --groups-surface: #171e27;
      --groups-border: #303b48;
      --groups-heading: #f4f7fb;
      --groups-text: #dbe4ee;
      --groups-muted: #a9b5c2;
      --groups-shadow: none;
    }
    html,
    body {
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
      background: var(--groups-canvas);
      color: var(--groups-text);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    }
    header,
    footer {
      width: 100% !important;
      max-width: none !important;
    }
    .groups-page {
      width: 100%;
      max-width: 1240px;
      margin-left: auto !important;
      margin-right: auto !important;
      padding: 8px 24px 56px;
    }
    .groups-hero {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 2rem;
      margin-bottom: 20px;
      padding: 30px 32px;
      background: var(--groups-surface);
      border: 1px solid var(--groups-border);
      border-radius: var(--groups-radius);
      box-shadow: 0 10px 28px rgba(25, 58, 91, .055);
    }
    .groups-hero h1 {
      margin: 0 0 8px;
      font-size: clamp(1.75rem, 2.6vw, 2.4rem);
      line-height: 1.16;
      letter-spacing: -.025em;
      font-weight: 750;
      color: var(--groups-heading);
    }
    .groups-hero p {
      margin: 0;
      max-width: 700px;
      color: var(--groups-muted);
      font-size: 1rem;
      line-height: 1.7;
    }
    .groups-summary {
      flex: 0 0 auto;
      min-width: 150px;
      padding: 14px 16px;
      color: var(--groups-heading);
      background: var(--groups-accent-soft);
      border-radius: 12px;
      font-size: .9rem;
      font-weight: 650;
      line-height: 1.5;
      text-align: right;
      white-space: nowrap;
    }
    .groups-quick-reset {
      display: inline-block;
      margin-top: 5px;
      color: var(--groups-accent-strong);
      text-decoration: none;
      font-size: .86rem;
      font-weight: 650;
    }
    .groups-quick-reset:hover {
      color: var(--groups-accent-strong);
      text-decoration: underline;
      text-underline-offset: 3px;
    }
    .groups-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 18px;
    }
    .groups-grid > div,
    .group-card,
    .group-card .card-body,
    .group-info,
    .group-info h5,
    .group-actions,
    .card-text {
      min-width: 0;
    }
    .top-bar {
      display: flex;
      align-items: stretch;
      gap: 14px;
      margin-bottom: 24px;
    }
    .filter-bar {
      flex: 1;
      padding: 18px 20px 12px;
      background: var(--groups-surface);
      border: 1px solid var(--groups-border);
      border-radius: var(--groups-radius);
      box-shadow: 0 8px 22px rgba(25, 58, 91, .045);
    }
    .filter-row {
      display: flex;
      align-items: flex-start;
      gap: 22px;
    }
    .filter-group {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      margin-bottom: 6px;
    }
    .filter-group-categories {
      flex: 1;
      align-items: flex-start;
    }
    .filter-options {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .filter-label {
      flex: 0 0 auto;
      margin: 7px 2px 0 0;
      color: var(--groups-muted);
      font-size: .86rem;
      font-weight: 650;
      white-space: nowrap;
    }
    .filter-bar .form-select {
      min-width: 148px;
      height: 38px;
      margin: 0;
      padding: 6px 32px 6px 11px;
      color: var(--groups-heading);
      background-color: #fff;
      border-color: #cbd8e5;
      border-radius: var(--groups-control-radius);
      font-size: .9rem;
    }
    .filter-bar .btn {
      min-height: 38px;
      margin: 0;
      padding: 8px 13px;
      border-color: #cbd8e5;
      border-radius: var(--groups-control-radius);
      color: #476078;
      background: #fff;
      font-size: .87rem;
      font-weight: 600;
      line-height: 1.25;
      box-shadow: none;
    }
    .filter-bar .btn:hover,
    .filter-bar .btn:focus,
    .filter-bar .btn.active,
    .filter-bar .btn-primary {
      color: #fff;
      background: var(--groups-accent);
      border-color: var(--groups-accent);
    }
    .filter-bar .btn:focus,
    .filter-bar .form-select:focus,
    .btn-create-group:focus,
    .group-actions .btn:focus,
    .pagination .page-link:focus {
      box-shadow: 0 0 0 3px rgba(23, 105, 170, .18);
    }
    .btn-create-group {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      align-self: stretch;
      min-width: 138px;
      margin: 0;
      padding: 0 18px;
      color: #fff !important;
      background: var(--groups-accent) !important;
      border: 1px solid var(--groups-accent) !important;
      border-radius: var(--groups-radius);
      font-weight: 700;
      white-space: nowrap;
      box-shadow: 0 9px 20px rgba(23, 105, 170, .18);
    }
    .btn-create-group:hover {
      background: var(--groups-accent-strong) !important;
      border-color: var(--groups-accent-strong) !important;
    }
    .btn-create-group:active,
    .group-actions .btn:active {
      transform: translateY(1px);
    }

    .group-card {
      overflow: hidden;
      background: var(--groups-surface);
      border: 1px solid var(--groups-border);
      border-radius: var(--groups-radius);
      box-shadow: 0 8px 24px rgba(25, 58, 91, .055);
      transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    }
    .group-card:hover {
      transform: translateY(-2px);
      border-color: #c7d7e6;
      box-shadow: var(--groups-shadow);
    }
    .group-card .card-body {
      display: flex;
      flex-direction: column;
      height: 100%;
      padding: 20px;
    }
    .group-actions {
      display: flex;
      gap: 8px;
      margin-top: auto;
      padding-top: 14px;
      border-top: 1px solid #edf1f5;
    }
    .group-actions .btn {
      flex: 1;
      min-height: 38px;
      padding: 8px 12px;
      border-radius: var(--groups-control-radius);
      font-weight: 650;
      line-height: 1.25;
    }
    .group-actions .btn-primary {
      color: #fff;
      background: var(--groups-accent);
      border-color: var(--groups-accent);
    }
    .group-actions .btn-outline-primary {
      color: var(--groups-accent-strong);
      border-color: #b9cddd;
    }
    .group-actions .btn-outline-secondary {
      color: #53687d;
      border-color: #ccd7e2;
    }
    .group-actions .btn:disabled {
      color: #657688;
      background: #edf2f6;
      border-color: #e2e8ee;
      opacity: 1;
    }
    .group-icon {
      flex: 0 0 auto;
      width: 54px;
      height: 54px;
      margin-right: 12px;
      object-fit: cover;
      border: 1px solid #dbe5ee;
      border-radius: 14px;
      background: #eef3f7;
    }
    .group-info {
      display: flex;
      align-items: center;
      margin-bottom: 12px;
    }
    .group-info h5 {
      flex: 1;
      margin: 0;
      font-size: 1.08rem;
      line-height: 1.35;
      font-weight: 720;
    }
    .group-info h5 a {
      color: var(--groups-heading);
      text-decoration: none;
    }
    .group-info h5 a:hover {
      color: var(--groups-accent-strong);
      text-decoration: underline;
      text-underline-offset: 3px;
    }
    .badge-hot {
      display: inline-flex;
      align-items: center;
      margin-left: 5px;
      padding: 2px 7px;
      color: var(--groups-accent-strong);
      background: var(--groups-accent-soft);
      border-radius: 999px;
      font-size: .7rem;
      font-weight: 750;
      line-height: 1.45;
      vertical-align: 2px;
    }
    .card-text {
      flex: 1;
      min-height: 4.8em;
      margin: 10px 0 16px;
      overflow: hidden;
      color: var(--groups-text);
      font-size: .92rem;
      line-height: 1.6;
      text-overflow: ellipsis;
      white-space: normal;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow-wrap: anywhere;
    }
    .group-stat {
      display: flex;
      align-items: center;
      gap: 14px;
      margin: 0 !important;
      color: var(--groups-muted) !important;
      font-size: .82rem;
      font-variant-numeric: tabular-nums;
    }
    .group-stat span {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .group-stat i {
      width: 14px;
      color: #7893aa;
      text-align: center;
    }
    .groups-empty {
      grid-column: 1 / -1;
      padding: 56px 20px;
      text-align: center;
      color: var(--groups-muted);
      background: var(--groups-surface);
      border: 1px dashed #c6d5e3;
      border-radius: var(--groups-radius);
    }
    .groups-empty-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 52px;
      height: 52px;
      margin: 0 auto 14px;
      color: var(--groups-accent);
      background: var(--groups-accent-soft);
      border-radius: 14px;
      font-size: 1.2rem;
    }
    .groups-empty .btn {
      border-color: #b9cddd;
      border-radius: var(--groups-control-radius);
      color: var(--groups-accent-strong);
      font-weight: 650;
    }
    .pagination {
      gap: 6px;
      margin-bottom: 0;
    }
    .pagination .page-link {
      min-width: 42px;
      padding: 9px 13px;
      color: var(--groups-accent-strong);
      background: #fff;
      border: 1px solid var(--groups-border);
      border-radius: var(--groups-control-radius) !important;
      font-size: .9rem;
      text-align: center;
    }
    .pagination .disabled .page-link {
      color: var(--groups-muted);
      background: #eef2f6;
    }
    .groups-page ::selection {
      color: var(--groups-heading);
      background: #cfe7f7;
    }
    html[data-theme="dark"] .groups-hero,
    html[data-theme="dark"] .filter-bar,
    html[data-theme="dark"] .group-card { box-shadow: none; }
    html[data-theme="dark"] .filter-bar .form-select,
    html[data-theme="dark"] .filter-bar .btn,
    html[data-theme="dark"] .pagination .page-link {
      color: #e8eef5;
      background: #1c2530;
      border-color: #46515f;
    }
    html[data-theme="dark"] .filter-bar .btn:hover,
    html[data-theme="dark"] .filter-bar .btn:focus,
    html[data-theme="dark"] .filter-bar .btn.active,
    html[data-theme="dark"] .filter-bar .btn-primary {
      color: #fff;
      background: var(--groups-accent);
      border-color: var(--groups-accent);
    }
    html[data-theme="dark"] .group-actions { border-top-color: #303b48; }
    html[data-theme="dark"] .group-actions .btn-outline-primary,
    html[data-theme="dark"] .group-actions .btn-outline-secondary {
      color: #dcecff;
      border-color: #536274;
    }
    html[data-theme="dark"] .group-actions .btn:disabled,
    html[data-theme="dark"] .pagination .disabled .page-link {
      color: #8f9baa;
      background: #202832;
      border-color: #303b48;
    }
    html[data-theme="dark"] .group-icon { background: #202a35; border-color: #3a4654; }
    @media (max-width: 992px) {
      .groups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .groups-hero { align-items: flex-start; flex-direction: column; }
      .groups-summary { min-width: 0; text-align: left; white-space: normal; }
      .filter-row { flex-direction: column; gap: 8px; }
      .filter-group { width: 100%; }
      .top-bar { flex-direction: column; }
      .btn-create-group { min-height: 50px; }
    }
    @media (max-width: 576px) {
      .groups-grid { grid-template-columns: 1fr; }
      .groups-page { padding: 2px 14px 40px; }
      .groups-hero { gap: 18px; margin-bottom: 14px; padding: 22px 18px; }
      .groups-hero h1 { font-size: 1.65rem; }
      .groups-hero p { font-size: .95rem; }
      .groups-summary { width: 100%; padding: 12px 14px; }
      .top-bar { gap: 10px; margin-bottom: 18px; }
      .filter-bar { padding: 16px 14px 10px; }
      .filter-group { align-items: stretch; flex-direction: column; gap: 7px; }
      .filter-label { margin-top: 0; }
      .filter-options { gap: 7px; }
      .filter-bar .form-select { width: 100% !important; min-width: 0; }
      .filter-bar .btn { flex: 1 1 auto; }
      .btn-create-group { width: 100%; }
      .group-card .card-body { padding: 18px; }
      .group-actions .btn { min-height: 42px; }
      .card-text { word-break: break-word; }
    }
    @media (prefers-reduced-motion: reduce) {
      .group-card,
      .btn-create-group,
      .group-actions .btn {
        transition: none;
      }
      .group-card:hover,
      .btn-create-group:active,
      .group-actions .btn:active {
        transform: none;
      }
    }

/* my_groups.php */
html,
body {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
header,
footer {
  width: 100% !important;
  max-width: none !important;
}
.groups-page {
  width: 100%;
  max-width: 960px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 16px;
  padding-right: 16px;
}
.groups-page .groups-inner {
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.card {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
}
.btn-outline-primary {
  border-radius: 20px;
  padding: 0.5rem 1rem;
}

/* view_post.php */
html,
    body {
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
    }
    html { min-height: 100%; }
    body { min-height: 100vh; display: flex; flex-direction: column; }
    header,
    footer { width: 100% !important; max-width: none !important; }
    .group-post-page {
      flex: 1 0 auto;
      width: calc(100% - 32px) !important;
      max-width: 1040px !important;
      margin: 40px auto !important;
    }
    html[data-theme="dark"] body {
      color: #e8eef5;
      background: #0f141b;
    }
    html[data-theme="dark"] .card,
    html[data-theme="dark"] .card-header,
    html[data-theme="dark"] .card-body,
    html[data-theme="dark"] .list-group-item {
      color: #e8eef5;
      background: #171e27 !important;
      border-color: #303b48;
      box-shadow: none !important;
    }
    html[data-theme="dark"] .card-title,
    html[data-theme="dark"] .card h5 { color: #f4f7fb; }
    html[data-theme="dark"] .text-muted,
    html[data-theme="dark"] .reply-meta small { color: #a9b5c2 !important; }
    html[data-theme="dark"] .form-control {
      color: #fff;
      background: #10161d;
      border-color: #46515f;
    }
    html[data-theme="dark"] .form-control::placeholder { color: #8492a3; }
    html[data-theme="dark"] .form-control:focus {
      color: #fff;
      background: #10161d;
      border-color: #5b9dff;
      box-shadow: 0 0 0 3px rgba(91, 157, 255, .18);
    }
    html[data-theme="dark"] footer {
      color: #a9b5c2;
      background: #0f141b;
    }

