/* /connect/views/serve.css — Member "Serve" view v3 ("Vibrant Community")
 * Scoped layer loaded AFTER views.css so it wins the cascade.
 * Class prefix: servex-  (keeps clear of the legacy .srv-* block).
 * Uses only --bcc-* design tokens and shared bcc-* component classes. No
 * thematic palette hex; the only literals are #fff (on-primary ink, matching
 * the token button recipe) and translucent white/black gradient-hero overlays.
 * Breakpoints align with shell.css:
 *   desktop > 1024  |  tablet 768–1024  |  mobile ≤ 767  |  small ≤ 480
 * ================================================================ */

/* Hidden attribute must beat the grid/flex display rules below. */
.servex-wrap [hidden] { display: none !important; }

.servex-wrap {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s8);
  width:          100%;
  max-width:      1100px;
  margin:         0 auto;
  padding:        0 0 var(--bcc-s10);
}

/* 44px touch targets for every action button in this view. */
.servex-wrap .bcc-btn { min-height: 44px; }

/* ================================================================
   HERO — shared "vibrant community" gradient
=============================================================== */
.servex-hero {
  position:       relative;
  overflow:       hidden;
  display:        flex;
  flex-wrap:      wrap;
  align-items:    center;
  justify-content: space-between;
  gap:            var(--bcc-s5);
  border-radius:  var(--bcc-r-xl);
  border:         1px solid var(--bcc-border-strong);
  box-shadow:     var(--bcc-shadow-2);
  padding:        var(--bcc-s10);
  background:     linear-gradient(135deg,
                    var(--bcc-primary) 0%,
                    var(--bcc-primary-hover) 55%,
                    var(--bcc-accent) 130%);
  color:          #fff;
}
.servex-hero::after {
  content:    '';
  position:   absolute;
  inset:      0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 52%, rgba(0,0,0,.22) 100%);
  pointer-events: none;
}
.servex-hero-glow {
  position:      absolute;
  top:           -45%;
  right:         -8%;
  width:         340px;
  height:        340px;
  border-radius: 50%;
  background:    radial-gradient(circle, rgba(255,255,255,.22), rgba(255,255,255,0) 68%);
  pointer-events: none;
}
.servex-hero-body {
  position:   relative;
  z-index:    1;
  max-width:  620px;
}
.servex-hero-eyebrow {
  display:        inline-flex;
  align-items:    center;
  gap:            var(--bcc-s2);
  margin:         0 0 var(--bcc-s2);
  font-size:      var(--bcc-t-xs);
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color:          rgba(255,255,255,.9);
}
.servex-hero-title {
  margin:         0 0 var(--bcc-s2);
  font-family:    var(--bcc-font-display);
  font-size:      var(--bcc-t-4xl);
  font-weight:    600;
  line-height:    1.05;
  letter-spacing: -.01em;
  color:          #fff;
}
.servex-hero-sub {
  margin:      0;
  font-size:   var(--bcc-t-md);
  line-height: 1.5;
  color:       rgba(255,255,255,.85);
}
.servex-hero-actions {
  position: relative;
  z-index:  1;
}
.servex-hero-btn {
  height:       44px;
  background:  rgba(255,255,255,.14);
  color:       #fff;
  border:      1px solid rgba(255,255,255,.38);
  backdrop-filter: blur(3px);
}
.servex-hero-btn:hover {
  background:  rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.6);
}
.servex-hero-btn:focus-visible {
  outline:    none;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 4px rgba(0,0,0,.35);
}

/* ================================================================
   SECTIONS
=============================================================== */
.servex-section {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s4);
}
.servex-section-head {
  display:        flex;
  flex-wrap:      wrap;
  align-items:    baseline;
  gap:            var(--bcc-s2) var(--bcc-s3);
}
.servex-section-title {
  margin:         0;
  font-family:    var(--bcc-font-display);
  font-size:      var(--bcc-t-xl);
  font-weight:    600;
  letter-spacing: -.005em;
  color:          var(--bcc-ink);
}
.servex-section-sub {
  margin:      0;
  font-size:   var(--bcc-t-sm);
  color:       var(--bcc-ink-3);
}

/* ================================================================
   EMPTY / LOADING STATES
=============================================================== */
.servex-empty {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  gap:            var(--bcc-s2);
  padding:        var(--bcc-s8) var(--bcc-s6);
  background:     var(--bcc-surface-1);
  border:         1px dashed var(--bcc-border-strong);
  border-radius:  var(--bcc-r-xl);
  color:          var(--bcc-ink-3);
}
.servex-empty-chip {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           64px;
  height:          64px;
  margin-bottom:   var(--bcc-s1);
  border-radius:   var(--bcc-r-xl);
  background:      var(--bcc-primary-soft);
  color:           var(--bcc-primary);
  box-shadow:      inset 0 0 0 1px var(--bcc-border);
}
.servex-empty-chip .bcc-icon { width: 30px; height: 30px; }
.servex-empty-title {
  margin:      0;
  font-family: var(--bcc-font-display);
  font-size:   var(--bcc-t-lg);
  font-weight: 600;
  color:       var(--bcc-ink-2);
}
.servex-empty-sub {
  margin:    0 0 var(--bcc-s2);
  font-size: var(--bcc-t-sm);
  max-width: 380px;
}
.servex-guard { min-height: 320px; justify-content: center; }

.servex-skel-hero {
  min-height:     190px;
  border-radius:  var(--bcc-r-xl);
  border:         none;
  background:     linear-gradient(90deg,
                    var(--bcc-surface-2) 25%,
                    var(--bcc-surface-3) 50%,
                    var(--bcc-surface-2) 75%);
  background-size: 200% 100%;
}
.servex-skel-line { height: 96px; border-radius: var(--bcc-r-lg); }

/* ================================================================
   TAB BAR + PANELS — one Serve hub, four sections
================================================================ */
.servex-tabs {
  display:       flex;
  align-items:   stretch;
  gap:           var(--bcc-s2);
  padding:       var(--bcc-s1);
  overflow-x:    auto;
  overflow-y:    hidden;
  background:    var(--bcc-surface-1);
  border:        1px solid var(--bcc-border);
  border-radius: var(--bcc-r-pill);
  box-shadow:    var(--bcc-shadow-1);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.servex-tab {
  flex:            0 0 auto;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--bcc-s2);
  min-height:      44px;
  padding:         0 var(--bcc-s5);
  border:          none;
  border-radius:   var(--bcc-r-pill);
  background:      transparent;
  color:           var(--bcc-ink-3);
  font-family:     var(--bcc-font-body);
  font-size:       var(--bcc-t-sm);
  font-weight:     600;
  line-height:     1;
  white-space:     nowrap;
  cursor:          pointer;
  transition:      background var(--bcc-dur-2) var(--bcc-ease),
                   color     var(--bcc-dur-2) var(--bcc-ease),
                   box-shadow var(--bcc-dur-2) var(--bcc-ease);
}
.servex-tab:hover {
  color:       var(--bcc-ink);
  background:  var(--bcc-surface-2);
}
.servex-tab.is-active {
  background:  var(--bcc-primary);
  color:       #fff;
  box-shadow:  var(--bcc-shadow-1);
}
.servex-tab:focus-visible {
  outline:    none;
  box-shadow: 0 0 0 2px var(--bcc-primary);
}

.servex-tab-panel {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s4);
}
.servex-availability-host { width: 100%; }

/* ================================================================
   MY SERVING SCHEDULE — elevated rows with date blocks
=============================================================== */
.servex-schedule {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s3);
}
.servex-sched-row {
  position:       relative;
  display:        flex;
  align-items:    center;
  gap:            var(--bcc-s4);
  padding:        var(--bcc-s4);
  background:     var(--bcc-surface-1);
  border:         1px solid var(--bcc-border);
  border-radius:  var(--bcc-r-lg);
  box-shadow:     var(--bcc-shadow-1);
  transition:     border-color var(--bcc-dur-2) var(--bcc-ease),
                  box-shadow   var(--bcc-dur-2) var(--bcc-ease),
                  transform    var(--bcc-dur-2) var(--bcc-ease);
}
.servex-sched-row::before {
  content:       '';
  position:      absolute;
  left:          0;
  top:           var(--bcc-s4);
  bottom:        var(--bcc-s4);
  width:         3px;
  border-radius: 0 var(--bcc-r-pill) var(--bcc-r-pill) 0;
  background:    linear-gradient(180deg, var(--bcc-primary), var(--bcc-accent));
  opacity:       .0;
  transition:    opacity var(--bcc-dur-2) var(--bcc-ease);
}
.servex-sched-row:hover {
  border-color: var(--bcc-border-strong);
  box-shadow:   var(--bcc-shadow-2);
  transform:    translateY(-2px);
}
.servex-sched-row:hover::before { opacity: 1; }
.servex-date-block {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
  width:           60px;
  padding:         var(--bcc-s2) var(--bcc-s1);
  border-radius:   var(--bcc-r-md);
  background:      var(--bcc-primary-soft);
  color:           var(--bcc-primary);
  border:          1px solid var(--bcc-border);
  line-height:     1;
}
.servex-date-dow {
  font-size:      var(--bcc-t-xs);
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.servex-date-day {
  font-family: var(--bcc-font-display);
  font-size:   var(--bcc-t-2xl);
  font-weight: 600;
  margin:      2px 0;
  color:       var(--bcc-ink);
}
.servex-date-mon {
  font-size:      var(--bcc-t-xs);
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.servex-sched-main { flex: 1; min-width: 0; }
.servex-sched-role {
  font-family:   var(--bcc-font-display);
  font-size:     var(--bcc-t-lg);
  font-weight:   600;
  color:         var(--bcc-ink);
  overflow-wrap: anywhere;
}
.servex-sched-plan {
  font-size:     var(--bcc-t-sm);
  font-weight:   600;
  color:         var(--bcc-ink-2);
  overflow-wrap: anywhere;
}
.servex-sched-date {
  font-size: var(--bcc-t-xs);
  color:     var(--bcc-ink-3);
  margin-top: 2px;
}
.servex-sched-side {
  display:        flex;
  flex-direction: column;
  align-items:    flex-end;
  gap:            var(--bcc-s2);
  flex-shrink:    0;
}

/* "Awaiting you" badge — an assignment waiting on this member's response. */
.servex-badge-awaiting {
  box-shadow: inset 0 0 0 1px var(--bcc-info);
}

/* Member acceptance actions on an 'assigned' row or role card. */
.servex-accept-btn { font-weight: 600; }
.servex-decline-btn {
  background:   var(--bcc-surface-1);
  color:        var(--bcc-danger);
  border:       1px solid var(--bcc-border-strong);
  font-weight:  600;
}
.servex-decline-btn:hover {
  background:    var(--bcc-danger-soft);
  border-color:  var(--bcc-danger);
  color:         var(--bcc-danger);
}
.servex-decline-btn:focus-visible {
  outline:    none;
  box-shadow: 0 0 0 2px var(--bcc-danger-soft), 0 0 0 4px var(--bcc-danger);
}

/* ================================================================
   OPEN ROLES — cards with fill progress
=============================================================== */
.servex-roles {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap:                   var(--bcc-s4);
}
.servex-role-card {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s3);
  padding:        var(--bcc-s5);
  background:     var(--bcc-surface-1);
  border:         1px solid var(--bcc-border);
  border-radius:  var(--bcc-r-lg);
  box-shadow:     var(--bcc-shadow-1);
  transition:     border-color var(--bcc-dur-2) var(--bcc-ease),
                  box-shadow   var(--bcc-dur-2) var(--bcc-ease),
                  transform    var(--bcc-dur-2) var(--bcc-ease);
}
.servex-role-card:hover {
  border-color: var(--bcc-border-strong);
  box-shadow:   var(--bcc-shadow-2);
  transform:    translateY(-2px);
}
.servex-role-top {
  display:     flex;
  align-items: flex-start;
  gap:         var(--bcc-s3);
}
.servex-role-icon {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           42px;
  height:          42px;
  border-radius:   var(--bcc-r-md);
  background:      var(--bcc-primary-soft);
  color:           var(--bcc-primary);
  font-size:       1.1rem;
  flex-shrink:     0;
}
.servex-role-head { flex: 1; min-width: 0; }
.servex-role-name {
  margin:        0;
  font-family:   var(--bcc-font-display);
  font-size:     var(--bcc-t-lg);
  font-weight:   600;
  color:         var(--bcc-ink);
  overflow-wrap: anywhere;
}
.servex-role-plan {
  margin:      2px 0 0;
  font-size:   var(--bcc-t-sm);
  font-weight: 600;
  color:       var(--bcc-ink-2);
}
.servex-role-date {
  margin:    0;
  font-size: var(--bcc-t-xs);
  color:     var(--bcc-ink-3);
}
.servex-role-meta {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}
.servex-count {
  font-size:      var(--bcc-t-xs);
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color:          var(--bcc-ink-3);
}
.servex-role-card .servex-progress { height: 8px; }
.servex-role-actions {
  display:     flex;
  align-items: center;
  gap:         var(--bcc-s2);
  margin-top:  auto;
}
.servex-role-actions .bcc-btn { min-height: 44px; }

/* ================================================================
   MINISTRY TEAMS
=============================================================== */
.servex-teams {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:                   var(--bcc-s4);
}
.servex-team-card {
  display:        flex;
  flex-direction: column;
  align-items:    stretch;
  gap:            var(--bcc-s3);
  padding:        var(--bcc-s4);
  background:     var(--bcc-surface-1);
  border:         1px solid var(--bcc-border);
  border-radius:  var(--bcc-r-lg);
  box-shadow:     var(--bcc-shadow-1);
  transition:     border-color var(--bcc-dur-2) var(--bcc-ease),
                  box-shadow   var(--bcc-dur-2) var(--bcc-ease),
                  transform    var(--bcc-dur-2) var(--bcc-ease);
}
.servex-team-card:hover {
  border-color: var(--bcc-border-strong);
  box-shadow:   var(--bcc-shadow-2);
  transform:    translateY(-2px);
}
.servex-team-avatar {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           44px;
  height:          44px;
  border-radius:   var(--bcc-r-pill);
  background:      var(--bcc-primary-soft);
  color:           var(--bcc-primary);
  font-weight:     700;
  font-size:       var(--bcc-t-md);
  flex-shrink:     0;
  overflow:        hidden;
}
.servex-team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.servex-team-body { flex: 1; min-width: 0; }
.servex-team-type { margin-bottom: var(--bcc-s2); }
.servex-team-name {
  margin:        0 0 var(--bcc-s1);
  font-family:   var(--bcc-font-display);
  font-size:     var(--bcc-t-lg);
  font-weight:   600;
  color:         var(--bcc-ink);
  overflow-wrap: anywhere;
}
.servex-team-desc {
  margin:      0 0 var(--bcc-s3);
  font-size:   var(--bcc-t-sm);
  color:       var(--bcc-ink-2);
  line-height: 1.5;
}
.servex-team-actions {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         var(--bcc-s2);
}
.servex-team-actions .bcc-btn { min-height: 44px; }

/* Joined state + the single preferences editor per joined team. */
.servex-teams datalist { display: none; }
.servex-team-card.is-joined {
  border-color: var(--bcc-primary);
  box-shadow:   var(--bcc-shadow-2);
}
.servex-team-top {
  display:     flex;
  align-items: flex-start;
  gap:         var(--bcc-s3);
}
.servex-team-card.is-joined .servex-team-avatar {
  background: var(--bcc-primary);
  color:      #fff;
}
.servex-team-prefs {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s3);
  width:          100%;
  margin-top:     var(--bcc-s3);
  padding-top:    var(--bcc-s3);
  border-top:     1px solid var(--bcc-border);
}
.servex-pref-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap:                   var(--bcc-s3);
}
.servex-pref-field {
  display:        flex;
  flex-direction: column;
  gap:            var(--bcc-s1);
  min-width:      0;
}
.servex-pref-label {
  font-size:      var(--bcc-t-xs);
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color:          var(--bcc-ink-3);
}
.servex-pref-actions {
  display:         flex;
  align-items:     center;
  justify-content: flex-end;
  gap:             var(--bcc-s2);
}
.servex-pref-actions .bcc-btn { min-height: 44px; }

/* ================================================================
   RESPONSIVE — tablet 768–1024
=============================================================== */
@media (max-width: 1024px) {
  .servex-roles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .servex-hero   { padding: var(--bcc-s8); }
}

/* ================================================================
   RESPONSIVE — mobile ≤ 767
=============================================================== */
@media (max-width: 767px) {
  .servex-wrap { gap: var(--bcc-s6); }
  .servex-hero { padding: var(--bcc-s6) var(--bcc-s5); }
  .servex-hero-title { font-size: var(--bcc-t-3xl); }
  .servex-hero-actions { width: 100%; }
  .servex-hero-btn { width: 100%; }

  .servex-roles,
  .servex-teams { grid-template-columns: 1fr; }

  .servex-sched-row { flex-wrap: wrap; align-items: flex-start; }
  .servex-sched-side {
    flex-direction:  row;
    align-items:     center;
    justify-content: space-between;
    width:           100%;
  }
  .servex-sched-side .bcc-btn { min-height: 44px; }

  /* Tabs scroll horizontally on mobile. */
  .servex-tabs {
    border-radius: var(--bcc-r-lg);
    margin:        0 calc(-1 * var(--bcc-s1));
    padding:       var(--bcc-s1);
  }
  .servex-tab { padding: 0 var(--bcc-s4); }
}

/* ================================================================
   RESPONSIVE — small phone ≤ 480
=============================================================== */
@media (max-width: 480px) {
  .servex-hero-title { font-size: var(--bcc-t-2xl); }
  .servex-date-block { width: 50px; }
  .servex-date-day   { font-size: var(--bcc-t-xl); }
  .servex-role-card,
  .servex-team-card  { padding: var(--bcc-s4); }
  .servex-sched-row  { padding: var(--bcc-s3); gap: var(--bcc-s3); }
}

/* ================================================================
   REDUCED MOTION
=============================================================== */
@media (prefers-reduced-motion: reduce) {
  .servex-wrap *,
  .servex-wrap *::before,
  .servex-wrap *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .servex-role-card:hover,
  .servex-team-card:hover,
  .servex-sched-row:hover { transform: none; }
  .servex-role-card .bcc-progress-bar { transition: none; }
}
