/* ═══════════════════════════════════════════════════════════
   FCC Chore Point Values Premium — chore-point-values-premium.css
   Scoped to #chorePoints / .cpv-* classes.
   Loads after core stylesheets so it wins specificity ties.
   ═══════════════════════════════════════════════════════════ */

#chorePoints {
  --cpv-purple:       #7c3aed;
  --cpv-purple-deep:  #5b21b6;
  --cpv-purple-light: #a78bfa;
  --cpv-pink:         #ec4899;
  --cpv-ink:          #17142f;
  --cpv-muted:        #6f6a8f;
  --cpv-line:         rgba(124, 58, 237, 0.18);
  --cpv-card-shadow:  0 20px 60px rgba(65, 35, 120, 0.10);
  --cpv-btn-shadow:   0 10px 24px rgba(124, 58, 237, 0.22);
  --cpv-danger:       #ef4444;
}

#chorePoints .cpv-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 24px 52px;
}

/* ── Hero ─────────────────────────────────────────────────── */
#chorePoints .cpv-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(120deg, #ede4ff 0%, #e3d4ff 45%, #d8c5ff 100%);
  border: 1px solid var(--cpv-line);
  border-radius: 26px;
  padding: 30px 34px;
  box-shadow: var(--cpv-card-shadow);
  overflow: hidden;
}

#chorePoints .cpv-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 8% 100%, rgba(255, 255, 255, 0.35) 0%, transparent 40%);
  pointer-events: none;
}

#chorePoints .cpv-hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

#chorePoints .cpv-hero-icon-wrap {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  box-shadow: 0 10px 24px rgba(109, 40, 217, 0.35);
}

#chorePoints .cpv-hero-text {
  min-width: 0;
}

#chorePoints .cpv-hero-title {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--cpv-ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#chorePoints .cpv-hero-subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--cpv-purple-deep);
  max-width: 56ch;
}

#chorePoints .cpv-hero-art {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: min(210px, 24vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

#chorePoints .cpv-hero-art svg {
  display: block;
  width: 100%;
  height: auto;
}

#chorePoints .cpv-hero-spark {
  position: absolute;
  z-index: 1;
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

#chorePoints .cpv-hero-spark-1 { top: 24px; right: 36%; font-size: 16px; }
#chorePoints .cpv-hero-spark-2 { top: 62px; right: 29%; font-size: 10px; }
#chorePoints .cpv-hero-spark-3 { bottom: 28px; right: 43%; font-size: 12px; }

/* ── Read-only notice ─────────────────────────────────────── */
#chorePoints .cpv-readonly-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--cpv-line);
  border-radius: 18px;
  padding: 16px 22px;
  color: var(--cpv-purple-deep);
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.08);
  line-height: 1.5;
}

#chorePoints .cpv-readonly-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* ── Form Card ────────────────────────────────────────────── */
#chorePoints .cpv-form-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--cpv-line);
  border-radius: 24px;
  padding: 28px 30px;
  box-shadow: var(--cpv-card-shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#chorePoints .cpv-form-card.cpv-editing {
  border-color: var(--cpv-purple);
  box-shadow: var(--cpv-card-shadow), 0 0 0 3px rgba(124, 58, 237, 0.08);
}

#chorePoints .cpv-form-header {
  margin-bottom: 22px;
}

#chorePoints .cpv-form-title {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 700;
  color: var(--cpv-ink);
}

#chorePoints .cpv-form-help {
  margin: 0;
  font-size: 13.5px;
  color: var(--cpv-muted);
  line-height: 1.5;
}

#chorePoints .cpv-form-body {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  row-gap: 14px;
}

#chorePoints .cpv-form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 220px;
  min-width: 0;
}

#chorePoints .cpv-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--cpv-ink);
  letter-spacing: 0.01em;
}

#chorePoints .cpv-input {
  padding: 11px 16px;
  border: 1.5px solid var(--cpv-line);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--cpv-ink);
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

#chorePoints .cpv-input::placeholder {
  color: #b5b2cc;
}

#chorePoints .cpv-input:focus {
  border-color: var(--cpv-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

#chorePoints .cpv-input--points {
  max-width: 150px;
  width: 150px;
}

#chorePoints .cpv-form-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 1px;
}

#chorePoints .cpv-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  border: none;
  cursor: pointer;
  box-shadow: var(--cpv-btn-shadow);
  transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
  white-space: nowrap;
  line-height: 1;
}

#chorePoints .cpv-btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.28);
}

#chorePoints .cpv-btn-primary:active {
  transform: translateY(0);
  opacity: 1;
}

#chorePoints .cpv-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--cpv-purple);
  background: rgba(124, 58, 237, 0.07);
  border: 1.5px solid var(--cpv-line);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  white-space: nowrap;
  line-height: 1;
}

#chorePoints .cpv-btn-secondary:hover {
  background: rgba(124, 58, 237, 0.13);
  border-color: var(--cpv-purple);
}

/* ── Table Card ───────────────────────────────────────────── */
#chorePoints .cpv-table-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--cpv-line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--cpv-card-shadow);
}

#chorePoints .cpv-table-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 28px 16px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.09);
}

#chorePoints .cpv-table-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--cpv-ink);
}

#chorePoints .cpv-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.09) 0%, rgba(236, 72, 153, 0.09) 100%);
  border: 1px solid var(--cpv-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--cpv-purple);
  white-space: nowrap;
}

#chorePoints .cpv-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#chorePoints .cpv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

#chorePoints .cpv-table thead tr {
  background: linear-gradient(120deg, #f5f0ff 0%, #ede8ff 100%);
}

#chorePoints .cpv-table thead th {
  padding: 13px 22px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cpv-purple-deep);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  border: none;
}

#chorePoints .cpv-table thead th.cpv-th-actions {
  text-align: right;
}

#chorePoints .cpv-table tbody tr {
  border-bottom: 1px solid rgba(124, 58, 237, 0.07);
  transition: background 0.14s;
}

#chorePoints .cpv-table tbody tr:last-child {
  border-bottom: none;
}

#chorePoints .cpv-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.033);
}

#chorePoints .cpv-table tbody td {
  padding: 15px 22px;
  color: var(--cpv-ink);
  vertical-align: middle;
  border: none;
}

#chorePoints .cpv-task-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--cpv-ink);
}

/* ── Points badge ──────────────────────────────────────────── */
#chorePoints .cpv-pts-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Action buttons ────────────────────────────────────────── */
#chorePoints .cpv-actions-cell {
  text-align: right;
  white-space: nowrap;
}

#chorePoints .cpv-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
  margin-left: 7px;
  vertical-align: middle;
}

#chorePoints .cpv-icon-btn:first-child {
  margin-left: 0;
}

#chorePoints .cpv-icon-btn--edit {
  color: var(--cpv-purple);
  border-color: rgba(124, 58, 237, 0.25);
}

#chorePoints .cpv-icon-btn--edit:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: var(--cpv-purple);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.14);
}

#chorePoints .cpv-icon-btn--delete {
  color: var(--cpv-danger);
  border-color: rgba(239, 68, 68, 0.22);
}

#chorePoints .cpv-icon-btn--delete:hover {
  background: rgba(239, 68, 68, 0.07);
  border-color: var(--cpv-danger);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.12);
}

/* ── Empty state ──────────────────────────────────────────── */
#chorePoints .cpv-empty-row td {
  text-align: center;
  padding: 52px 24px;
}

#chorePoints .cpv-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#chorePoints .cpv-empty-icon {
  font-size: 38px;
  opacity: 0.55;
}

#chorePoints .cpv-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--cpv-ink);
  margin: 0;
}

#chorePoints .cpv-empty-sub {
  font-size: 14px;
  color: var(--cpv-muted);
  margin: 0;
  max-width: 38ch;
  line-height: 1.6;
}

/* ── Mobile 768px ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #chorePoints .cpv-shell {
    padding: 16px 12px 44px;
    gap: 14px;
  }

  #chorePoints .cpv-hero {
    flex-direction: column;
    padding: 22px 20px 20px;
    gap: 12px;
  }

  #chorePoints .cpv-hero-art {
    display: none;
  }

  #chorePoints .cpv-hero-spark {
    display: none;
  }

  #chorePoints .cpv-hero-title {
    font-size: 22px;
  }

  #chorePoints .cpv-form-card {
    padding: 20px;
  }

  #chorePoints .cpv-form-body {
    flex-direction: column;
    align-items: stretch;
  }

  #chorePoints .cpv-input--points {
    max-width: none;
    flex: auto;
  }

  #chorePoints .cpv-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #chorePoints .cpv-btn-primary,
  #chorePoints .cpv-btn-secondary {
    width: 100%;
    padding: 14px 22px;
    font-size: 15px;
  }

  #chorePoints .cpv-table-header {
    padding: 16px 18px 12px;
  }

  #chorePoints .cpv-table thead th,
  #chorePoints .cpv-table tbody td {
    padding: 12px 15px;
  }
}

/* ── Mobile 480px — stacked card rows ────────────────────── */
@media (max-width: 480px) {
  #chorePoints .cpv-table-wrap {
    overflow-x: visible;
  }

  #chorePoints .cpv-table,
  #chorePoints .cpv-table thead,
  #chorePoints .cpv-table tbody,
  #chorePoints .cpv-table tr,
  #chorePoints .cpv-table th,
  #chorePoints .cpv-table td {
    display: block;
  }

  #chorePoints .cpv-table thead {
    display: none;
  }

  #chorePoints .cpv-table tbody tr {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.09);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #chorePoints .cpv-table tbody tr:last-child {
    border-bottom: none;
  }

  #chorePoints .cpv-table tbody td {
    padding: 0;
  }

  #chorePoints .cpv-actions-cell {
    text-align: left;
    display: flex;
    gap: 8px;
  }

  #chorePoints .cpv-icon-btn {
    margin-left: 0;
    width: 42px;
    height: 42px;
    font-size: 17px;
    border-radius: 12px;
  }
}
