/* ====== Vars (หนึ่งชุดพอ) ====== */
:root {
  --page-bg: #0f1115;
  --bar-bg: #0d1117; /* สีบาร์ทึบ */
  --bar-border: rgba(255, 255, 255, 0.06);
  --text: #6f7a86;
  --active: #2f6dff;
  --fab: #6c4cff;
}

/* ====== Curved bottom nav ====== */
.curved-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  z-index: 1000;
  pointer-events: none; /* ให้คลิกเฉพาะลูกด้านใน */
}

/* แผ่นบาร์ทึบ (กันพื้นหลังซ้อน) */
.curved-nav .bar {
  position: absolute;
  inset: auto 0 0 0;
  height: 74px;
  background: var(--bar-bg); /* สีบาร์หลัก */
  border-top: 1px solid var(--bar-border);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.18);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  pointer-events: auto;
}

/* เส้นเว้าให้ใช้สีเดียวกับบาร์ */
.curved-nav .curve {
  position: absolute;
  top: -34px;
  left: 0;
  width: 100%;
  height: 120px;
  display: block;
}
.curved-nav .curve path,
.curved-nav .curve rect {
  fill: var(--bar-bg) !important;
}

/* แถวไอคอน 1 | 1 | (ช่อง FAB) | 1 | 1 */
.curved-nav .items {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 74px 1fr 1fr;
  align-items: center;
  padding: 10px 6px 14px;
}

/* ไอเท็ม */
.curved-nav .item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  font: 500 12px/1 "Inter", "Kanit", system-ui, -apple-system, Segoe UI, Roboto,
    Arial, sans-serif;
  transition: color 0.2s, transform 0.2s;
}
.curved-nav .item .icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--text);
  transition: color 0.2s, transform 0.2s;
}
.curved-nav .item:hover {
  color: #4e84ff;
  transform: translateY(-2px);
}
.curved-nav .item:hover .icon {
  color: #4e84ff;
}

.curved-nav .item.active {
  color: var(--active);
  font-weight: 600;
  transform: translateY(-2px);
}
.curved-nav .item .icon svg {
  color: #98a2b3;
}
.curved-nav .item.active .icon svg {
  color: var(--active);
}

/* FAB กลาง */
.curved-nav .fab {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 36px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--fab);
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  pointer-events: auto;
  box-shadow: 0 12px 24px rgba(108, 76, 255, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(108, 76, 255, 0.12);
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.curved-nav .fab:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.03);
  filter: brightness(1.05);
  box-shadow: 0 16px 30px rgba(108, 76, 255, 0.42),
    0 8px 18px rgba(0, 0, 0, 0.28), 0 0 0 8px rgba(108, 76, 255, 0.14);
}

/* กันคอนเทนต์โดนทับ */
body {
  padding-bottom: 90px;
  box-sizing: border-box;
}

/* จอใหญ่ */
@media (min-width: 768px) {
  .curved-nav {
    height: 96px;
  }
  .curved-nav .bar {
    height: 78px;
  }
  .curved-nav .items {
    padding: 12px 8px 16px;
  }
}
/* ==== Icon highlight binding (ไม่ต้องแก้ HTML) ==== */

/* ให้ไอคอนอ้างอิงสีจากตัว item (ตัวหนังสือ) */
.curved-nav .item .icon svg { 
  color: currentColor;               /* ค่าอ้างอิง */
}

/* บังคับองค์ประกอบที่มี stroke ให้รับ currentColor */
.curved-nav .item .icon svg path[stroke],
.curved-nav .item .icon svg circle[stroke],
.curved-nav .item .icon svg rect[stroke],
.curved-nav .item .icon svg polygon[stroke],
.curved-nav .item .icon svg line[stroke],
.curved-nav .item .icon svg polyline[stroke] {
  stroke: currentColor;
  transition: stroke .2s ease;
}

/* บังคับองค์ประกอบที่มี fill ให้รับ currentColor (ยกเว้น fill="none") */
.curved-nav .item .icon svg path[fill]:not([fill="none"]),
.curved-nav .item .icon svg circle[fill]:not([fill="none"]),
.curved-nav .item .icon svg rect[fill]:not([fill="none"]),
.curved-nav .item .icon svg polygon[fill]:not([fill="none"]) {
  fill: currentColor;
  transition: fill .2s ease;
}

/* สีพื้นฐานของไอคอน/ตัวอักษร */
.curved-nav .item { color: var(--text); }

/* Hover → ทั้งตัวหนังสือและไอคอนจะเปลี่ยนพร้อมกัน */
.curved-nav .item:hover { color: #4e84ff; }

/* Active → ทั้งตัวหนังสือและไอคอนจะเปลี่ยนเป็นสีน้ำเงินแบรนด์ */
.curved-nav .item.active { color: var(--active); }
