/**
 * MD-SETTINGS.CSS — Styles for Settings screen
 * Theo prototype my-ai-nb-v1.4.html
 */

/* ============================================================
   SETTINGS SECTION
   ============================================================ */
.set-sec {
  background: var(--md-w);
  border-radius: var(--md-r-lg);
  padding: 0;
  margin-bottom: 16px;
  box-shadow: var(--md-sh-sm);
  overflow: hidden;
}

.set-t {
  font-family: var(--md-font-h);
  font-size: 1rem;
  font-weight: 700;
  color: var(--md-g7);
  padding: 14px 16px 8px;
}

.set-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--md-g1);
  font-size: .88rem;
}

.set-item:last-child {
  border-bottom: none;
}

.set-ic {
  width: 36px;
  height: 36px;
  border-radius: var(--md-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.set-txt {
  flex: 1;
  font-size: .92rem;
  font-weight: 400;
  color: var(--md-g7);
  font-weight: 600;
}

.set-arr {
  color: var(--md-g4);
  font-size: 0.8rem;
}

/* ============================================================
   TOGGLE (.tog)
   ============================================================ */
.tog {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--md-r-full);
  cursor: pointer;
  transition: background 0.2s ease;
}

.tog::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 20px;
  height: 20px;
  background: var(--md-w);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s ease;
}

.tog.off {
  background: var(--md-g3);
}

.tog.off::after {
  left: 2px;
}

.tog.on {
  background: var(--md-primary);
}

.tog.on::after {
  left: 22px;
}

/* ============================================================
   HOME OPTION (Device toggles)
   ============================================================ */
.home-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--md-w);
  border: 1.5px solid var(--md-g2);
  border-radius: var(--md-r-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.home-option:hover {
  border-color: var(--md-primary-border);
}

.home-option.selected {
  border-color: var(--md-primary);
  background: var(--md-primary-pale);
}

.ho-icon {
  font-size: 1.2rem;
  width: 32px;
  text-align: center;
}

.ho-label {
  font-size: var(--md-fs-sm);
  font-weight: 600;
  color: var(--md-g8);
}

.ho-desc {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  margin-top: 2px;
}

.home-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--md-g3);
  border-radius: var(--md-r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  background: var(--md-w);
  transition: all 0.15s ease;
}

.home-option.selected .home-check {
  border-color: var(--md-primary);
  background: var(--md-primary);
  color: var(--md-w);
}

/* ============================================================
   MEMBER CARD
   ============================================================ */
.member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--md-g0);
  border-radius: var(--md-r-md);
}

.member-av {
  width: 40px;
  height: 40px;
  border-radius: var(--md-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* ============================================================
   PILLS (selectable chips)
   ============================================================ */
.pill {
  padding: 6px 14px;
  font-size: var(--md-fs-sm);
  font-weight: 600;
  color: var(--md-g6);
  background: var(--md-w);
  border: 1.5px solid var(--md-g2);
  border-radius: var(--md-r-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  border-color: var(--md-primary-border);
}

.pill.on {
  background: var(--md-primary-pale);
  border-color: var(--md-primary);
  color: var(--md-primary);
}

/* ============================================================
   RULE EDIT BUTTON
   ============================================================ */
.rule-edit {
  padding: 4px 10px;
  font-size: var(--md-fs-xs);
  font-weight: 600;
  color: var(--md-primary);
  background: var(--md-w);
  border: 1px solid var(--md-primary-border);
  border-radius: var(--md-r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rule-edit:hover {
  background: var(--md-primary-pale);
}

/* ============================================================
   ADD BUTTON
   ============================================================ */
.add-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #F97316;
  background: var(--md-w);
  border: 1.5px dashed #F97316;
  border-radius: var(--md-r-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.add-btn:hover {
  background: #FFF7ED;
  border-style: solid;
}

/* ============================================================
   ANIMATION
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   SETTINGS V3 — Rules, Rewards, Penalties
   ============================================================ */
.set-panel {
  display: none;
  padding: 8px 16px 12px;
  animation: fadeIn .2s ease;
}

.set-panel.open {
  display: block;
}

.set-desc {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  padding: 0 16px 8px;
}

.empty-list {
  padding: 16px;
  text-align: center;
  font-size: var(--md-fs-sm);
  color: var(--md-g4);
}

/* Member */
.member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--md-g0);
  border-radius: var(--md-r-md);
  margin-bottom: 8px;
}

.member-av {
  width: 40px;
  height: 40px;
  border-radius: var(--md-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--md-primary-pale);
}

.member-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--md-g9);
}

.member-role {
  font-size: var(--md-fs-sm);
  color: var(--md-g5);
}

/* Device option */
.device-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--md-w);
  border: 1.5px solid var(--md-g2);
  border-radius: var(--md-r-md);
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

.device-opt.selected {
  border-color: var(--md-primary);
  background: var(--md-primary-pale);
}

.device-icon { font-size: 1.3rem; }
.device-label { flex: 1; font-size: 1rem; font-weight: 600; }
.device-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--md-g3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
}

.device-opt.selected .device-check {
  border-color: var(--md-primary);
  background: var(--md-primary);
  color: var(--md-w);
}

/* Rule card */
.rule-card {
  margin: 0 16px 8px;
  padding: 12px;
  background: var(--md-w);
  border-radius: var(--md-r-md);
  box-shadow: var(--md-sh-sm);
}

.rule-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.rule-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--md-r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.rule-name {
  flex: 1;
  font-weight: 700;
  font-size: 1rem;
  color: var(--md-g8);
}

.rule-pts {
  font-weight: 800;
  font-size: var(--md-fs-sm);
  color: var(--md-primary);
}

.rule-pts.neg {
  color: var(--md-err);
}

.rule-desc {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  line-height: 1.5;
  margin-bottom: 8px;
}

.rule-acts {
  display: flex;
  gap: 6px;
}

.rule-acts button {
  padding: 4px 10px;
  font-size: var(--md-fs-xs);
  background: var(--md-g1);
  border: none;
  border-radius: var(--md-r-sm);
  cursor: pointer;
}

/* Reward card */
.reward-card, .penalty-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 12px;
  background: var(--md-w);
  border-radius: var(--md-r-md);
  box-shadow: var(--md-sh-sm);
}

.reward-icon, .penalty-icon {
  font-size: 1.5rem;
}

.reward-name, .penalty-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--md-g8);
}

.reward-cost {
  font-size: var(--md-fs-xs);
  color: var(--md-primary);
  font-weight: 600;
}

.penalty-lose {
  font-size: var(--md-fs-xs);
  color: var(--md-err);
  font-weight: 600;
}

.reward-acts, .penalty-acts {
  display: flex;
  gap: 4px;
}

.reward-acts button, .penalty-acts button {
  padding: 4px 8px;
  font-size: var(--md-fs-xs);
  background: var(--md-g1);
  border: none;
  border-radius: var(--md-r-sm);
  cursor: pointer;
}

/* Modal */
.modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: var(--md-fs-md);
}

.modal-close {
  cursor: pointer;
  padding: 4px;
  color: var(--md-g4);
}

.modal-acts {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-acts button {
  flex: 1;
}

.input-hint {
  font-size: var(--md-fs-xs);
  color: var(--md-g4);
  margin-top: 4px;
}

/* Icon picker */
.icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.icon-opt {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid var(--md-g2);
  border-radius: var(--md-r-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-opt.on {
  border-color: var(--md-primary);
  background: var(--md-primary-pale);
}

/* Edit button */
.edit-btn {
  padding: 4px 8px;
  font-size: var(--md-fs-xs);
  background: var(--md-w);
  border: 1px solid var(--md-g2);
  border-radius: var(--md-r-sm);
  cursor: pointer;
}

/* VIP badge */
.vip-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  background: var(--md-secondary);
  color: var(--md-w);
  border-radius: var(--md-r-full);
  margin-left: 6px;
}

/* Family code */
.family-code {
  font-family: var(--md-font-h);
  font-weight: 800;
  color: var(--md-primary);
  letter-spacing: 0.05em;
}
/**
 * MD-SETTINGS.CSS — Settings screen (v4.0 — My.Dreams 2.1)
 * Bổ sung: feat-group, feat-item, device-desc, device-hint
 * Append vào cuối md-settings.css hiện tại
 */

/* ============================================================
   THÊM TÍNH NĂNG — Feature Groups
   ============================================================ */
.feat-group {
  cursor: pointer;
  border-bottom: 1px solid var(--md-g1);
}

.feat-group:last-of-type {
  border-bottom: none;
}

.feat-group-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  transition: background .15s;
}

.feat-group-hd:hover {
  background: var(--md-g0);
}

.feat-group-ic {
  width: 38px;
  height: 38px;
  border-radius: var(--md-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.feat-group-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--md-g8);
}

.feat-group-desc {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  margin-top: 1px;
}

/* Feature item (inside group panel) */
.feat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--md-g1);
  transition: background .15s;
}

.feat-item:last-child {
  border-bottom: none;
}

.feat-item:hover {
  background: var(--md-g0);
}

.feat-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
}

.feat-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--md-g8);
}

.feat-desc {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  margin-top: 1px;
  line-height: 1.4;
}

/* Device description + hint */
.device-desc {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  margin-top: 2px;
}

.device-hint {
  padding: 10px 12px;
  background: var(--md-secondary-pale);
  border-radius: var(--md-r-md);
  margin-top: 8px;
  font-size: var(--md-fs-xs);
  color: var(--md-g6);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

/* ============================================================
   DONATE CARD
   ============================================================ */
.donate-card {
  margin: 12px 0 16px;
  padding: 16px;
  background: #FDFBF7;
  border-radius: 14px;
  border: 1px solid #EDE8DF;
  display: flex;
  gap: 14px;
  align-items: center;
}

.donate-qr {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #E0D8CC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.donate-msg {
  flex: 1;
  font-size: .92rem;
  color: #6B5E50;
  line-height: 1.6;
}

.donate-msg strong {
  color: #C2813B;
}

.donate-tk-line {
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: #8B7355;
}
