/* book-reader.css */
body {
  display: flex;
  flex-direction: row;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #fcfcfc;
  padding: 0;
  max-width: 100%;
}

#br-main-content {
  flex: 6;
  padding: 40px 60px;
  background-color: #ffffff;
  overflow-y: auto;
  scroll-behavior: smooth;
  line-height: 1.6;
}

#br-right-panel {
  flex: 4;
  background-color: #f4f5f7;
  border-left: 1px solid #e1e4e8;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 999;
}

/* Flex layout inside Right Panel (70% and 30%) */
#br-eng-section {
  flex: 7;
  padding: 20px;
  overflow-y: auto;
  border-bottom: 2px solid #e1e4e8;
}

#br-term-section {
  flex: 3;
  padding: 20px;
  overflow-y: auto;
  background-color: #fff;
}

/* UI Elements */
.br-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #0366d6;
  padding-bottom: 10px;
}

#br-eng-content {
  font-size: 1rem;
  color: #444;
  line-height: 1.6;
}

.vn.visible, .eng.hidden {
  transition: background-color 0.2s;
}

/* Swapping Logic */
body.lang-swap #br-main-content .eng.hidden {
  display: block !important;
  color: #000;
}
body.lang-swap #br-main-content .vn.visible {
  display: none !important;
}

/* Hover effects based on mode */
body:not(.lang-swap) #br-main-content .vn.visible:hover {
  background-color: #f0f8ff;
  border-radius: 3px;
}
body.lang-swap #br-main-content .eng.hidden:hover {
  background-color: #f0f8ff;
  border-radius: 3px;
}

/* Make sure right panel always shows its content regardless of classes */
#br-eng-content .eng.hidden,
#br-eng-content .vn.visible {
  display: block !important;
  color: #444;
  background-color: transparent !important;
}

/* Glossary Term Panel */
.br-term-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  color: #d73a49;
  text-transform: capitalize;
}

.br-term-card .br-vi {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.br-term-card .br-desc-en, .br-term-card .br-desc-vi {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 8px;
}

/* Term highlights */
.br-highlight-term {
  color: #d73a49 !important;
  font-weight: bold;
  cursor: pointer;
  border-bottom: 1px dashed #d73a49;
  transition: background-color 0.2s;
}

.br-highlight-term:hover {
  background-color: #ffebed;
  border-radius: 2px;
}

/* Clean up original document styles if they interfere */
body:not(.lang-swap) > .eng.hidden, body:not(.lang-swap) #br-main-content .eng.hidden {
  display: none !important;
}
