/* /assets/css/bottom_nav.css — bottom nav + safe-area (smart) */

:root {
  /* Bottom nav height (without safe bottom) */
  --bottom-nav-height: 56px;
  /* Safe bottom (iOS env; Android/app sẽ được JS tính và override) */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Smart bottom nav: bám đáy thật (bottom:0), safe-bottom chỉ dùng để đẩy nội dung lên */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #ddd;
  z-index: 9000; /* below chatbot (>=10001) */
  box-sizing: border-box;
}

/* Hàng icon/text nằm trong vùng “an toàn” */
.bottom-nav .nav-inner {
  height: var(--bottom-nav-height);
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Ensure page content never sits behind the nav when safe-bottom > 0 */
html.has-bottom-nav body {
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  color: #666;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  position: relative;
  transition: background 0.2s, color 0.2s;
}

.bottom-nav a i {
  font-size: 26px;
  margin-bottom: 0;
}


.bottom-nav a > span:not(.badge) {
  font-size: 13px;
  line-height: 1.2;
  display: none !important; /* ẩn label, giữ badge */
}

.bottom-nav a.active {
  color: #c62828;
  font-weight: 600;
}

.bottom-nav a:hover {
  background: #f9f9f9;
}

/* Badge th�0�0ng b��o */
.badge {
  position: absolute;
  top: 4px;
  right: 24px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  padding: 2px 6px;
  display: none;
}
/* Khi JS bật badge */
.badge.bn-badge-on{ display:inline-block !important; }


/* ===== Responsive ===== */
@media (max-width: 480px) {
  :root {
    --bottom-nav-height: 60px;
  }
  .bottom-nav a i {
    font-size: 26px;
  }
  .bottom-nav a span {
    font-size: 12px;
  }
}

@media (min-width: 768px) {
  :root {
    --bottom-nav-height: 60px;
  }
  .bottom-nav a i {
    font-size: 28px;
  }
  .bottom-nav a span {
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  :root {
    --bottom-nav-height: 60px;
  }
  .bottom-nav a i {
    font-size: 20px;
  }
  .bottom-nav a span {
    font-size: 13px;
  }
}

/* ===================================================================== */
/*  BOTTOM NAV SETTINGS PANEL (Th�0�0ng b��o + Chatbot + Cu�6�1c g�6�9i)           */
/*  �0�3�0�6�6�1c b�6�7t khi JS th��m .bn-settings-open v��o .bn-settings-backdrop     */
/*  T�5�9t c�5�7 class �0�4�6�7u prefix bn-* �0�4�6�9 tr��nh xung �0�4�6�1t v�6�3i trang kh��c        */
/* ===================================================================== */

.bn-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500; /* > bottom-nav, < chatbot */
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 10px calc(var(--bottom-nav-height) + var(--safe-bottom) + 10px);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

/* Khi m�6�7 panel */
.bn-settings-backdrop.bn-settings-open {
  display: flex;
}

/* Panel ch��nh */
.bn-settings-panel {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  padding: 10px 14px 10px;
  max-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom) - 20px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  color: #111827;
  font-family: system-ui, -apple-system, "Be Vietnam Pro", Segoe UI, Roboto, sans-serif;
  font-size: 13px;
}

/* Header panel */
.bn-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}

.bn-settings-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.bn-settings-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.bn-settings-close-btn {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  border-radius: 999px;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}

.bn-settings-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Section */
.bn-settings-section {
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid #f3f4f6;
}

.bn-settings-section:first-of-type {
  border-top: none;
  padding-top: 6px;
  margin-top: 4px;
}

.bn-settings-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin-bottom: 4px;
}

/* H��ng setting */
.bn-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.bn-settings-row-main {
  min-width: 0;
}

.bn-settings-label {
  font-size: 13px;
  color: #111827;
}

.bn-settings-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* Switch (toggle) nh�6�1 b��n ph�5�7i */
.bn-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.bn-switch-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease-out;
}

/* tr�5�5ng th��i b�6�7t */
.bn-switch.bn-switch--on {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.bn-switch.bn-switch--on .bn-switch-thumb {
  transform: translateX(18px);
}

/* Input gi�6�5 quiet-time */
.bn-settings-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.bn-settings-time-label-inline {
  font-size: 12px;
  color: #6b7280;
}

.bn-settings-time-input {
  flex: 1;
  min-width: 0;
  max-width: 120px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  color: #111827;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.bn-settings-time-input:focus {
  border-color: #c62828;
  box-shadow: 0 0 0 1px rgba(198, 40, 40, 0.15);
  background: #ffffff;
}

/* Ghi ch�� nh�6�1 cu�6�3i panel */
.bn-settings-note {
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
}

/* Responsive panel nh�6�1 h�0�1n m��n h��nh */
@media (max-width: 480px) {
  .bn-settings-backdrop {
    padding: 0 6px calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
  }
  .bn-settings-panel {
    padding: 8px 10px 8px;
    border-radius: 16px;
  }
}
