/* public/css/lam-viec.css — Giao diện Module Bống Làm Việc & Mách Bống */

/* ==========================================================================
   1. BỐNG ĐANG LÀM GÌ (#bong-lam-gi)
   ========================================================================== */

#bong-lam-gi {
  padding: 60px 0;
  background-color: var(--white);
  border-top: 1px solid var(--border-default);
}

/* Khối Nhật ký */
.khoi-nhat-ky-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.dau-khoi-nhat-ky {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tieu-de-khoi {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bieu-tuong-khoi {
  font-size: 1.25rem;
}

.tieu-de-khoi h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
}

.chu-thich-gio {
  font-size: 0.85rem;
  color: var(--teal-600);
  font-weight: 600;
  background: var(--teal-50);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Danh sách nhật ký */
.danh-sach-nhat-ky {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dong-nhat-ky {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.dong-nhat-ky:hover {
  border-color: var(--teal-300);
  box-shadow: var(--shadow-sm);
}

.nhat-ky-gio {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 2px 6px;
  background: var(--gray-100);
  border-radius: 4px;
  margin-top: 1px;
}

.nhat-ky-noi-dung {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--navy-900);
  word-break: break-word;
}

.chan-khoi-nhat-ky {
  text-align: center;
  margin-top: 16px;
}

.nut-xem-them {
  font-size: 0.85rem;
  padding: 6px 16px;
}

/* Khối Bảng việc */
.khoi-bang-viec-wrap {
  background: var(--bg-page);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.dau-khoi-bang-viec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Tab chuyển cột trên di động */
.thanh-tab-viec-mobile {
  display: none;
  gap: 6px;
  overflow-x: auto;
  width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.tab-viec-m {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
}

.tab-viec-m.active {
  background: var(--navy-800);
  color: var(--white);
  border-color: var(--navy-800);
}

.badge-m {
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
}
.tab-viec-m.active .badge-m {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

/* Lưới 4 cột việc */
.luoi-bang-viec {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.cot-viec {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

.dau-cot-viec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.dau-cot-viec h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cham-trang-thai-viec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.cham--dang-lam { background-color: #00a9cc; box-shadow: 0 0 6px rgba(0, 169, 204, 0.5); }
.cham--cho-lam { background-color: #f59e0b; }
.cham--cho-nam { background-color: #ec4899; }
.cham--da-xong { background-color: #10b981; }

.so-luong-viec {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--gray-200);
  color: var(--navy-900);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.danh-sach-the-viec {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Thẻ việc */
.the-viec {
  background: #fbfcfd;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.the-viec:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--teal-300);
}

.the-viec__nhan-loai {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
}

.the-viec__tieu-de {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.35;
  word-break: break-word;
}

.the-viec__ket-qua {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
  background: var(--white);
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px dashed var(--border-default);
}

.the-viec__thoi-gian {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}

.the-viec-rong {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}


/* ==========================================================================
   2. MÁCH BỐNG CÁCH KIẾM CƠM (#mach-bong)
   ========================================================================== */

#mach-bong {
  padding: 60px 0;
  background-color: var(--bg-page);
  border-top: 1px solid var(--border-default);
}

.bo-cuc-mach-bong {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: start;
}

/* Khung form */
.khung-form-mach {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.khung-form-mach .o-nhap-nhom {
  margin-bottom: 16px;
}

.dau-label-dem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dau-label-dem label,
.khung-form-mach label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-900);
}

.tu-chon {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.bat-buoc {
  color: #ef4444;
}

.dem-ky-tu {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.o-nhap--text {
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

.o-nhap.o-nhap--loi {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.chu-thich-loi {
  color: #ef4444;
  font-size: 0.78rem;
  margin-top: 4px;
  display: block;
}

.chan-form-mach {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nut-gui-mach {
  width: 100%;
  justify-content: center;
}

.thong-bao-mach {
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  display: none;
  line-height: 1.4;
}
.thong-bao-mach.thanh-cong {
  display: block;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.thong-bao-mach.loi {
  display: block;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.thong-bao-mach.gioi-han {
  display: block;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Khung hiển thị gợi ý */
.khung-danh-sach-goi-y {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Nhóm Mới */
.nhom-goi-y-moi {
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  border-radius: var(--radius-card);
  padding: 18px 20px;
}

.dau-nhom-moi {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.dau-nhom-moi h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f766e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chu-thich-doc-luc {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0d9488;
  background: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid #99f6e4;
}

/* Tab mobile cho 3 cột gợi ý */
.thanh-tab-goi-y-m {
  display: none;
  gap: 6px;
  overflow-x: auto;
  width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.tab-goi-y-m {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
}

.tab-goi-y-m.active {
  background: var(--navy-800);
  color: var(--white);
  border-color: var(--navy-800);
}

/* Lưới 3 cột gợi ý */
.luoi-3-cot-goi-y {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.cot-goi-y {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

.dau-cot-gy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.dau-cot-gy h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.danh-sach-the-goi-y {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Thẻ gợi ý */
.the-goi-y {
  background: #fbfcfd;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}

.the-goi-y.co-ghim {
  border-color: #fde68a;
  background: #fffdf5;
}

.the-goi-y:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--teal-300);
}

.the-goi-y__dau {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.the-goi-y__ten {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy-900);
}

.the-goi-y__ghim-icon {
  font-size: 0.85rem;
}

.the-goi-y__noi-dung {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--navy-900);
  word-break: break-word;
}

.the-goi-y__tra-loi {
  background: #f0fdfa;
  border-left: 3px solid var(--teal-500);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
  margin-top: 4px;
}

.the-goi-y__tra-loi-nhan {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal-700);
  display: block;
  margin-bottom: 2px;
}

.the-goi-y__tra-loi-chu {
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--navy-900);
  font-style: italic;
  word-break: break-word;
}

.the-goi-y__thoi-gian {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}


/* ==========================================================================
   3. RESPONSIVE MOBILE (≤ 768px & 375px)
   ========================================================================== */

@media (max-width: 900px) {
  .bo-cuc-mach-bong {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .thanh-tab-viec-mobile {
    display: flex;
  }

  .luoi-bang-viec {
    grid-template-columns: 1fr;
  }

  .cot-viec {
    display: none;
  }

  .cot-viec.active-m {
    display: flex;
  }

  .thanh-tab-goi-y-m {
    display: flex;
  }

  .luoi-3-cot-goi-y {
    grid-template-columns: 1fr;
  }

  .cot-goi-y {
    display: none;
  }

  .cot-goi-y.active-m {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .the-viec,
  .the-goi-y,
  .dong-nhat-ky {
    transition: none !important;
    transform: none !important;
  }
}
