/**
 * MD-CHILD-TASK.CSS — Styles for Child Task Detail screen
 * Theo prototype my-ai-nb-v1.4.html
 */

/* ============================================================
   TASK DETAIL HEADER
   ============================================================ */
.td-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}

.td-hd .back {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--md-w);
  border-radius: var(--md-r-full);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--md-sh-sm);
}

.td-title {
  font-family: var(--md-font-c);
  font-size: var(--md-fs-lg);
  font-weight: 800;
  color: var(--md-g9);
}

/* ============================================================
   TIMER
   ============================================================ */
.timer {
  margin: 0 24px 16px;
  padding: 20px;
  background: linear-gradient(135deg, var(--md-primary-pale), var(--md-w));
  border-radius: var(--md-r-lg);
  text-align: center;
  border: 2px solid var(--md-primary-border);
  transition: all 0.3s ease;
}

.timer.running {
  border-color: var(--md-primary);
  box-shadow: 0 0 20px rgba(43, 154, 112, 0.2);
}

.timer.warning {
  background: linear-gradient(135deg, #FEF2F2, var(--md-w));
  border-color: var(--md-err);
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.timer-num {
  font-family: var(--md-font-c);
  font-size: 3rem;
  font-weight: 900;
  color: var(--md-primary);
  letter-spacing: 0.05em;
}

.timer.warning .timer-num {
  color: var(--md-err);
}

.timer-label {
  font-size: var(--md-fs-sm);
  color: var(--md-g5);
  margin-top: 4px;
}

.timer-ctrls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.timer-btn {
  padding: 10px 20px;
  font-size: var(--md-fs-sm);
  font-weight: 700;
  border: none;
  border-radius: var(--md-r-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.timer-btn.play {
  background: var(--md-primary);
  color: var(--md-w);
}

.timer-btn.play:hover {
  background: var(--md-primary-light);
}

.timer-btn.pause {
  background: var(--md-secondary);
  color: var(--md-w);
}

.timer-btn.reset {
  background: var(--md-g1);
  color: var(--md-g6);
}

.timer-btn.reset:hover {
  background: var(--md-g2);
}

/* ============================================================
   STEPS
   ============================================================ */
.steps {
  margin: 0 24px 16px;
  padding: 16px;
  background: var(--md-w);
  border-radius: var(--md-r-lg);
  box-shadow: var(--md-sh-sm);
}

.steps-t {
  font-family: var(--md-font-c);
  font-size: var(--md-fs-md);
  font-weight: 800;
  color: var(--md-g9);
  margin-bottom: 12px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--md-g1);
  cursor: pointer;
  transition: background 0.15s ease;
}

.step:last-child {
  border-bottom: none;
}

.step:hover {
  background: var(--md-g0);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: var(--md-r-sm);
}

.step-m {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--md-fs-sm);
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.step-m.pending {
  background: var(--md-g1);
  color: var(--md-g5);
}

.step-m.current {
  background: var(--md-primary);
  color: var(--md-w);
  box-shadow: 0 0 0 4px var(--md-primary-pale);
}

.step-m.checked {
  background: var(--md-ok);
  color: var(--md-w);
}

.step-txt {
  font-size: var(--md-fs-sm);
  color: var(--md-g8);
  line-height: 1.5;
  font-family: var(--md-font-c);
}

.step-txt.done {
  color: var(--md-g5);
  text-decoration: line-through;
}

/* ============================================================
   TIPS
   ============================================================ */
.tip {
  padding: 10px 14px;
  background: var(--md-secondary-pale);
  border-radius: var(--md-r-md);
  font-size: var(--md-fs-sm);
  color: var(--md-g7);
  margin-bottom: 8px;
  line-height: 1.5;
  font-family: var(--md-font-c);
}

/* ============================================================
   RISKS (Cảnh báo an toàn)
   ============================================================ */
.risk-card {
  padding: 12px 14px;
  background: #FEF2F2;
  border-radius: var(--md-r-md);
  border: 1.5px solid #FECACA;
  margin-bottom: 8px;
}

.risk-text {
  font-family: var(--md-font-c);
  font-size: var(--md-fs-sm);
  color: var(--md-g8);
  font-weight: 600;
  line-height: 1.6;
}

/* ============================================================
   EXPLAIN SECTION (4 lớp giải thích)
   ============================================================ */
.explain-section {
  padding: 0 24px 16px;
}

.explain-title {
  font-family: var(--md-font-c);
  font-size: var(--md-fs-md);
  font-weight: 800;
  color: var(--md-g9);
  margin-bottom: 12px;
}

.explain-item {
  background: var(--md-w);
  border: 1.5px solid var(--md-g1);
  border-radius: var(--md-r-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.explain-item:hover {
  border-color: var(--md-g2);
}

.explain-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--md-fs-sm);
  color: var(--md-g8);
  font-family: var(--md-font-c);
}

.e-icon {
  font-size: 1.2rem;
}

.e-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--md-g4);
  transition: transform 0.2s ease;
}

.explain-bd {
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  font-size: var(--md-fs-sm);
  color: var(--md-g6);
  line-height: 1.6;
  transition: all 0.25s ease;
}

.explain-bd p {
  margin: 0;
}

.explain-item.open .e-arrow {
  transform: rotate(180deg);
}

.explain-item.open .explain-bd {
  max-height: 200px;
  padding: 0 14px 14px;
}

/* ============================================================
   COMPLETE BAR
   ============================================================ */
.complete-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  background: var(--md-w);
  border-top: 1px solid var(--md-g1);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}

.btn {
  padding: 12px 20px;
  font-weight: 700;
  border-radius: var(--md-r-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn.btn-o {
  background: var(--md-w);
  color: var(--md-primary);
  border: 2px solid var(--md-primary);
}

.btn.btn-o:hover {
  background: var(--md-primary-pale);
}

.btn.btn-c {
  background: linear-gradient(135deg, var(--md-fun-green), var(--md-primary));
  color: var(--md-w);
  font-size: var(--md-fs-md);
}

.btn.btn-c:hover {
  transform: scale(1.02);
  box-shadow: var(--md-sh-md);
}

/* ============================================================
   CHILD BACKGROUND
   ============================================================ */
#screen-child-task .md-screen__content {
  background: var(--md-child-bg, #FFF8F0);
}
