/* ==========================================================================
   WaterMan: Community Heart & Soul (Lapeer, MI) Private Portal Stylesheet
   Mobile-First, Accessible, High Performance
   ========================================================================== */

:root {
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --primary-600: #475569;
  --primary-100: #f1f5f9;
  --primary-50:  #f8fafc;

  --heart-red:   #e11d48;
  --heart-dark:  #be123c;
  --heart-light: #ffe4e6;

  --soul-amber:  #d97706;
  --soul-gold:   #f59e0b;
  --soul-light:  #fef3c7;

  --accent-teal: #0d9488;
  --accent-green:#059669;
  --accent-light:#d1fae5;

  --text-main:   #0f172a;
  --text-muted:  #64748b;
  --text-light:  #94a3b8;
  --surface-card:#ffffff;
  --surface-bg:  #f8fafc;
  --border-color:#e2e8f0;
  --border-focus:#93c5fd;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --bottom-bar-height: 64px;
  --header-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--surface-bg);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-bar-height) + var(--safe-bottom) + 16px);
}

/* ==========================================================================
   PASSWORD GATE (LOGIN SCREEN)
   ========================================================================== */
#gate-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gate-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--heart-red), var(--soul-gold));
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--heart-light);
  color: var(--heart-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.gate-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.25;
  margin-bottom: 6px;
}

.gate-slogan {
  font-size: 14px;
  font-style: italic;
  color: var(--soul-amber);
  font-weight: 600;
  margin-bottom: 14px;
}

.gate-desc {
  font-size: 13.5px;
  color: var(--primary-600);
  margin-bottom: 22px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group {
  position: relative;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-700);
  margin-bottom: 4px;
}

.gate-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.gate-input:focus {
  border-color: var(--heart-red);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

.gate-btn {
  background: linear-gradient(135deg, var(--heart-red), var(--heart-dark));
  color: #ffffff;
  border: none;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.gate-btn:hover {
  opacity: 0.95;
}

.gate-btn:active {
  transform: scale(0.98);
}

.gate-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.hint-pill {
  display: inline-block;
  background: #f1f5f9;
  color: var(--primary-700);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
  cursor: pointer;
  border: 1px dashed #cbd5e1;
}

.hint-pill:hover {
  background: #e2e8f0;
}

.gate-error {
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
  margin-top: 6px;
}

/* ==========================================================================
   TOP HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--heart-red), var(--soul-gold));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.2);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.15;
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--heart-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-100);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-700);
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: background 0.15s ease;
}

.status-indicator:hover {
  background: #e2e8f0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(5, 150, 105, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
  }
}

.header-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  color: var(--primary-700);
  transition: all 0.15s ease;
}

.header-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--heart-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 4px;
  border: 2px solid #ffffff;
}

/* ==========================================================================
   ANNOUNCEMENT SUB-HEADER (NEXT MEETING ALERT)
   ========================================================================== */
.alert-banner {
  background: linear-gradient(90deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid var(--soul-gold);
}

.alert-banner-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alert-tag {
  background: var(--soul-gold);
  color: #0f172a;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.alert-text {
  font-weight: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.alert-link {
  color: var(--soul-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ==========================================================================
   MAIN CONTAINER & TAB PANELS
   ========================================================================== */
.main-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.action-btn-sm {
  background: var(--heart-red);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s ease;
}

.action-btn-sm:hover {
  opacity: 0.92;
}

/* ==========================================================================
   CARDS & POSTS
   ========================================================================== */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card.pinned {
  border-left: 4px solid var(--heart-red);
  background: linear-gradient(to right, #fff5f5, #ffffff 40%);
}

.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-800);
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-900);
}

.post-date {
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pinned {
  background: var(--heart-light);
  color: var(--heart-dark);
}

.badge-tag {
  background: #f1f5f9;
  color: var(--primary-700);
}

.post-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: 10px;
  line-height: 1.3;
}

.post-body {
  font-size: 14.5px;
  color: var(--primary-800);
  line-height: 1.6;
}

.post-body p {
  margin-bottom: 10px;
}

.post-highlight-box {
  background: #f8fafc;
  border-left: 3px solid var(--soul-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  margin: 12px 0;
}

.post-highlight-box h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: 4px;
}

.post-highlight-box ul {
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--primary-700);
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.post-interactions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.interact-btn {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-600);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.interact-btn:hover {
  background: #f1f5f9;
  color: var(--heart-red);
}

.interact-btn.active {
  color: var(--heart-red);
}

/* ==========================================================================
   PROGRESS & GRANT MATCHING STYLES
   ========================================================================== */
.thermometer-card {
  background: linear-gradient(145deg, #ffffff, #fbfcfe);
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.grant-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.grant-stat-box {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid #e2e8f0;
}

.grant-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-900);
}

.grant-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.progress-track {
  width: 100%;
  height: 18px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--soul-gold), var(--accent-green));
  border-radius: var(--radius-full);
  transition: width 0.8s ease-out;
  position: relative;
}

.progress-markers {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
}

.step-card.active-phase {
  border: 2px solid var(--heart-red);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.08);
}

.step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.step-badge.current {
  background: var(--heart-red);
  color: #ffffff;
}

.step-badge.upcoming {
  background: #e2e8f0;
  color: var(--primary-700);
}

.step-badge.completed {
  background: var(--accent-green);
  color: #ffffff;
}

.step-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 13.5px;
  color: var(--primary-700);
  margin-bottom: 12px;
}

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--primary-800);
}

.check-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  background: #ffffff;
}

.check-box.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.check-box.in-progress {
  background: var(--soul-gold);
  border-color: var(--soul-gold);
}

/* ==========================================================================
   MEMBERS DIRECTORY
   ========================================================================== */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary-700);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-pill.active {
  background: var(--primary-900);
  color: #ffffff;
  border-color: var(--primary-900);
}

.search-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font-size: 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  outline: none;
}

.search-input:focus {
  border-color: var(--heart-red);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.member-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.member-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--primary-900);
  position: relative;
  flex-shrink: 0;
}

.avatar-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: var(--accent-green);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.member-info {
  display: flex;
  flex-direction: column;
}

.member-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-900);
}

.member-role {
  font-size: 12.5px;
  color: var(--primary-600);
  font-weight: 500;
}

.member-group-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
  align-self: flex-start;
}

.group-admin { background: #fee2e2; color: #991b1b; }
.group-media { background: #e0e7ff; color: #3730a3; }
.group-finance { background: #dcfce7; color: #166534; }
.group-outreach { background: #fef3c7; color: #92400e; }
.group-youth { background: #f3e8ff; color: #6b21a8; }

.member-contacts {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  color: var(--primary-700);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.contact-row:hover {
  color: var(--heart-red);
}

.member-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

.member-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--primary-800);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.member-btn:hover {
  background: #e2e8f0;
}

.member-btn.primary {
  background: var(--primary-900);
  color: #ffffff;
  border-color: var(--primary-900);
}

.member-btn.primary:hover {
  background: var(--primary-800);
}

/* ==========================================================================
   DATES & CALENDAR
   ========================================================================== */
.featured-event-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border-left: 6px solid var(--soul-gold);
}

.featured-event-date-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.featured-event-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.event-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
  margin-bottom: 20px;
  color: #e2e8f0;
}

.event-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.event-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn-rsvp {
  background: var(--soul-gold);
  color: #0f172a;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.btn-rsvp:hover {
  background: #fbbf24;
}

.btn-secondary-white {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary-white:hover {
  background: rgba(255, 255, 255, 0.25);
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-row {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s ease;
}

.event-row:hover {
  border-color: #cbd5e1;
}

.event-calendar-badge {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}

.event-month {
  font-size: 11px;
  font-weight: 800;
  color: var(--heart-red);
  text-transform: uppercase;
}

.event-day {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1;
}

.event-info {
  flex: 1;
}

.event-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-900);
}

.event-time-loc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   THE COMMONS (LOUNGE / Q&A FORUM)
   ========================================================================== */
.forum-thread-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.forum-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.vote-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  min-width: 44px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.vote-box:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.vote-box.upvoted {
  background: var(--heart-light);
  border-color: var(--heart-red);
  color: var(--heart-dark);
}

.vote-count {
  font-size: 14px;
  font-weight: 800;
}

.forum-content {
  flex: 1;
}

.forum-q-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: 6px;
  line-height: 1.35;
}

.forum-q-body {
  font-size: 14px;
  color: var(--primary-700);
  margin-bottom: 12px;
}

.forum-answers-container {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
  border-left: 3px solid var(--accent-green);
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.answer-badge {
  background: var(--accent-light);
  color: #065f46;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.answer-body {
  font-size: 13.5px;
  color: var(--primary-800);
  line-height: 1.5;
}

/* ==========================================================================
   AFFILIATES & COMMUNITY PARTNERS
   ========================================================================== */
.affiliates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.affiliate-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.affiliate-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-pledged { background: #dcfce7; color: #15803d; }
.badge-committed { background: #dbeafe; color: #1e40af; }
.badge-discussing { background: #fef3c7; color: #b45309; }
.badge-host { background: #f3e8ff; color: #6b21a8; }

.affiliate-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: 4px;
  padding-right: 80px;
}

.affiliate-type {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.affiliate-notes {
  font-size: 13.5px;
  color: var(--primary-700);
  margin-bottom: 14px;
  line-height: 1.5;
}

.affiliate-meta {
  font-size: 12.5px;
  color: var(--primary-600);
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  height: calc(var(--bottom-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 2px;
  position: relative;
  transition: color 0.15s ease;
}

.nav-item:hover {
  color: var(--primary-900);
}

.nav-item.active {
  color: var(--heart-red);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
  transition: transform 0.15s ease;
}

.nav-item.active svg {
  transform: translateY(-2px);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   MESSENGER SLIDE-OVER DRAWER
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.messenger-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  z-index: 550;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.messenger-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary-700);
  font-size: 16px;
}

.thread-selector {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  padding: 8px 12px;
  gap: 8px;
  background: #f8fafc;
}

.thread-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--primary-700);
  cursor: pointer;
  white-space: nowrap;
}

.thread-chip.active {
  background: var(--heart-red);
  color: #ffffff;
  border-color: var(--heart-red);
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
}

.msg-bubble.incoming {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary-900);
  border-bottom-left-radius: 4px;
}

.msg-bubble.outgoing {
  align-self: flex-end;
  background: var(--primary-900);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.75;
  text-align: right;
}

.chat-input-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  background: #ffffff;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
}

.chat-input:focus {
  border-color: var(--heart-red);
}

.chat-send-btn {
  background: var(--heart-red);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-900);
}

/* ==========================================================================
   DESKTOP RESPONSIVE REFINEMENTS
   ========================================================================== */
@media (min-width: 768px) {
  body {
    padding-bottom: 32px;
  }

  .site-header {
    border-bottom: none;
  }

  .desktop-nav-wrap {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
  }

  .desktop-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    gap: 4px;
    padding: 0 16px;
  }

  .desktop-nav-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-600);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
  }

  .desktop-nav-btn:hover {
    color: var(--primary-900);
  }

  .desktop-nav-btn.active {
    color: var(--heart-red);
    border-bottom-color: var(--heart-red);
  }

  .bottom-nav {
    display: none;
  }
}

@media (max-width: 767px) {
  .desktop-nav-wrap {
    display: none;
  }
}
