/* ============================================================
   FCC Family Huddle — premium page styles
   Scoped under #meeting (page section) + .fhp- modal layer (body).
   ============================================================ */

#meeting .family-huddle-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Hero ── */

/* The image itself is the hero card — no outer white box around it. */
#meeting .family-huddle-hero-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#meeting .family-huddle-hero-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 28px;
  box-shadow:
    0 24px 70px rgba(91, 71, 255, 0.18),
    0 10px 24px rgba(168, 85, 247, 0.14);
}

/* Dynamic current-week pill, positioned over the (now blank) pill area
   baked into the artwork. Percentages track the image, so it scales. */
#meeting .family-huddle-week-pill {
  position: absolute;
  left: 3.4%;
  bottom: 16.5%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 30%;
  padding: clamp(7px, 1.1vw, 14px) clamp(12px, 1.7vw, 26px);
  border-radius: 999px;
  color: #ffffff;
  font-size: clamp(0.62rem, 1.3vw, 1.06rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 12px 26px rgba(67, 56, 202, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#meeting .family-huddle-week-icon {
  display: inline-grid;
  place-items: center;
  font-size: 1em;
}

/* ── Layout ── */

#meeting .family-huddle-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  margin-top: 22px;
}

#meeting .family-huddle-main-col {
  min-width: 0;
}

#meeting .family-huddle-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

#meeting .huddle-side-rail {
  display: grid;
  gap: 18px;
  align-content: start;
}

/* ── Cards ── */

#meeting .huddle-card {
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(139, 92, 246, 0.14);
  box-shadow:
    0 18px 45px rgba(76, 29, 149, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 20px;
}

#meeting .huddle-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

#meeting .huddle-card-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(236, 72, 153, 0.12));
  color: #7c3aed;
}

#meeting .huddle-card-heading {
  min-width: 0;
}

#meeting .huddle-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #160b46;
}

#meeting .huddle-card-subtitle {
  margin: 3px 0 0;
  font-size: 0.84rem;
  color: #746a94;
}

#meeting .huddle-card-subtitle:empty {
  display: none;
}

/* ── Focus chips ── */

#meeting .huddle-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#meeting .huddle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.14);
  color: #2d195f;
  font-size: 0.86rem;
  font-weight: 650;
}

#meeting .huddle-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  flex: 0 0 8px;
}

#meeting .huddle-chip-text {
  overflow-wrap: anywhere;
}

/* ── Inputs ── */

#meeting .huddle-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

#meeting .huddle-input-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(255, 255, 255, 0.84);
  padding: 12px 14px;
  font-size: 0.88rem;
  color: #1f164d;
  outline: none;
}

#meeting .huddle-input-row input[type="text"]:focus {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

#meeting .huddle-input-row input[type="text"]::placeholder {
  color: #9a90ba;
}

#meeting .huddle-add-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  background: linear-gradient(135deg, #7c3aed, #d946ef);
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#meeting .huddle-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.3);
}

#meeting .huddle-add-btn-compact {
  width: 42px;
  flex: 0 0 42px;
  padding: 11px 0;
  font-size: 1rem;
  line-height: 1;
}

#meeting .fhp-action-type-select {
  /* global select{width:100%} would otherwise swallow the whole row */
  width: 96px;
  flex: 0 0 96px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(255, 255, 255, 0.84);
  color: #4c3a82;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 10px 8px;
  outline: none;
  cursor: pointer;
}

/* ── List rows ── */

#meeting .huddle-list {
  display: grid;
  gap: 8px;
}

#meeting .huddle-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(139, 92, 246, 0.1);
}

#meeting .huddle-row-main {
  flex: 1;
  min-width: 0;
}

#meeting .huddle-row-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f164d;
  overflow-wrap: anywhere;
}

#meeting .huddle-row-meta {
  font-size: 0.75rem;
  color: #7b7198;
  margin-top: 2px;
}

#meeting .fhp-topic-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
  border: 3px solid #c084fc;
  background: #fff;
}

#meeting .huddle-list-row:nth-child(2n) .fhp-topic-dot {
  border-color: #f472b6;
}

#meeting .huddle-list-row:nth-child(3n) .fhp-topic-dot {
  border-color: #60a5fa;
}

/* ── Action items ── */

#meeting .fhp-action-check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #7c3aed;
  cursor: pointer;
}

#meeting .fhp-action-check:disabled {
  cursor: default;
}

#meeting .fhp-action-done .huddle-row-title {
  text-decoration: line-through;
  color: #8d84ab;
}

#meeting .huddle-type-badge {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.12);
  white-space: nowrap;
}

#meeting .fhp-badge-calendar {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.16);
}

#meeting .fhp-badge-reminder {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.18);
}

#meeting .fhp-badge-chore {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.18);
}

#meeting .fhp-badge-task {
  background: rgba(236, 72, 153, 0.1);
  color: #be185d;
  border-color: rgba(236, 72, 153, 0.16);
}

#meeting .fhp-badge-note {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.16);
}

/* ── Delete buttons ── */

#meeting .fhp-row-delete {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.12s ease, background 0.12s ease;
}

#meeting .fhp-row-delete:hover {
  opacity: 1;
  background: rgba(225, 29, 72, 0.12);
  color: #be123c;
}

/* ── Avatars ── */

#meeting .fhp-avatar,
.fhp-modal .fhp-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(236, 72, 153, 0.14));
  color: #6d28d9;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid rgba(139, 92, 246, 0.18);
}

#meeting .fhp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#meeting .fhp-avatar-emoji {
  font-size: 1rem;
}

/* ── Empty states ── */

#meeting .huddle-empty {
  border-radius: 16px;
  border: 1px dashed rgba(139, 92, 246, 0.24);
  background: rgba(124, 58, 237, 0.04);
  color: #7b7198;
  font-size: 0.85rem;
  padding: 16px 14px;
  text-align: center;
}

/* ── Snapshot rail ── */

#meeting .fhp-week-pill {
  display: block;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
  background: rgba(124, 58, 237, 0.07);
  border: 1px solid rgba(124, 58, 237, 0.13);
  color: #2d195f;
  font-size: 0.86rem;
  font-weight: 750;
  margin-bottom: 6px;
}

#meeting .huddle-snapshot-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

#meeting .fhp-stat-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#meeting .fhp-stat-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.12);
}

#meeting .fhp-stat-count {
  font-size: 1.05rem;
  font-weight: 850;
  color: #160b46;
  min-width: 18px;
}

#meeting .fhp-stat-label {
  font-size: 0.85rem;
  font-weight: 650;
  color: #4c3a82;
}

#meeting .fhp-snapshot-dates {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

#meeting .fhp-snapshot-date {
  display: flex;
  align-items: center;
  gap: 10px;
}

#meeting .fhp-date-label {
  font-size: 0.78rem;
  font-weight: 750;
  color: #160b46;
}

#meeting .fhp-date-value {
  font-size: 0.78rem;
  color: #7b7198;
}

#meeting .fhp-snapshot-actions {
  margin-top: 16px;
}

#meeting .huddle-primary-btn,
#meeting .huddle-secondary-btn {
  width: 100%;
  border-radius: 16px;
  padding: 13px 15px;
  font-weight: 850;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#meeting .huddle-primary-btn {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #6d4dff, #d946ef);
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.22);
}

#meeting .huddle-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(124, 58, 237, 0.3);
}

#meeting .huddle-secondary-btn {
  margin-top: 10px;
  color: #7c3aed;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(124, 58, 237, 0.22);
}

#meeting .huddle-secondary-btn:hover {
  background: rgba(124, 58, 237, 0.06);
}

/* ── Past huddles ── */

#meeting .past-huddles-section {
  margin-top: 18px;
}

#meeting .past-huddle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#meeting .fhp-past-card {
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.12);
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#meeting .fhp-past-range {
  font-size: 0.88rem;
  font-weight: 800;
  color: #160b46;
}

#meeting .fhp-past-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4c3a82;
}

#meeting .fhp-past-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

#meeting .fhp-archived-badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.14);
}

#meeting .fhp-view-btn,
.fhp-modal .fhp-view-btn {
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.22);
  background: rgba(255, 255, 255, 0.85);
  color: #7c3aed;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}

#meeting .fhp-view-btn:hover,
.fhp-modal .fhp-view-btn:hover {
  background: rgba(124, 58, 237, 0.07);
}

#meeting .fhp-view-all-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(139, 92, 246, 0.26);
  background: rgba(124, 58, 237, 0.04);
  transition: background 0.12s ease;
  font: inherit;
}

#meeting .fhp-view-all-card:hover {
  background: rgba(124, 58, 237, 0.08);
}

#meeting .fhp-view-all-icon {
  font-size: 1.4rem;
}

#meeting .fhp-view-all-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #2d195f;
}

#meeting .fhp-view-all-sub {
  font-size: 0.76rem;
  color: #7b7198;
}

#meeting .fhp-past-empty {
  padding: 26px 14px;
}

/* ── Modal (appended to body, not inside #meeting) ── */

.fhp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 11, 70, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fhp-modal {
  width: min(560px, 100%);
  max-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 255, 0.96));
  border: 1px solid rgba(139, 92, 246, 0.16);
  box-shadow: 0 30px 80px rgba(46, 16, 101, 0.32);
  overflow: hidden;
}

.fhp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.fhp-modal-title {
  font-size: 1rem;
  font-weight: 850;
  color: #160b46;
}

.fhp-modal-close {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.fhp-modal-body {
  padding: 14px 20px 20px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.fhp-modal-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #2d195f;
  margin-bottom: 6px;
}

.fhp-modal-list {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: #1f164d;
}

.fhp-modal-by {
  color: #7b7198;
  font-size: 0.78rem;
}

.fhp-modal .huddle-type-badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.12);
}

.fhp-modal-archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.12);
  background: rgba(255, 255, 255, 0.78);
  padding: 12px 14px;
}

.fhp-modal-archive-row .fhp-past-range {
  font-size: 0.86rem;
  font-weight: 800;
  color: #160b46;
}

.fhp-modal-archive-row .fhp-past-counts {
  display: flex;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #4c3a82;
}

/* ── Responsive ── */

@media (max-width: 1100px) {
  #meeting .family-huddle-dashboard {
    grid-template-columns: 1fr;
  }

  #meeting .huddle-side-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #meeting .past-huddle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #meeting .family-huddle-page {
    padding: 14px;
  }

  #meeting .family-huddle-hero-image {
    border-radius: 22px;
  }

  #meeting .family-huddle-week-pill {
    gap: 6px;
    min-width: 0;
    max-width: 52%;
  }

  #meeting .family-huddle-main-grid {
    grid-template-columns: 1fr;
  }

  #meeting .huddle-side-rail {
    grid-template-columns: 1fr;
  }

  #meeting .past-huddle-grid {
    grid-template-columns: 1fr;
  }

  #meeting .huddle-input-row {
    flex-wrap: wrap;
  }

  #meeting .huddle-add-btn {
    padding-inline: 13px;
  }
}
