/**
 * MD-ASSIGN.CSS — Styles for Assign screen & Task Preview Modal
 * Theo prototype my-ai-nb-v1.4.html
 */

/* ============================================================
   TASK LIST CARD (.tl-card)
   ============================================================ */
.tl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--md-w);
  border: 1.5px solid var(--md-g1);
  border-radius: var(--md-r-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-card:hover {
  border-color: var(--md-primary-border);
  box-shadow: var(--md-sh-sm);
}

.tl-card:active {
  transform: scale(0.99);
}

.tl-emoji {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--md-g0);
  border-radius: var(--md-r-md);
  flex-shrink: 0;
}

.tl-name {
  font-weight: 600;
  font-size: var(--md-fs-sm);
  color: var(--md-g9);
  margin-bottom: 2px;
}

.tl-meta {
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
}

.tl-add {
  padding: 6px 14px;
  font-size: var(--md-fs-xs);
  font-weight: 700;
  color: var(--md-primary);
  background: var(--md-w);
  border: 1.5px solid var(--md-primary);
  border-radius: var(--md-r-full);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tl-add:hover {
  background: var(--md-primary-pale);
}

.tl-add:disabled {
  cursor: not-allowed;
}

/* ============================================================
   TASK PREVIEW MODAL (.tp-*)
   ============================================================ */
.tp-badge {
  font-size: var(--md-fs-xs);
  padding: 3px 10px;
  border-radius: var(--md-r-full);
  font-weight: 700;
}

.tp-badge--primary {
  background: var(--md-primary-pale);
  color: var(--md-primary);
}

.tp-badge--secondary {
  background: var(--md-secondary-pale);
  color: var(--md-secondary);
}

.tp-badge--ok {
  background: #DCFCE7;
  color: #16A34A;
}

.tp-badge--danger {
  background: var(--md-err);
  color: var(--md-w);
  font-size: 0.6rem;
  padding: 2px 8px;
}

/* Section */
.tp-section {
  margin-bottom: 14px;
}

.tp-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tp-section__title {
  font-size: var(--md-fs-sm);
  font-weight: 700;
  color: var(--md-g8);
}

.tp-section__body {
  /* Content area */
}

.tp-section--danger .tp-section__body {
  /* Danger section has special styling */
}

/* Steps */
.tp-step {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--md-g1);
}

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

.tp-step__num {
  width: 22px;
  height: 22px;
  background: var(--md-primary);
  color: var(--md-w);
  border-radius: 50%;
  font-size: var(--md-fs-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tp-step__text {
  font-size: var(--md-fs-sm);
  color: var(--md-g8);
  line-height: 1.5;
}

/* Tips */
.tp-tip {
  padding: 8px 12px;
  background: var(--md-secondary-pale);
  border-radius: var(--md-r-sm);
  font-size: var(--md-fs-sm);
  color: var(--md-g7);
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Risks */
.tp-risk {
  padding: 12px 14px;
  background: #FEF2F2;
  border-radius: var(--md-r-md);
  border: 1.5px solid #FECACA;
  margin-bottom: 8px;
  font-size: var(--md-fs-sm);
  color: var(--md-g8);
  font-weight: 600;
  line-height: 1.6;
}

.tp-note {
  padding: 8px 10px;
  background: #FFF8EB;
  border-radius: var(--md-r-sm);
  margin-top: 6px;
  font-size: var(--md-fs-xs);
  color: var(--md-g5);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

/* Explain accordion */
.tp-explain__item {
  border: 1.5px solid var(--md-g1);
  border-radius: var(--md-r-md);
  margin-bottom: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.tp-explain__item:hover {
  border-color: var(--md-g2);
}

.tp-explain__hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--md-fs-sm);
  color: var(--md-g8);
}

.tp-explain__icon {
  font-size: 1rem;
}

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

.tp-explain__bd {
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  font-size: var(--md-fs-sm);
  color: var(--md-g6);
  line-height: 1.6;
  transition: all 0.2s ease;
}

.tp-explain__item.open .tp-explain__arrow {
  transform: rotate(180deg);
}

.tp-explain__item.open .tp-explain__bd {
  max-height: 200px;
  padding: 0 12px 12px;
}

/* Actions */
.tp-actions {
  display: flex;
  gap: 8px;
  margin-top: var(--md-sp-4);
  padding-top: var(--md-sp-3);
  border-top: 1px solid var(--md-g1);
}

/* ============================================================
   MODAL — chỉ cho assign screen (custom-task-modal)
   ============================================================ */
#custom-task-modal {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.97);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  padding-top: 24px;
  z-index: 1000;
  overflow-y: auto;
}

#custom-task-modal.open {
  display: flex;
}

#custom-task-modal .md-modal__box {
  background: var(--md-w);
  border-radius: var(--md-r-xl);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 4px 30px rgba(0,0,0,.1);
  animation: slideUp .25s ease;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 40px;
}

#task-preview-inline .tp-section { margin-bottom: 20px; }
#task-preview-inline .tp-section__title { font-size: 1.1rem; font-weight: 700; }
#task-preview-inline .tp-step__text { font-size: 1rem; line-height: 1.7; }
#task-preview-inline .tp-tip { font-size: .95rem; line-height: 1.7; padding: 10px 12px; margin-bottom: 6px; }
#task-preview-inline .tp-risk { font-size: .95rem; line-height: 1.7; padding: 12px 14px; margin-bottom: 6px; }
#task-preview-inline .tp-explain__hd { font-size: 1rem; }
#task-preview-inline .tp-explain__bd { font-size: .95rem; line-height: 1.7; }
#task-preview-inline .tp-actions { gap: 10px; padding-top: 16px; }

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .tl-card {
    padding: 12px;
    gap: 10px;
  }
  
  .tl-emoji {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
  }
  
  .tl-add {
    padding: 5px 10px;
    font-size: 0.72rem;
  }
  
  .tp-step__text {
    font-size: var(--md-fs-xs);
  }
}
