/* ===============================
   RESET & BASE STYLES
================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

/* ===============================
   GRID LAYOUT
================================= */
.grid-container {
  display: grid;
  grid-template-areas: 
    "header header"
    "sidebar main";
  grid-template-columns: 300px 1fr;
  grid-template-rows: 70px 1fr;
  min-height: 100vh;
}

header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background-color: #4a6fa5;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

sidebar {
  grid-area: sidebar;
  background-color: white;
  padding: 20px;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  height: calc(100vh - 70px);
  position: sticky;
  top: 70px;
}

main {
  grid-area: main;
  padding: 30px;
  overflow-y: auto;
  background-color: #d5d5d5;
}

/* ===============================
   HEADER COMPONENTS
================================= */
.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo-icon {
  margin-right: 10px;
  font-size: 1.8rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.theme-toggle:hover {
  opacity: 0.8;
}

.language-selector select {
  padding: 5px 10px;
  border-radius: 4px;
  border: none;
  background-color: rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
}

.language-selector select option {
  color: #333;
  background-color: white;
}

.menu-toggle {
  display: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.menu-toggle:hover {
  opacity: 0.8;
}

/* ===============================
   TTS COMPONENTS - MINIMALIS
================================= */

/* TTS Target Elements */
.tts-target {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.tts-target:hover {
  opacity: 0.8;
}

/* Elemen yang sedang berbicara */
.tts-target.tts-speaking {
  background-color: rgba(74, 111, 165, 0.05);
}

/* ===============================
   WORD HIGHLIGHTING - WARNA SAJA
================================= */

/* Span untuk setiap kata */
.tts-word-span {
  display: inline;
  transition: color 0.15s ease;
}

/* Kata yang sedang di-highlight - ONLY COLOR CHANGE */
.tts-word-highlight {
  color: #e67e22 !important;
  font-weight: 600;
}

/* ===============================
   TTS TOGGLE BUTTON (HEADER)
================================= */
.tts-toggle-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tts-toggle-btn:hover {
  opacity: 0.8;
}

.tts-toggle-btn.tts-enabled {
  color: #4CAF50;
}

.tts-toggle-btn.tts-disabled {
  opacity: 0.5;
  color: #ff6b6b;
}

/* ===============================
   TTS CONTROL CONTAINER
================================= */
.tts-control-container {
  margin: 20px 0 30px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #4a6fa5;
}

.tts-control-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-weight: 600;
  color: #4a6fa5;
  font-size: 1rem;
}

.tts-control-header i {
  font-size: 1.2rem;
  color: #4a6fa5;
}

.tts-toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #4a6fa5;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.tts-status {
  font-size: 0.9rem;
  color: #555;
}

.tts-info {
  font-size: 0.8rem;
  color: #777;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

.tts-info i {
  color: #4a6fa5;
  margin-right: 4px;
}

/* ===============================
   WORD HIGHLIGHT CONTROL
================================= */
#wordHighlightControl {
  margin-top: 20px;
  border-left-color: #f39c12;
}

#wordHighlightControl .tts-control-header {
  color: #f39c12;
}

#wordHighlightControl .tts-control-header i {
  color: #f39c12;
}

#wordHighlightControl .tts-status {
  color: #f39c12;
}

/* ===============================
   KEYBOARD HINT
================================= */
.keyboard-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
}

.keyboard-hint i {
  color: #f39c12;
}

.keyboard-hint kbd {
  background: #333;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
}

/* ===============================
   SIDEBAR COMPONENTS
================================= */
.sidebar-header {
  margin-bottom: 20px;
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #4a6fa5;
}

.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  padding: 10px 10px 10px 35px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.1);
}

.menu-category {
  font-size: 0.85rem;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  margin: 20px 0 10px;
  letter-spacing: 0.5px;
}

.accordion {
  margin-bottom: 5px;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  user-select: none;
}

.accordion-header:hover {
  background-color: #e9ecef;
}

.accordion-header.active {
  background-color: #e7f1ff;
  border-color: #4a6fa5;
}

.accordion-title {
  display: flex;
  align-items: center;
  font-weight: 500;
  flex: 1;
}

.accordion-title i {
  margin-right: 10px;
  color: #4a6fa5;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.accordion-icon {
  transition: transform 0.3s;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  background-color: #f8f9fa;
  border-left: 1px solid #e9ecef;
  border-right: 1px solid #e9ecef;
}

.accordion-content.active {
  max-height: 500px;
  border-bottom: 1px solid #e9ecef;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 15px 10px 20px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  background-color: #f0f4f8;
}

.menu-item.active {
  background-color: #e7f1ff;
  color: #4a6fa5;
  font-weight: 500;
}

.menu-item i {
  margin-right: 10px;
  font-size: 0.9rem;
  color: #777;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.menu-item.active i {
  color: #4a6fa5;
}

.progress-container {
  margin-top: 30px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #555;
}

.progress-bar {
  height: 8px;
  background-color: #ccc;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: #4a6fa5;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: #777;
}

/* ===============================
   CONTENT LOADER
================================= */
#content-loader {
  background-color: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  min-height: 500px;
  transition: opacity 0.3s ease;       
}

#content-loader.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ===============================
   CONTENT HEADER
================================= */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #d5d5d5;
  margin-top: 10px;
}

.content-title {
  text-transform: uppercase;
  font-size: 2.2rem;
  font-weight: 700;
  color: #4a6fa5;
  margin-bottom: 8px;
  line-height: 1.2;
}

.content-subtitle {
  font-size: 1.1rem;
  color: #6c757d;
  font-weight: 400;
  margin-bottom: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #6c757d;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #4a6fa5;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #3a5a8a;
  text-decoration: underline;
}

.breadcrumb i {
  font-size: 0.7rem;
  color: #adb5bd;
}

/* ===============================
   CONTENT CARDS
================================= */
.content-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  border: 3px solid #d5d5d5;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.6s ease-out;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.content-card h2 {
  color: #4a6fa5;
  font-size: 2rem;
  font-weight: 600;
  /* margin-bottom: 15px; */
  padding-bottom: 10px;
  border-bottom: 2px solid #e7f1ff;
}

.content-card h3 {
  color: #4a6fa5;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 15px;
  padding-top: 10px;
}

.content-card h4 {
  color: black;
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
  opacity: 0.9;
}

.content-card p {
  line-height: 1.7;
  /* margin-bottom: 15px; */
  color: #495057;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.content-card ul,
.content-card ol {
  margin-left: 15px;
  margin-bottom: 15px;
}

.content-card ul li,
.content-card ol li {
  margin-bottom: 5px;
  color: #495057;
}

.content-card ul li:last-child,
.content-card ol li:last-child {
  margin-bottom: 0;
}

/* ===============================
   EXAMPLE BLOCKS
================================= */
.example-block {
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.example-header {
  background: #4a6fa5;
  color: white;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 1rem;
}

.example-content {
  padding: 20px;
  border: 3px solid #d5d5d5;
  background: #ffffff;
}

.example-content > p {
  margin-bottom: 1px;
  border-bottom: 1px solid #e9ecef;
}

.example-content p:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.example-content .description p {
  border-bottom: none;
  margin-top: 12px;
}

.example-content ul {
  margin-bottom: 1px;
  padding-left: 5px;
}

.example-content li {
  margin: 5px;
}

.example-content strong {
  color: #495057;;
  /* font-weight: 600; */
}

.example-content sub{
  font-size: 80%;
}

/* ===============================
   INTONATION SYMBOLS
================================= */
.falling::after {
  content: "↘";
  color: #e74c3c;
  font-size: 1.2em;
  margin-left: 8px;
  font-weight: bold;
  display: inline-block;
}

.rising::after {
  content: "↗";
  color: #27ae60;
  font-size: 1.2em;
  margin-left: 8px;
  font-weight: bold;
  display: inline-block;
}

.rise-fall::after {
  content: "↗↘";
  color: #f39c12;
  font-size: 1.2em;
  margin-left: 8px;
  font-weight: bold;
  display: inline-block;
}

/* ===============================
   IMPORTANT NOTE
================================= */
.important-note {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
  border: 2px solid #ffeaa7;
  position: relative;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.important-note::before {
  content: "💡";
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 1.5rem;
  opacity: 0.7;
}

.important-note h2 {
  color: #e67e22;
  border-bottom-color: #ffeaa7;
  margin-right: 40px;
}

/* ===============================
   TABLE STYLES
================================= */
.table {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

.isi-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
  background-color: #ffffff;
  border: 2px solid #2c3e50;
  table-layout: auto;
}

.isi-table thead {
  background: #4a6fa5;
  color: #ffffff;
}

.isi-table th {
  padding: 12px 14px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #2c3e50;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.isi-table td {
  padding: 10px 12px;
  border: 1px solid #444;
  /* vertical-align: top; */
  vertical-align: middle;
  text-align: center;
}

.isi-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.isi-table tbody tr:hover {
  background-color: #eef3f9;
  transition: background-color 0.2s ease;
}

/* .isi-table td[rowspan] {
  font-weight: 600;
  color: #2c3e50;
  text-align: center;
  vertical-align: middle;
  background-color: #f1f4f8;
} */

.isi-table td.group {
  font-weight: 600;
  color: #000;
  background-color: #f5f5f5;
  text-align: center;
  vertical-align: middle;
}

.isi-table td.function {
  font-weight: 600;
  color: #f39c12;
}

.isi-table td.word {
  font-weight: 600;
  font-style: italic;
  /* font-weight: bold; */
  color: #000;
}

.isi-table td.ipa {
  font-family: 'Arial Unicode MS', 'Lucida Sans Unicode', sans-serif;
  font-weight: 600;
  color: #000;
  text-align: center;
}

.isi-table td.meaning {
  font-weight: 600;
  color: #333;
  font-size: 12px;
  line-height: 1.5;
  background-color: #fcfcfc;
  min-width: 200px;
}

.isi-table td.separator {
  border-left: 2px solid white !important;
  border-right: 2px solid white !important;
  background-color: transparent !important;
}

/* ===============================
   TECHNIQUE STEPS
================================= */
.technique-steps ul,
.technique-steps ol {
  margin: 10px 0 10px 30px;
}

.technique-steps ul li,
.technique-steps ol li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ===============================
   TEST CONTAINER
================================= */
.test-container {
  margin-top: 20px;
}

.question {
  margin-bottom: 15px;
}

.question label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.question textarea {
  padding: 8px;
  font-size: 1rem;
  width: 100%;
  height: 80px;
  border-radius: 5px;
  border: 1px solid #ccc;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.question textarea:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.1);
}

.check-btn {
  padding: 10px 15px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.check-btn:hover {
  background-color: #45a049;
}

.check-btn:active {
  transform: translateY(1px);
}

/* ===============================
   CONTENT FOOTER & NAVIGATION
================================= */
.content-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid #e9ecef;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  background: #4a6fa5;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.nav-btn:hover {
  background: transparent;
  color: #4a6fa5;
  border: 2px solid #4a6fa5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.nav-btn:active {
  transform: translateY(0);
}

.nav-btn.outline {
  background: transparent;
  color: #4a6fa5;
  border: 2px solid #4a6fa5;
}

.nav-btn.outline:hover {
  background: #4a6fa5;
  transform: translateY(-2px);
  color: white;
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===============================
   ANIMATION
================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===============================
   ERROR STATES
================================= */
.error {
  text-align: center;
  padding: 40px;
  color: #e74c3c;
}

.error i {
  font-size: 3rem;
  margin-bottom: 15px;
}

.error p {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.error small {
  color: #777;
}

/* ===============================
   OVERLAY
================================= */
.overlay {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  background-color: rgba(0,0,0,0.5);
  z-index: 80;
  display: none;
  backdrop-filter: blur(3px);
}

.overlay.active {
  display: block;
}

/* ===============================
   DARK MODE
================================= */
body.dark-mode {
  background-color: #1a1a2e;
  color: #e6e6e6;
}

body.dark-mode header {
  background-color: #16213e;
}

body.dark-mode sidebar {
  background-color: #16213e;
  color: #e6e6e6;
}

body.dark-mode .sidebar-title {
  color: #6a9bd8;
}

body.dark-mode .search-box input {
  background-color: #1a1a2e;
  border-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .search-box input::placeholder {
  color: #6c757d;
}

body.dark-mode .search-box i {
  color: #6c757d;
}

body.dark-mode .menu-category {
  color: #a0aec0;
}

body.dark-mode .accordion-header {
  background-color: #1a1a2e;
  border-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .accordion-header:hover {
  background-color: #2d3746;
}

body.dark-mode .accordion-header.active {
  background-color: #1e3a5f;
  border-color: #4a6fa5;
}

body.dark-mode .accordion-content {
  background-color: #1a1a2e;
  border-color: #2d3746;
}

body.dark-mode .menu-item {
  border-bottom-color: #2d3746;
  background-color: #1a1a2e;
  color: #e6e6e6;
}

body.dark-mode .menu-item:hover {
  background-color: #2d3746;
}

body.dark-mode .menu-item.active {
  background-color: #1e3a5f;
  color: #6a9bd8;
}

body.dark-mode .progress-container {
  background-color: #1a1a2e;
}

body.dark-mode .progress-title {
  color: #a0aec0;
}

body.dark-mode .progress-bar {
  background-color: #2d3746;
}

body.dark-mode .progress-text {
  color: #a0aec0;
}

body.dark-mode main {
  background-color: #1a1a2e;
}

body.dark-mode #content-loader {
  background-color: #16213e;
}

body.dark-mode .content-card {
  background: #16213e;
  border-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .content-card h2 {
  color: #6a9bd8;
  border-bottom-color: #1e3a5f;
}

body.dark-mode .content-card h3 {
  color: #6a9bd8;
}

body.dark-mode .content-card p,
body.dark-mode .content-card ul li,
body.dark-mode .content-card ol li {
  color: #e6e6e6;
}

body.dark-mode .example-block {
  background: #1a1a2e;
  border-color: #2d3746;
}

body.dark-mode .example-content {
  background: #16213e;
  border-color: #2d3746;
}

body.dark-mode .example-content p {
  border-bottom-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .example-content strong {
  color: #6a9bd8;
}

body.dark-mode .important-note {
  background: linear-gradient(135deg, #2d1b00 0%, #4a2c00 100%);
  border-color: #664200;
}

body.dark-mode .important-note h2 {
  color: #ffa726;
  border-bottom-color: #664200;
}

body.dark-mode .important-note p {
  color: #e6e6e6;
}

body.dark-mode .content-header {
  border-bottom-color: #2d3746;
}

body.dark-mode .breadcrumb {
  color: #a0aec0;
}

body.dark-mode .breadcrumb a {
  color: #6a9bd8;
}

body.dark-mode .breadcrumb a:hover {
  color: #8bb4f0;
}

body.dark-mode .content-footer {
  border-top-color: #2d3746;
}

body.dark-mode .nav-btn.outline {
  color: #6a9bd8;
  border-color: #6a9bd8;
}

body.dark-mode .nav-btn.outline:hover {
  background: #6a9bd8;
  color: #16213e;
}

body.dark-mode .isi-table {
  background-color: #16213e;
  border-color: #2d3746;
}

body.dark-mode .isi-table thead {
  background: #1e3a5f;
}

body.dark-mode .isi-table th {
  border-color: #2d3746;
}

body.dark-mode .isi-table td {
  border-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .isi-table tbody tr:nth-child(even) {
  background-color: #1a1a2e;
}

body.dark-mode .isi-table tbody tr:hover {
  background-color: #2d3746;
}

body.dark-mode .isi-table td[rowspan] {
  background-color: #1e3a5f;
  color: #e6e6e6;
}

body.dark-mode .isi-table td.meaning {
  background-color: #1a1a2e;
  color: #e6e6e6;
}

body.dark-mode .isi-table td.group {
  background-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .isi-table td.function {
  color: #f39c12;
}

body.dark-mode .isi-table td.word {
  color: #e6e6e6;
}

body.dark-mode .isi-table td.ipa {
  color: #e6e6e6;
}

body.dark-mode .test-container label {
  color: #e6e6e6;
}

body.dark-mode .question textarea {
  background-color: #1a1a2e;
  border-color: #2d3746;
  color: #e6e6e6;
}

body.dark-mode .question textarea:focus {
  border-color: #6a9bd8;
  box-shadow: 0 0 0 2px rgba(106, 155, 216, 0.1);
}

body.dark-mode .error small {
  color: #a0aec0;
}

/* Dark Mode TTS */
body.dark-mode .tts-control-container {
  background-color: #1a1a2e;
  border-left-color: #6a9bd8;
}

body.dark-mode .tts-control-header {
  color: #6a9bd8;
}

body.dark-mode .tts-control-header i {
  color: #6a9bd8;
}

body.dark-mode .tts-info {
  color: #a0aec0;
  border-top-color: #2d3746;
}

body.dark-mode .tts-info i {
  color: #6a9bd8;
}

body.dark-mode .tts-status {
  color: #a0aec0;
}

body.dark-mode .tts-word-highlight {
  color: #f39c12 !important;
}

body.dark-mode #wordHighlightControl {
  border-left-color: #f39c12;
}

body.dark-mode #wordHighlightControl .tts-control-header {
  color: #f39c12;
}

body.dark-mode #wordHighlightControl .tts-control-header i {
  color: #f39c12;
}

body.dark-mode .tts-target.tts-speaking {
  background-color: rgba(106, 155, 216, 0.1);
}

/* ===============================
   RESPONSIVE DESIGN
================================= */

/* Tablet (768px - 992px) */
@media (max-width: 992px) {
  .grid-container {
    grid-template-areas: 
      "header header"
      "main main";
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: block;
  }

  sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    transform: translateX(-100%);
    z-index: 90;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }

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

  .logo {
    font-size: 1.3rem;
  }
  
  .logo-icon {
    font-size: 1.5rem;
  }
  
  .header-controls {
    gap: 12px;
  }
  
  .language-selector select {
    padding: 4px 8px;
    font-size: 0.9rem;
  }
  
  .theme-toggle {
    font-size: 1.1rem;
  }

  .tts-toggle-btn {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }

  main {
    padding: 25px;
  }
  
  .keyboard-hint {
    bottom: 15px;
    right: 15px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* Tablet (768px) */
@media (max-width: 768px) {
  .content-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 15px;
  }
  
  .content-title {
    font-size: 1.8rem;
  }
  
  .content-subtitle {
    font-size: 1rem;
  }
  
  .breadcrumb {
    font-size: 0.85rem;
    width: 100%;
  }

  .content-card {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .content-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }
  
  .content-card h3 {
    font-size: 1.3rem;
    margin-top: 12px;
    padding-top: 8px;
  }
  
  .content-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
  }
  
  .content-card ul li,
  .content-card ol li {
    margin-left: 18px;
    font-size: 0.95rem;
  }

  .example-block {
    margin: 15px 0;
  }
  
  .example-header {
    padding: 10px 15px;
    font-size: 0.95rem;
  }
  
  .example-content {
    padding: 15px;
  }
  
  .example-content p {
    padding: 6px 0;
    font-size: 0.95rem;
  }

  .important-note {
    padding: 15px;
  }
  
  .important-note::before {
    top: 15px;
    right: 15px;
    font-size: 1.3rem;
  }
  
  .important-note h2 {
    font-size: 1.4rem;
  }

  .isi-table {
    font-size: 12px;
    min-width: 600px;
  }
  
  .isi-table th {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .isi-table td {
    padding: 8px 10px;
  }
  
  .isi-table td.meaning {
    font-size: 11px;
    line-height: 1.4;
    min-width: 180px;
  }
  
  .table {
    margin: 15px 0;
  }

  .content-footer {
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
  }

  .nav-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .question textarea {
    height: 70px;
    font-size: 0.95rem;
  }
  
  .check-btn {
    padding: 9px 14px;
    font-size: 0.9rem;
  }
  
  .tts-control-container {
    padding: 12px;
  }
  
  .tts-control-header {
    font-size: 0.95rem;
  }
  
  .tts-control-header i {
    font-size: 1.1rem;
  }
  
  .switch {
    width: 46px;
    height: 22px;
  }
  
  .slider:before {
    height: 16px;
    width: 16px;
  }
  
  input:checked + .slider:before {
    transform: translateX(24px);
  }
  
  .tts-status {
    font-size: 0.85rem;
  }
  
  .tts-info {
    font-size: 0.75rem;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  header {
    padding: 0 12px;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .logo-icon {
    font-size: 1.3rem;
    margin-right: 6px;
  }
  
  .header-controls {
    gap: 8px;
  }
  
  .theme-toggle {
    font-size: 1rem;
  }
  
  .language-selector select {
    padding: 3px 6px;
    font-size: 0.8rem;
    max-width: 90px;
  }
  
  .menu-toggle {
    font-size: 1.1rem;
  }
  
  .tts-toggle-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  main {
    padding: 15px;
  }

  .content-title {
    font-size: 1.5rem;
  }
  
  .content-subtitle {
    font-size: 0.9rem;
  }
  
  .breadcrumb {
    font-size: 0.8rem;
    gap: 5px;
  }

  .content-card {
    padding: 15px;
    border-radius: 10px;
    border-width: 2px;
  }
  
  .content-card h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }
  
  .content-card h3 {
    font-size: 1.1rem;
    margin-top: 10px;
  }
  
  .content-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
  }
  
  .content-card ul li,
  .content-card ol li {
    margin-left: 15px;
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .example-header {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .example-content {
    padding: 12px;
  }
  
  .example-content p {
    font-size: 0.9rem;
    padding: 4px 0;
    margin-bottom: 8px;
  }

  .important-note {
    padding: 12px;
  }
  
  .important-note::before {
    top: 12px;
    right: 12px;
    font-size: 1.2rem;
  }
  
  .important-note h2 {
    font-size: 1.2rem;
  }

  .isi-table {
    font-size: 11px;
    min-width: 500px;
  }
  
  .isi-table th {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .isi-table td {
    padding: 6px 8px;
  }
  
  .isi-table td.meaning {
    font-size: 10px;
    line-height: 1.4;
    min-width: 150px;
  }

  .content-footer {
    margin-top: 25px;
    padding-top: 18px;
  }

  .nav-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
    gap: 8px;
  }

  .question textarea {
    height: 60px;
    font-size: 0.9rem;
    padding: 6px;
  }
  
  .check-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .falling::after,
  .rising::after,
  .rise-fall::after {
    font-size: 1em;
    margin-left: 5px;
  }

  .progress-container {
    padding: 12px;
    margin-top: 20px;
  }
  
  .progress-title {
    font-size: 0.85rem;
  }
  
  .progress-text {
    font-size: 0.75rem;
  }

  sidebar {
    width: 260px;
  }
  
  .sidebar-title {
    font-size: 1.1rem;
  }
  
  .search-box input {
    padding: 8px 8px 8px 32px;
    font-size: 0.85rem;
  }
  
  .search-box i {
    left: 10px;
    font-size: 0.9rem;
  }
  
  .menu-category {
    font-size: 0.8rem;
    margin: 15px 0 8px;
  }
  
  .accordion-header {
    padding: 10px 12px;
  }
  
  .accordion-title {
    font-size: 0.9rem;
  }
  
  .accordion-title i {
    font-size: 0.9rem;
    margin-right: 8px;
  }
  
  .menu-item {
    padding: 8px 12px 8px 16px;
    font-size: 0.9rem;
  }
  
  .menu-item i {
    font-size: 0.8rem;
    margin-right: 8px;
  }
  
  .tts-control-container {
    padding: 10px;
    margin: 15px 0 20px;
  }
  
  .tts-target.tts-speaking {
    background-color: transparent;
  }
  
  .keyboard-hint {
    display: none;
  }
}

/* Small Mobile (360px) */
@media (max-width: 360px) {
  .logo {
    font-size: 1rem;
  }
  
  .logo-icon {
    font-size: 1.2rem;
    margin-right: 4px;
  }
  
  .language-selector select {
    max-width: 75px;
    font-size: 0.75rem;
    padding: 2px 4px;
  }
  
  .theme-toggle {
    font-size: 0.95rem;
  }
  
  .menu-toggle {
    font-size: 1rem;
  }

  .content-title {
    font-size: 1.3rem;
  }
  
  .content-subtitle {
    font-size: 0.85rem;
  }
  
  .breadcrumb {
    font-size: 0.75rem;
  }
  
  .content-card {
    padding: 12px;
  }
  
  .content-card h2 {
    font-size: 1.2rem;
  }
  
  .content-card h3 {
    font-size: 1rem;
  }
  
  .content-card p,
  .content-card ul li,
  .content-card ol li {
    font-size: 0.85rem;
  }

  .isi-table {
    font-size: 10px;
    min-width: 450px;
  }
  
  .isi-table th {
    padding: 5px 6px;
    font-size: 10px;
  }
  
  .isi-table td {
    padding: 5px 6px;
  }
  
  .isi-table td.meaning {
    font-size: 9px;
    line-height: 1.3;
    min-width: 130px;
  }

  .example-header {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  .example-content {
    padding: 10px;
  }
  
  .example-content p {
    font-size: 0.85rem;
    padding: 4px 0;
  }

  .nav-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  sidebar {
    width: 240px;
  }
  
  .accordion-title {
    font-size: 0.85rem;
  }
  
  .menu-item {
    font-size: 0.85rem;
    padding: 7px 10px 7px 14px;
  }
}

/* Landscape Mode */
@media (max-width: 768px) and (orientation: landscape) {
  sidebar {
    top: 70px;
    height: calc(100vh - 70px);
    width: 260px;
  }
  
  .overlay {
    top: 70px;
    height: calc(100vh - 70px);
  }
  
  main {
    padding: 15px;
  }
  
  .content-card {
    padding: 15px;
  }
  
  .isi-table {
    font-size: 12px;
  }
  
  .question textarea {
    height: 50px;
  }
  
  .tts-control-container {
    margin: 10px 0 15px;
  }
  
  .keyboard-hint {
    bottom: 10px;
    right: 10px;
  }
}

/* High-resolution Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-container {
    grid-template-columns: 260px 1fr;
  }
  
  .content-title {
    font-size: 2rem;
  }
  
  .content-card h2 {
    font-size: 1.7rem;
  }
  
  .content-card p {
    font-size: 0.98rem;
  }
  
  main {
    padding: 25px;
  }
  
  .content-card {
    padding: 22px;
  }
}

/* ===============================
   PRINT STYLES
================================= */
@media print {
  .content-footer,
  .breadcrumb,
  .menu-toggle,
  .header-controls,
  .overlay,
  sidebar,
  .tts-control-container,
  .tts-toggle-btn,
  .keyboard-hint {
    display: none !important;
  }

  .content-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .example-block {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .grid-container {
    grid-template-areas: "header" "main";
    grid-template-columns: 1fr;
  }
  
  header {
    position: static;
  }
  
  main {
    padding: 15px;
    background-color: white;
  }
  
  .isi-table {
    border: 1px solid #000;
  }
  
  .isi-table th {
    background-color: #f0f0f0 !important;
    color: #000 !important;
  }
  
  .important-note::before {
    display: none;
  }
  
  .tts-target {
    cursor: default;
  }
  
  .tts-target:hover {
    background: none;
  }
  
  .tts-word-highlight {
    color: inherit !important;
    font-weight: normal;
  }
}

/* ===============================
   ACCESSIBILITY
================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid #4a6fa5;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .tts-target.tts-speaking {
    outline: 2px solid #007bff;
    background: transparent;
  }
  
  .tts-toggle-btn.tts-disabled {
    opacity: 1;
    color: #ff0000;
  }
  
  .switch .slider {
    border: 2px solid currentColor;
  }
  
  .tts-word-highlight {
    color: #0000ff !important;
    font-weight: bold;
  }
}

.dialogue-chat {
  margin-top: 15px;
}

.dialogue {
  display: flex;
  margin-bottom: 12px;
}

.dialogue.left {
  justify-content: flex-start;
}

.dialogue.right {
  justify-content: flex-end;
}

.dialogue-bubble {
  max-width: 40%;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f1f1f1;
  line-height: 1.4;
}

.dialogue.right .dialogue-bubble {
  background: #dff4ff;
}

.translation {
  font-size: 0.9rem;
  color: #666;
  margin-top: 4px;
}

.syllable-container {
    position: relative;
    display: inline-block;
    margin-bottom: 5px; /* Memberi ruang untuk angka di bawah */
}

.syllable-word {
    display: inline-block;
}

.syllable-number {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -18px; /* Turunkan sedikit lebih jauh */
    font-size: 0.8rem;
    color: #e67e22;
    font-weight: bold;
}

/* Memberi jarak ekstra untuk item list yang memiliki angka di bawah */
.syllable-list-item {
    margin-bottom: 10px !important; /* Memaksa jarak lebih besar */
    line-height: 2; /* Menambah line height */
}






.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* padding-bottom: 20px; */
  padding: 10px 10px 10px 0px;
  background: #f9f9f9;
  border-radius: 12px;
}


.formula .over {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  transform: translateY(2px); /* Penyesuaian halus */
  color: #495057;
}

/* CSS untuk garis */
.formula .line {
  width: 100%;
  height: 2px;
  background-color: #495057; /* Warna hitam untuk garis */
  margin: 5px 0px 2px 0px;
}

.formula .sup {
  /* font-weight: 500; */
  line-height: 1;
  color: #495057;
}

.formula .sub {
  font-size: 80%;
  color: #495057;
  line-height: 1;
}





/* Styling untuk ordered list - VERTIKAL */
.formula ol {
  margin: 0;
  padding-left: 24px;
  list-style-position: outside;
}

.formula ol li {
  margin: 6px 0;
  padding: 2px 0;
  font-weight: 500;
}

/* Class khusus untuk curly brace */
.formula .brace {
  font-size: 72px;
  font-weight: 500;
  margin: 0 8px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Optional: styling tambahan untuk teks */
.formula .description {
  font-weight: 500;
  font-size: 16px;
  color: #333;
}






        /* Container untuk setiap blok contoh */
        .container {
            /* background: white; */
            /* border-radius: 28px; */
            /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.02); */
            /* margin-bottom: 2.5rem; */
            /* padding: 1.5rem 1.2rem 2rem 1.2rem; */
            display: flex;
            align-items: flex-start; /* biar sejajar atas */
            gap: 20px;
            transition: box-shadow 0.2s ease;
            align-items: center;
        }

        .container > span {
            font-size: 24px;
            display: flex;
            align-items: center;
        }
        
/* 
        .container:hover {
            box-shadow: 0 16px 28px rgba(0, 0, 0, 0.08);
        } */

        /* Setiap contoh (relative untuk canvas absolute) */
        .example {
            display: flex;
            flex-direction: column;
            justify-content: center; /* ⬅️ bikin isi example lebih seimbang */
        }
        .example {
            position: relative;
            margin: 0;
            /* padding: 0.5rem 0 1.2rem 0; */
        }

        /* Kalimat atas */
        .sentence {
            padding: 0rem 0.9rem;
            margin-bottom: 1rem;
            font-size: 1.2rem;
            /* background: #f8fafc; */
            border-radius: 20px;
            /* border: 1px solid #e2e8f0; */
            line-height: 1.6;
            color: black;
        }

        /* Kata yang ditandai (garis bawah tebal) */
        .underline {
            text-decoration: underline;
            text-decoration-thickness: 3px;
            text-underline-offset: 6px;
            font-weight: 700;
            color: black;
            /* background: rgba(59, 130, 246, 0.08); */
            padding: 0 2px;
            border-radius: 8px;
            cursor: default;
            transition: background 0.1s ease;
        }

        /* Bagian bawah (target kata tanya / penjelasan) */
        .bottom {
            display: flex;
            /* gap: 1.2rem; */
            /* flex-wrap: wrap; */
            margin-top: 2.2rem;
            padding-left: 0.5rem;
            align-items: center;
        }

        /* Target kata (question word atau definisi) */
        .target {
            font-weight: 600;
            /* background: #eef2ff; */
            padding: 0.5rem 1rem;
            border-radius: 40px;
            font-size: 0.95rem;
            color: black;
            display: inline-block;
            /* box-shadow: 0 1px 2px rgba(0,0,0,0.02); */
            /* border: 1px solid #cbd5e1; */
            backdrop-filter: blur(2px);
        }

        /* Canvas container — posisi absolut di dalam .example */
        .arrow-canvas-container {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 10;
        }

        .arrow-canvas {
            width: 100%;
            height: 100%;
            display: block;
        }

        /* Responsive */
        @media (max-width: 640px) {

            .container {
                padding: 1rem 0.8rem 1.8rem 0.8rem;
            }
            .sentence {
                font-size: 1rem;
                padding: 0.6rem 0.8rem;
            }
            .target {
                font-size: 0.85rem;
                padding: 0.4rem 0.8rem;
            }
            .bottom {
                gap: 0.8rem;
                margin-top: 1.8rem;
            }
        }

        @media (max-width: 480px) {
            .sentence {
                font-size: 0.9rem;
            }
            .underline {
                text-decoration-thickness: 2.5px;
                text-underline-offset: 4px;
            }
        }

        /* tweak untuk contoh indefinite article supaya target sejajar */
        
        /* gaya untuk strong di dalam sentence */
        .sentence strong {
            /* color: #2c3e66; */
            font-weight: 600;
        }





.no-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.group {
  margin-bottom: 10px;
}

.inner-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.single {
  margin-top: 5px;
}

.brace.big {
  font-size: 90px;
}
