* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

/* Hamburger Menu Button */
.hamburger-btn {
  display: flex;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1100;
  background: #3498db;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.hamburger-btn:hover {
  background: #2980b9;
  transform: scale(1.05);
}

.hamburger-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Left Sidebar Navigation */
.left-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #01001c 0%, #251d2e 100%);
  color: #ecf0f1;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.left-sidebar.active {
  transform: translateX(0);
}

.left-sidebar::-webkit-scrollbar {
  width: 8px;
}

.left-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #3498db;
}

.sidebar-section {
  padding: 3px 15px;
}
.sidebar-button {
  padding: 8px 15px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #95a5a6;
  margin-bottom: 12px;
  letter-spacing: 1px;
  padding-top: 10px;
}

.sidebar-link {
  display: block;
  padding: 12px 15px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #ecf0f1;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 14px;
}

.sidebar-link:hover {
  background: rgba(52, 152, 219, 0.2);
  color: #fff;
  transform: translateX(5px);
}

.sidebar-dropdown {
  margin-bottom: 10px;
}

.sidebar-dropdown:last-child {
  margin-bottom: 0;
}

.sidebar-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #ecf0f1;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-dropdown-toggle:hover {
  background: rgba(52, 152, 219, 0.2);
  color: #fff;
  transform: translateX(5px);
}

.sidebar-dropdown-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.4);
}

.sidebar-dropdown-toggle .toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-dropdown-toggle .toggle-icon {
  transition: transform 0.3s ease;
}

.sidebar-dropdown.open .sidebar-dropdown-toggle {
  background: rgba(52, 152, 219, 0.2);
  color: #fff;
}

.sidebar-dropdown.open .sidebar-dropdown-toggle .toggle-icon {
  transform: rotate(90deg);
}

.sidebar-submenu {
  display: none;
  margin-top: 6px;
}

.sidebar-dropdown.open .sidebar-submenu {
  display: block;
}

.sidebar-submenu .sidebar-link {
  padding-left: 35px;
}

.sidebar-link.active {
  background: #3498db;
  color: #fff;
  font-weight: 500;
}

.sidebar-link i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* Main Content Area */
.main-content {
  margin-left: 0;
  min-height: 100vh;
  background: #f8f9fa;
  padding: 30px 20px 40px;
}

/* Top Header */
.top-header {
  background: #fff;
  padding: 15px 30px 15px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 900;
}

.top-header h1 {
  margin: 0;
  font-size: 24px;
  color: #2c3e50;
}
h5 {
  padding-top: 20px;
  padding-left: 20px;
}

/* Content Container */
.content-container {
  padding: 30px;
}

.content-box {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  font-size: 18px;
}

/* Audio Player Window */
#audioPlayerWindow {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  display: none;
}

#audioPlayerHeader {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 12px 15px;
  border-radius: 12px 12px 0 0;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

#closeAudio {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s;
}

#closeAudio:hover {
  background: rgba(255, 255, 255, 0.3);
}

#audioPlayerControls {
  padding: 20px;
  text-align: center;
}

#audioPlayerControls button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  margin: 0 8px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

#audioPlayerControls button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#progressContainer {
  padding: 0 15px 15px 15px;
}

/* Text Chunks */
.chunk {
  color: #2c3e50;
  background-color: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: 4px;
}

.chunk:hover,
.chunk.active {
  background-color: #e0ffff;
  color: #000;
}

.words {
  cursor: pointer;
  transition: background 0.3s;
  padding: 2px 4px;
  border-radius: 4px;
}

.words:hover,
.words.active {
  background-color: #e0ffff;
  color: #000;
}

/* Text Content */
.text-content {
  line-height: 2;
  font-size: 18px;
  color: blue;
}

/* Button Styling */
.btn-audio {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-audio:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  color: #fff;
}

#openAudio {
  position: fixed;
  top: 15px;
  left: 75px;
  z-index: 1100;
}

@media (max-width: 576px) {
  #openAudio {
    left: 70px;
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Glossary Table */
.glossary-table {
  width: 100%;
}

.glossary-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #e9ecef;
}

.glossary-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #3498db;
}

hr {
  border: 0;
  height: 2px;
  background: linear-gradient(to right, #3498db, #9b59b6);
  margin: 30px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .top-header {
    padding-left: 70px;
  }

  #audioPlayerWindow {
    width: calc(100% - 40px);
    left: 20px;
    right: 20px;
  }
}
.blue {
  background-color: #d6defe;
  font-size: 1.5em;
  font-weight: 600;
}
.comment {
  color: #5b5b5b;
  font-weight: 500;
  font-size: 0.9em;
  font-style: italic;
}
.sub {
  font-weight: bold;
  background-color: #e9ffff;
  font-size: 25px;
}
.english-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.english-heading img {
  width: 26px;
  height: 26px;
}
.french-text {
  background-color: #fff3cd;
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid #ffc107;
  font-size: 1.2rem;
  line-height: 1.8;
}
.french-text .french-text-img {
  float: left;
  width: 160px; /* adjust as needed */
  max-width: 40%;
  margin: 0 1.5rem 1rem 0;
  padding: 0;
}
.french-text::after {
  content: "";
  display: block;
  clear: both;
}
.english-text {
  background-color: #d1ecf1;
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid #17a2b8;
  font-size: 1.2rem;
  line-height: 1.8;
}
.glossary-section {
  background-color: #f8d7da;
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid #dc3545;
  font-size: 1.2rem;
}
.supplemental-section {
  background-color: #95feca;
  padding: 25px;
  border-radius: 10px;
  border-left: 4px solid #17a2b8;
  font-size: 1.2rem;
  line-height: 1.8;
}

.glossary-item {
  margin-bottom: 10px;
}
.pho {
  color: black;
  font-weight: 400;
}

.glossary-word {
  font-weight: bold;
  color: #dc3545;
}
img {
  display: block; /* Images are inline by default, convert to block */
  margin-left: auto;
  margin-right: auto;
  max-width: 20%;
  padding: 25px;
}
.scroll-top-btn {
  position: fixed;
  bottom: 110px;
  right: 20px;
  display: none;
  z-index: 1050;
}
.scroll-top-btn.show {
  display: inline-flex;
}
.bottom-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
.tooltip-inner {
  background-color: #fff !important; /* white background */
  color: #000 !important; /* black text */
  font-size: 1.1em; /* increase font size (adjust as needed) */
  padding: 0.5rem 0.75rem; /* optional: adjust padding */
  border: 1px solid rgba(0, 0, 0, 0.15); /* optional: add a subtle border */
}
.french-text span {
  color: brown;
}
/* Audio Player Window */
#audioPlayerWindow {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  display: none;
}

#audioPlayerHeader {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 12px 15px;
  border-radius: 12px 12px 0 0;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

#closeAudio {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s;
}

#closeAudio:hover {
  background: rgba(255, 255, 255, 0.3);
}

#audioPlayerControls {
  padding: 20px;
  text-align: center;
}

#audioPlayerControls button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  margin: 0 8px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

#audioPlayerControls button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#progressContainer {
  padding: 0 15px 15px 15px;
}

.word-info {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.word-info:hover {
  color: #0d6efd;
}

.word-definition-popover {
  max-width: 350px;
}

.popover-content-custom {
  font-size: 0.9rem;
}

.word-popover {
  position: absolute;
  z-index: 1100;
  display: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
  padding: 0.75rem 1rem;
  max-width: 320px;
  font-size: 0.95rem;
}

.word-popover.is-visible {
  display: block;
}

.word-popover::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.word-popover[data-placement="right"]::after {
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: #fff;
}

.word-popover[data-placement="left"]::after {
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: #fff;
}

.word-popover__meaning {
  font-weight: 500;
}

.word-popover__ipa {
  color: #6c757d;
  margin-top: 0.25rem;
}

.word-popover__section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
  color: blue;
  font-weight: 600;
}

.word-popover__divider {
  border: 0;
  border-top: 1px solid blue;
  margin: 0.75rem 0 0.5rem;
}

.word-popover__origin {
  font-style: normal;
}

.word-info.is-active {
  color: #6610f2;
}
