/* === 기본 바디 설정 === */

:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --status-bar-height: 0px;   /* 기본값 (JS에서 동적으로 덮어씀) */
  --navigation-bar-height: 0px;
  --vh: 1vh;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #fff;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
}

.web-form * {
  max-width: 100%;
  max-height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #fff;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
}

 #divTopbar, #divBibleTopbar {
  position: fixed;
  top: 0;
  left: var(--safe-area-left);
  right: var(--safe-area-right);
/*  height: calc(45px + var(--status-bar-height));
  padding-top: var(--status-bar-height);  */
height: 45px; /* 고정 */
  background-color: white; /* 백색 */
  color: #000; /* 텍스트 색상 검정으로 조정 */
  align-items: center;
  z-index: 1000;
  border: none; /* 경계 제거 */
  box-shadow: none; /* 그림자 제거 */
  outline: none; /* 외곽선 제거 */
}  

#divBottomBar {
  position: fixed;
  bottom: 0;
  left: var(--safe-area-left);
  right: var(--safe-area-right);
  padding-bottom: var(--navigation-bar-height, var(--safe-area-bottom));
  height: 45px;
  background-color: white; /* 백색 */
  color: #000; /* 텍스트 색상 검정으로 조정 */
  display: flex;
  justify-content: space-around;  /* ✅ 아이콘을 좌우 분산 */
  align-items: flex-end; /* 하단 정렬 */
  box-sizing: border-box;
  padding: 0; 
  z-index: 1000;     
  border: none; /* 경계 제거 */
  box-shadow: none; /* 그림자 제거 */
  outline: none; /* 외곽선 제거 */
}

/* === 컨텐츠 패널 === */
#pnlContent {
  padding-top: 45px; /* 항상 상단바 높이만큼 확보 */
  height: calc(100vh - 45px - 45px); /* 하단바 포함 시 조정 */
  overflow-y: auto;
  background-color: white; /* 백색 */
  border: none; /* 경계 제거 */
  box-shadow: none; /* 그림자 제거 */
  outline: none; /* 외곽선 제거 */
}

/* === 상단 바 === */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 45px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0px 10px;
  box-sizing: border-box;
  width: 100%;
  background-color: white;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.left-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-left: 2px;
  margin-left: -4px; /* - 가 커지면 오른쪽으로 */
}

.center-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.right-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;  /* 10 */
  padding-right: 2px;
  margin-right: -0px; /* - 가 커지면 오른쪽으로 */
}

/* === 버튼 아이콘 공통 === */
.icon-btn {
  width: 20px;
  height: 20px;
  padding: 5px 5px;
  border-radius: 12px;
  box-sizing: content-box;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.icon-btn:hover,
.back-btn:hover,
.setting-btn:hover {
  transform: scale(1.2);
}

.icon-btn.active {
  filter: brightness(0) saturate(100%) invert(25%) sepia(96%) saturate(1800%) hue-rotate(200deg);
  transform: scale(1.2);
}

.back-btn {
  width: 19px;
  height: 19px;
  align-items: center;
  margin-left: -5px;
}

/* === 드롭다운 및 제목 === */
.bible-select {
  height: 30px;
  font-size: 14px;
  padding: 2px 6px;
  margin: 0 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
}

.bible-group {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}

.topbar-title {
  font-weight: bold;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 하단 바 === */
.bottom-bar {
  display: flex;
  justify-content: space-around; /* 하위 요소 간격 유지 */
  align-items: flex-end; /* 하단 정렬 상속 */
  height: 45px;
  height: 100%;
  width: 100%;
  background-color: inherit;
  background-color: white;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* 텍스트와 아이콘 하단 정렬 */
  font-size: 11px;
  color: #888;
  cursor: pointer;
  height: 100%;
 /* transition: 0.2s; */
  padding: 4px 6px;             /* 좌우 클릭 범위 넓힘 */
  min-width: 50px;               /* 최소 넓이 지정 */
  border-radius: 12px;           /* 둥근 모서리 */
  transition: background-color 0.2s ease;
}

.menu-icon img {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.menu-icon:hover {
  cursor: pointer;
  transform: scale(1.1);
}

.bottom-bar .menu-icon.active {
/*  color: #007bff;
  border-radius: 8px; */
  background-color: white;     /* 클릭 시 옅은 회색 배경 */
  font-weight: bold;
  filter: brightness(1.1);
}

.bottom-bar .menu-icon.active img {
  transform: scale(1.1);
  filter: brightness(0) saturate(100%) invert(25%) sepia(96%) saturate(1800%) hue-rotate(200deg);
}

/* === 반응형 대응 === */
@media (max-width: 480px) {
  .icon-btn,
  .setting-btn,
  .back-btn {
    width: 19px !important;
    height: 19px !important;
  }

  .bible-select {
    font-size: 13px;
    height: 28px;
    max-width: 100px;
  }

  .topbar-title {
    font-size: 20px;
  }
}
