/*
Theme Name: ProfileGrid Pro Theme
Theme URI: https://yoursite.com
Author: ProfileGrid Theme
Author URI: https://yoursite.com
Description: A beautifully crafted WordPress theme designed specifically for ProfileGrid – with full support for user profiles, groups, connections, messaging, badges, and all ProfileGrid extensions. Clean, modern, and community-ready.
Version: 1.0.6
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: profilegrid-pro-theme
Tags: profilegrid, community, social, profiles, groups, members, buddypress-alternative, custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand Colors */
  --color-primary:        #2563eb;
  --color-primary-dark:   #1d4ed8;
  --color-primary-light:  #dbeafe;
  --color-secondary:      #7c3aed;
  --color-secondary-light:#ede9fe;
  --color-accent:         #0ea5e9;
  --color-success:        #10b981;
  --color-warning:        #f59e0b;
  --color-danger:         #ef4444;

  /* Neutrals */
  --color-bg:             #f8fafc;
  --color-surface:        #ffffff;
  --color-surface-2:      #f1f5f9;
  --color-surface-3:      #e2e8f0;
  --color-border:         #e2e8f0;
  --color-border-dark:    #cbd5e1;
  --color-text:           #0f172a;
  --color-text-muted:     #64748b;
  --color-text-light:     #94a3b8;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Syne', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Borders */
  --radius-sm:   0.375rem;
  --radius-md:   0.625rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.1), 0 8px 10px rgba(0,0,0,.06);
  --shadow-card: 0 0 0 1px var(--color-border), var(--shadow-sm);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,.25);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   350ms ease;

  /* Layout */
  --container-max:  1280px;
  --sidebar-width:  300px;
  --header-height:  68px;
}

/* Dark mode intentionally disabled – theme is always light */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-dark); }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: .875rem; }

p { color: var(--color-text-muted); line-height: 1.7; }
p + p { margin-top: .75rem; }

.entry-content {
  p, ul, ol, blockquote, pre, figure { margin-bottom: 1.25rem; }
  ul, ol { padding-left: 1.5rem; list-style: revert; }
  ul li, ol li { margin-bottom: .35rem; }
  h2, h3, h4 { margin-top: 2rem; margin-bottom: .75rem; }
  blockquote {
    border-left: 4px solid var(--color-primary);
    padding: .75rem 1.25rem;
    background: var(--color-primary-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--color-text-muted);
    font-style: italic;
  }
  pre {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: .875rem;
  }
  code { font-family: var(--font-mono); font-size: .875em; }
  a { text-decoration: underline; text-underline-offset: 3px; }
  img { border-radius: var(--radius-md); }
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; padding-block: var(--space-2xl); }

/* Two-col with sidebar */
.content-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
  align-items: start;
}
.full-width-content { max-width: 800px; margin-inline: auto; }

@media (max-width: 1024px) {
  .content-sidebar { grid-template-columns: 1fr; }
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255,255,255,.92);
}



.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-xl);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
  letter-spacing: -0.03em;
  white-space: nowrap;
  text-decoration: none;
}
.site-logo:hover { color: var(--color-primary); }
.site-logo img { height: 36px; width: auto; }

/* Main nav */
.main-navigation { display: flex; align-items: center; gap: var(--space-xs); }
.main-navigation a {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-xs);
  background: none;
  border: none;
  color: var(--color-text);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition-base);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-navigation {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md);
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }
  .main-navigation.is-open { display: flex; }
  .main-navigation a { justify-content: flex-start; padding: var(--space-sm) var(--space-md); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn, .button,
.pg-btn,
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: .5rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary, .button-primary,
input[type="submit"],
button[type="submit"] {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover, .button-primary:hover,
input[type="submit"]:hover, button[type="submit"]:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-dark);
}
.btn-secondary:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: .5rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-elevated { box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--color-text); margin: 0; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: .375rem;
}
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: .5rem .875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: .9rem;
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}
textarea { min-height: 100px; resize: vertical; }
.form-hint { margin-top: .25rem; font-size: .8rem; color: var(--color-text-light); }
.form-error { margin-top: .25rem; font-size: .8rem; color: var(--color-danger); }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .15rem .5rem;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-secondary { background: var(--color-secondary-light); color: var(--color-secondary); }
.badge-success { background: rgba(16,185,129,.12); color: var(--color-success); }
.badge-warning { background: rgba(245,158,11,.12); color: var(--color-warning); }
.badge-danger { background: rgba(239,68,68,.12); color: var(--color-danger); }
.badge-neutral { background: var(--color-surface-2); color: var(--color-text-muted); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--color-surface-3);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-xs);
  display: inline-block;
  flex-shrink: 0;
}
.avatar-xs  { width: 28px;  height: 28px; }
.avatar-sm  { width: 36px;  height: 36px; }
.avatar-md  { width: 48px;  height: 48px; }
.avatar-lg  { width: 72px;  height: 72px; }
.avatar-xl  { width: 96px;  height: 96px; }
.avatar-2xl { width: 128px; height: 128px; }

.avatar-group {
  display: flex;
  align-items: center;
}
.avatar-group .avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--color-surface);
}
.avatar-group .avatar:first-child { margin-left: 0; }

/* ============================================================
   TABS
   ============================================================ */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  gap: var(--space-xs);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab-panel { padding-top: var(--space-lg); }
.tab-panel:not(.active) { display: none; }

/* ============================================================
   NOTICE / ALERT
   ============================================================ */
.notice, .alert {
  display: flex;
  gap: var(--space-sm);
  padding: .875rem var(--space-md);
  border-radius: var(--radius-md);
  font-size: .9rem;
  border: 1px solid;
}
.notice-info    { background: var(--color-primary-light);  border-color: rgba(37,99,235,.2);  color: var(--color-primary); }
.notice-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.25); color: var(--color-success); }
.notice-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: #92400e; }
.notice-error   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25);  color: var(--color-danger); }

/* ============================================================
   PROFILEGRID – USER PROFILES
   ============================================================ */

/* Profile cover + avatar header */
.pg-profile-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.pg-cover-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: block;
  position: relative;
}
.pg-cover-placeholder {
  height: 220px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #0ea5e9 100%);
  position: relative;
}
.pg-cover-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.pg-profile-body {
  padding: 0 var(--space-xl) var(--space-xl);
  position: relative;
}

.pg-avatar-wrap {
  margin-top: -52px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.pg-avatar-wrap .avatar {
  border: 4px solid var(--color-surface);
  box-shadow: var(--shadow-md);
}

.pg-profile-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin: 0 0 .25rem;
}

.pg-profile-role {
  font-size: .875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.pg-profile-stats {
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}
.pg-stat { text-align: center; }
.pg-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}
.pg-stat-label {
  display: block;
  font-size: .75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}

.pg-profile-bio {
  color: var(--color-text-muted);
  font-size: .95rem;
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

.pg-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.pg-meta-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--color-text-muted);
}
.pg-meta-item svg { color: var(--color-text-light); flex-shrink: 0; }

/* Profile Fields Grid */
.pg-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}
.pg-field-item {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.pg-field-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-light);
  margin-bottom: .2rem;
}
.pg-field-value {
  font-size: .9rem;
  color: var(--color-text);
  font-weight: 500;
}

/* Members directory / grid */
.pg-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.pg-member-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.pg-member-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transform: scaleX(0);
  transition: transform var(--transition-base);
}
.pg-member-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--color-primary);
}
.pg-member-card:hover::before { transform: scaleX(1); }

.pg-member-card .avatar { margin: 0 auto var(--space-sm); }
.pg-member-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .2rem;
}
.pg-member-role {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}
.pg-member-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem;
  margin-bottom: var(--space-sm);
}

/* Online indicator */
.pg-online-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 2px rgba(16,185,129,.3);
}

/* ============================================================
   PROFILEGRID – GROUPS
   ============================================================ */

.pg-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.pg-group-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}
.pg-group-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
  border-color: transparent;
}

.pg-group-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-group-cover img { width: 100%; height: 100%; object-fit: cover; }
.pg-group-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}
.pg-group-privacy {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

.pg-group-body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pg-group-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: .35rem;
  letter-spacing: -0.02em;
}
.pg-group-desc {
  font-size: .85rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-md);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pg-group-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}
.pg-group-members {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: .8rem;
  color: var(--color-text-muted);
}

/* ============================================================
   PROFILEGRID – CONNECTIONS / FRIENDS
   ============================================================ */

.pg-connections-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.pg-connection-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}
.pg-connection-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.pg-connection-info { flex: 1; min-width: 0; }
.pg-connection-name {
  font-weight: 700;
  color: var(--color-text);
  font-size: .95rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-connection-meta {
  font-size: .8rem;
  color: var(--color-text-muted);
}
.pg-connection-actions { display: flex; gap: var(--space-xs); flex-shrink: 0; }

/* Connection request */
.pg-request-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
}

/* ============================================================
   PROFILEGRID – MESSAGING
   ============================================================ */

.pg-messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: 600px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.pg-inbox-list {
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  background: var(--color-surface-2);
}
.pg-inbox-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: .875rem;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: .07em;
  background: var(--color-surface);
}

.pg-conversation-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--color-border);
}
.pg-conversation-item:hover,
.pg-conversation-item.active {
  background: var(--color-surface);
}
.pg-conversation-item.unread .pg-msg-preview { font-weight: 600; color: var(--color-text); }
.pg-msg-info { flex: 1; min-width: 0; }
.pg-msg-name {
  font-size: .875rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .1rem;
}
.pg-msg-preview {
  font-size: .8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-msg-meta {
  font-size: .7rem;
  color: var(--color-text-light);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
}
.pg-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* Chat window */
.pg-chat-window {
  display: flex;
  flex-direction: column;
}
.pg-chat-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface);
}
.pg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.pg-message {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  max-width: 70%;
}
.pg-message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.pg-message-bubble {
  padding: .5rem .875rem;
  border-radius: var(--radius-lg);
  font-size: .875rem;
  line-height: 1.5;
  max-width: 100%;
}
.pg-message.received .pg-message-bubble {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-xs, 4px);
}
.pg-message.sent .pg-message-bubble {
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: var(--radius-xs, 4px);
}
.pg-message-time {
  font-size: .7rem;
  color: var(--color-text-light);
  margin-top: .2rem;
}

.pg-chat-input {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.pg-chat-input input {
  flex: 1;
  border-radius: var(--radius-full);
  padding: .5rem 1rem;
}

@media (max-width: 768px) {
  .pg-messages-layout { grid-template-columns: 1fr; height: auto; }
  .pg-inbox-list { display: none; }
}

/* ============================================================
   PROFILEGRID – BADGES / ACHIEVEMENTS
   ============================================================ */

.pg-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}
.pg-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
}
.pg-badge-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pg-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.pg-badge-item.locked .pg-badge-icon {
  background: var(--color-surface-2);
  filter: grayscale(1);
  opacity: .5;
}
.pg-badge-name {
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-text);
}
.pg-badge-item.locked .pg-badge-name { color: var(--color-text-muted); }

/* ============================================================
   PROFILEGRID – ACTIVITY FEED
   ============================================================ */

.pg-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.pg-activity-feed::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.pg-activity-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  position: relative;
}
.pg-activity-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-primary-light);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
  margin-left: 15px;
}
.pg-activity-content {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.pg-activity-text { font-size: .9rem; color: var(--color-text); margin-bottom: .25rem; }
.pg-activity-text a { font-weight: 700; }
.pg-activity-time { font-size: .75rem; color: var(--color-text-light); }

/* ============================================================
   PROFILEGRID – SEARCH / FILTER BAR
   ============================================================ */

.pg-search-bar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.pg-search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.pg-search-input-wrap svg {
  position: absolute;
  left: .875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  pointer-events: none;
}
.pg-search-input-wrap input {
  padding-left: 2.5rem;
  border-radius: var(--radius-full);
}
.pg-filter-group { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

/* ============================================================
   PROFILEGRID – SIDEBAR WIDGETS
   ============================================================ */

.pg-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}
.pg-widget-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pg-widget-title {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text);
}
.pg-widget-body { padding: var(--space-lg); }
.pg-widget-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  text-align: center;
}
.pg-widget-footer a { font-size: .85rem; font-weight: 600; color: var(--color-primary); }

/* Mini member list in widget */
.pg-mini-members { display: flex; flex-direction: column; gap: var(--space-sm); }
.pg-mini-member {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.pg-mini-member-info { flex: 1; min-width: 0; }
.pg-mini-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-mini-role { font-size: .75rem; color: var(--color-text-muted); }

/* ============================================================
   PAGINATION
   ============================================================ */

.pg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-2xl);
}
.pg-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-dark);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.pg-page-btn:hover, .pg-page-btn.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: #1e293b;
  color: rgba(255,255,255,.7);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}
.footer-brand .site-logo { color: #fff; margin-bottom: var(--space-md); display: block; }
.footer-desc { font-size: .875rem; line-height: 1.65; color: rgba(255,255,255,.55); }
.footer-heading {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.9);
  margin-bottom: var(--space-md);
}
.footer-links { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-links a { font-size: .875rem; color: rgba(255,255,255,.55); transition: color var(--transition-fast); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================================================
   WORDPRESS CORE COMPATIBILITY
   ============================================================ */

/* Accessibility */
.screen-reader-text {
  border: 0;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 999;
  padding: .5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; }

/* WordPress widgets */
.widget { margin-bottom: var(--space-lg); }
.widget-title {
  font-size: .875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

/* Comments */
.comments-area { margin-top: var(--space-2xl); padding-top: var(--space-2xl); border-top: 1px solid var(--color-border); }
.comments-title { margin-bottom: var(--space-lg); }
.comment-list { margin-bottom: var(--space-xl); }
.comment { margin-bottom: var(--space-lg); padding: var(--space-md); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.comment-meta { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.comment-author-name { font-weight: 700; font-size: .9rem; }
.comment-date { font-size: .8rem; color: var(--color-text-muted); }
.comment-body { font-size: .9rem; color: var(--color-text-muted); }
.comment-reply-link { font-size: .8rem; font-weight: 600; color: var(--color-primary); }
.children { margin-top: var(--space-md); padding-left: var(--space-xl); border-left: 2px solid var(--color-border); }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Responsive utilities */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .container { padding-inline: var(--space-md); }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
