/* =====================================================================
   drhouse-app.css — GIAO DIỆN APP DRHOUSE
   Port từ template khách gửi: tho-xay/index.html + tho-xay/css/style.css.
   Nguyên tắc (Quy tắc 3 CLAUDE.md): CHỈ THÊM, không sửa style.min.css.
   Nạp SAU hspace-theme.css (xem _head.tpl) nên thắng cascade.
   Gỡ nhanh: xoá thẻ <link ... drhouse-app.css> trong _head.tpl.

   Tiền tố class: .dh-*  (tránh đụng class có sẵn của WoWonder/Bootstrap)
   Responsive (Quy tắc 7): mobile-first, các lưới giãn thêm cột từ 576px trở lên.
   ===================================================================== */

:root {
  --dh-red:      #e0182d;
  --dh-red-dark: #a50f1f;
  --dh-card:     #141414;
  --dh-card-2:   #1c1c1c;
  --dh-line:     #2a2a2a;
  --dh-text:     #ffffff;
  --dh-muted:    #9a9a9a;
  --dh-gold:     #f5c451;
  --dh-nav-h:    64px;      /* chiều cao thanh menu dưới */
}

/* ── Khối app: nền tối, bo góc, tách hẳn khỏi lưới Bootstrap của feed ── */
.dh-app {
  color: var(--dh-text);
  margin-bottom: 18px;
}
.dh-app *,
.dh-app *::before,
.dh-app *::after { box-sizing: border-box; }
.dh-app a { text-decoration: none; color: inherit; }
.dh-app img { max-width: 100%; }

/* ══════════════ Hero banner ══════════════ */
.dh-hero { position: relative; margin-bottom: 16px; }
.dh-hero-img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; object-fit: cover;
}
.dh-hero-dots { position: absolute; bottom: 10px; left: 14px; display: flex; gap: 5px; }
.dh-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.35); }
.dh-dot.active { width: 16px; border-radius: 4px; background: var(--dh-red); }

/* ══════════════ Lưới dịch vụ ══════════════ */
.dh-services {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 6px;
  margin-bottom: 18px;
}
.dh-service {
  display: flex; flex-direction: column; align-items: center;
  gap: 7px; text-align: center; min-width: 0;
}
.dh-service-ic {
  width: 56px; height: 56px; border-radius: 16px;
  object-fit: cover; display: block; background: var(--dh-card);
  border: 1px solid var(--dh-line);
  transition: transform .15s ease;
}
.dh-service:active .dh-service-ic,
.dh-service:hover  .dh-service-ic { transform: scale(.94); }
.dh-service span {
  font-size: 10px; line-height: 1.25; color: #ddd;
  overflow-wrap: anywhere;
}

/* ══════════════ Ví Drhouses ══════════════ */
.dh-wallet {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  background: linear-gradient(135deg, #2a0c10, #160405);
  border: 1px solid #3a1418; border-radius: 16px;
  padding: 14px; margin-bottom: 16px;
}
.dh-wallet-title {
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
  display: flex; align-items: center; gap: 6px;
}
.dh-wallet-title .dh-eye { width: 15px; height: 15px; color: var(--dh-muted); cursor: pointer; }
.dh-wallet-label { font-size: 10px; color: var(--dh-muted); margin-top: 10px; }
.dh-wallet-balance { font-size: 24px; font-weight: 800; margin: 2px 0 12px; }
.dh-wallet-actions { display: flex; gap: 8px; }
.dh-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; border: none; border-radius: 9px; padding: 9px 8px;
  font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; cursor: pointer;
}
.dh-btn svg { width: 15px; height: 15px; }
.dh-btn-red { background: var(--dh-red); }
.dh-btn-red:hover { background: var(--dh-red-dark); color: #fff; }
.dh-btn-outline { background: transparent; border: 1px solid #555; }
.dh-btn-outline:hover { border-color: var(--dh-red); color: #fff; }

.dh-wallet-right { display: flex; flex-direction: column; gap: 10px; }
.dh-wallet-quick {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  background: rgba(255,255,255,.04); border-radius: 12px; padding: 10px 4px;
}
.dh-quick {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 9px; line-height: 1.15; color: #ccc; text-align: center; min-width: 0;
}
.dh-quick svg { width: 16px; height: 16px; color: #eaeaea; flex-shrink: 0; }
.dh-drpoint {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.04); border-radius: 12px; padding: 10px 12px;
}
.dh-drpoint-label { font-size: 10px; color: var(--dh-muted); }
.dh-drpoint-value { font-size: 16px; font-weight: 800; color: var(--dh-gold); }
.dh-drpoint-value span { font-size: 10px; font-weight: 500; color: var(--dh-muted); }
.dh-chev { width: 18px; height: 18px; color: var(--dh-muted); }

/* ══════════════ Banner AI ══════════════ */
.dh-ai { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 20px; }
.dh-ai-img { width: 100%; display: block; border-radius: 16px; }
.dh-chat-btn {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: #111; border: none; border-radius: 16px;
  padding: 6px 11px; font-size: 10px; font-weight: 700;
  white-space: nowrap; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.dh-chat-btn:hover { color: #111; }
.dh-chat-btn svg { width: 13px; height: 13px; }

/* ══════════════ Tiêu đề mục ══════════════ */
.dh-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px;
}
.dh-section-head h3 { font-size: 15px; font-weight: 800; letter-spacing: .3px; margin: 0; color: var(--dh-text); }
.dh-see-all { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dh-red); white-space: nowrap; }
.dh-see-all:hover { color: var(--dh-red); opacity: .8; }
.dh-see-all svg { width: 16px; height: 16px; }

/* ══════════════ Dự án (cuộn ngang) ══════════════ */
.dh-projects {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 6px; margin-bottom: 20px;
  scrollbar-width: none;
}
.dh-projects::-webkit-scrollbar { display: none; }
.dh-project {
  position: relative; flex: 0 0 150px;
  background: var(--dh-card); border: 1px solid var(--dh-line);
  border-radius: 14px; overflow: hidden;
}
.dh-proj-img { width: 100%; height: 100px; object-fit: cover; display: block; }
.dh-project-tag {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; padding: 3px 8px; border-radius: 6px;
}
.dh-project-body { padding: 10px; }
.dh-project-name {
  font-size: 13px; font-weight: 700; color: var(--dh-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dh-project-loc {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--dh-muted); margin: 5px 0 8px;
}
.dh-project-loc svg { width: 12px; height: 12px; flex-shrink: 0; }
.dh-project-price { font-size: 12px; font-weight: 800; color: var(--dh-red); }

/* ══════════════ Cam kết (trust) ══════════════ */
.dh-trust {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 6px;
  background: var(--dh-card); border: 1px solid var(--dh-line);
  border-radius: 14px; padding: 16px 8px; margin-bottom: 16px;
}
.dh-trust-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.dh-trust-item svg { width: 26px; height: 26px; color: var(--dh-red); }
.dh-trust-item b { font-size: 10px; line-height: 1.2; color: var(--dh-text); }
.dh-trust-item small { font-size: 8.5px; color: var(--dh-muted); line-height: 1.2; }

/* ══════════════ THANH MENU DƯỚI (bottom nav) ══════════════ */
.dh-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1700;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  background: #0c0c0c; border-top: 1px solid var(--dh-line);
  padding: 7px 4px 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(0,0,0,.5);
}
.dh-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--dh-muted); font-size: 9px; line-height: 1.1;
  min-width: 0; padding: 0; background: none; border: none;
  white-space: nowrap; text-align: center;
}
.dh-nav-item:hover { color: #ddd; }
.dh-nav-item svg { width: 22px; height: 22px; }
.dh-nav-item.active { color: var(--dh-red); }
/* Nút AI giữa thanh menu = mascot con ong Drhouses.
   Ảnh đã tự có vòng viền đỏ + nền tối nên KHÔNG tô nền đỏ phía sau nữa,
   chỉ thêm quầng sáng để nút nổi lên khỏi thanh menu đen. */
.dh-nav-fab {
  background: none; border: none;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; padding: 0; overflow: visible;
  filter: drop-shadow(0 3px 9px rgba(224,24,45,.6));
  transition: transform .15s ease, filter .15s ease;
}
.dh-nav-fab:hover { transform: translateY(-2px); filter: drop-shadow(0 5px 14px rgba(255,60,80,.9)); }
.dh-nav-fab:active { transform: scale(.93); }
.dh-nav-fab.active { filter: drop-shadow(0 0 10px rgba(255,60,80,1)); }
.dh-bee {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; display: block;
}
/* đang ở trang AI thì con ong nhún nhẹ cho biết là mục đang mở */
.dh-nav-fab.active .dh-bee { animation: dh-bee-bob 2.2s ease-in-out infinite; }
@keyframes dh-bee-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-2px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dh-nav-fab.active .dh-bee { animation: none; }
}

/* chừa chỗ cho thanh nav để không che nội dung / footer */
body.dh-has-nav { padding-bottom: var(--dh-nav-h); }
/* nút trợ lý H.AI đang fixed ở đáy -> đẩy lên trên thanh nav */
body.dh-has-nav .hai-fab { bottom: calc(var(--dh-nav-h) + 14px); }
body.dh-has-nav .hai-panel { bottom: calc(var(--dh-nav-h) + 12px); }
/* nút chat/live nổi khác của theme (nếu có) cũng đẩy lên */
body.dh-has-nav .chat-sticky-wrapper,
body.dh-has-nav #chat-sticky-wrapper { bottom: var(--dh-nav-h) !important; }

/* ══════════════ Responsive ══════════════ */
@media (min-width: 576px) {
  .dh-wallet { grid-template-columns: 1fr 1fr; }
  .dh-trust  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dh-quick  { font-size: 10px; }
  .dh-project { flex: 0 0 190px; }
  .dh-proj-img { height: 126px; }
}
@media (min-width: 768px) {
  .dh-services { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 16px 8px; }
  .dh-service span { font-size: 11px; }
  .dh-nav-item { font-size: 10px; }
}
@media (min-width: 992px) {
  .dh-hero-img { max-height: 320px; }
  .dh-section-head h3 { font-size: 17px; }
}
/* màn hình rất hẹp: 4 icon dịch vụ / hàng cho đỡ chật */
@media (max-width: 359px) {
  .dh-services { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dh-service-ic { width: 48px; height: 48px; }
  .dh-nav-item span { font-size: 8px; }
}
