p.ridge {border-style: ridge;}
/* Set height of the grid so .sidenav can be 100% (adjust if needed) */
.row.content {height: 800px }

/* Set gray background color and 100% height */
.sidenav {
  height: 80%;
  
}
h1 {
  font-size: 1.5em;
}

h2 {
  font-size: 1.2em;
}
#pageheaderpc {
  color: rgba(9,110,235,0.98);
}

/* Unit label: prominent, no button look */
.unit-label {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 600;
  color: rgba(9,110,235,0.98);
  letter-spacing: 0.02em;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(9,110,235,0.25);
}

.unit-label-mobile-wrap {
  display: none;
}

#pageheadersp {
  display: none;
}

.word_textstl{
  font-size:2.5em;
}
.kanji_textstl{
  font-size:5.2rem;
  font-weight: 800;
  color: rgba(8,40,120,0.98);
  line-height: 0.98;
}

/* Make the Kanji `#word_text` use the same accent color as `.word_textstl` in index.html */
#word_text {
  color: rgba(9,110,235,0.98);
}
.word_readingstl{
  font-size:0.8em;
}
.word_meaningstl{
  font-size:0.8em;
}
.word_notestl{
  font-size:1.2em;
}

/* Set black background color, white text and some padding */
footer {
  background-color: #555;
  color: white;
  padding: 15px;
}
.page_title{
  width: 100%;
  border-style: none none groove none;
  background: linear-gradient(90deg, rgba(9,110,235,0.08), rgba(59,130,246,0.03));
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 28px rgba(11, 22, 36, 0.04);
}
.page_title h1{ color: rgba(9,110,235,0.98); font-weight:700; margin:0; }
/* Sidebar and layout improvements */
.sidenav {
  padding-right: 0.5rem;
}

.sticky-sidebar {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow: auto;
  padding-right: 0.25rem;
}

.result-list .table {
  margin-bottom: 0;
}

/* Card and image layout */
.word-image-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 991px) {
  .word-image-wrapper {
    max-width: 100% !important;
    margin-left: 0 !important;
  }
}

/* Slight spacing for main card */
.card {
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
}

/* Keep search input fixed inside the sidebar while result list scrolls */
.search-sticky {
  position: sticky;
  top: 0;
  z-index: 6;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* Enhanced input-group styling - "lung linh" appearance for search boxes */
.search-sticky .input-group,
#wordInfomationGroup.input-group {
  position: relative;
  box-shadow: 0 6px 20px rgba(59,130,246,0.12), 0 2px 8px rgba(15,23,42,0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.search-sticky .input-group:hover,
#wordInfomationGroup.input-group:hover {
  box-shadow: 0 10px 28px rgba(59,130,246,0.18), 0 4px 12px rgba(15,23,42,0.08);
}

.search-sticky .input-group:focus-within,
#wordInfomationGroup.input-group:focus-within {
  box-shadow: 0 10px 32px rgba(59,130,246,0.24), 0 4px 14px rgba(30,64,175,0.12);
  transform: translateY(-1px);
}

.search-sticky .input-group .form-control,
#wordInfomationGroup .form-control {
  border: none !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,255,0.98));
  padding: 0.65rem 0.95rem;
  font-size: 1rem;
  color: rgba(15,23,42,0.92);
  transition: all 0.2s ease;
  border-radius: 12px 0 0 12px;
  box-shadow: none !important;
}

.search-sticky .input-group input[type="text"],
#wordInfomationGroup input[type="text"] {
  border: none !important;
  box-shadow: none !important;
}

.search-sticky .input-group .form-control:focus,
#wordInfomationGroup .form-control:focus {
  border: none !important;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(245,250,255,0.99));
  box-shadow: none !important;
  outline: none;
}

.search-sticky .input-group .form-control::placeholder,
#wordInfomationGroup .form-control::placeholder {
  color: rgba(148,163,184,0.75);
  font-style: italic;
}

.search-sticky .input-group-append,
#wordInfomationGroup .input-group-append {
  display: flex;
}

.search-sticky .input-group-append .btn,
#wordInfomationGroup .input-group-append .btn {
  border: 1px solid rgba(59,130,246,0.2);
  border-left: none;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.search-sticky .input-group-append .btn:last-child,
#wordInfomationGroup .input-group-append .btn:last-child {
  border-radius: 0 12px 12px 0;
}

.search-sticky .input-group-append .btn-primary,
#wordInfomationGroup .input-group-append .btn-primary {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.search-sticky .input-group-append .btn-primary:hover,
#wordInfomationGroup .input-group-append .btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 4px 12px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}

.search-sticky .input-group-append .btn-primary:active,
#wordInfomationGroup .input-group-append .btn-primary:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.search-sticky .input-group-append .btn-default,
#wordInfomationGroup .input-group-append .btn-default {
  background: linear-gradient(135deg, rgba(248,250,252,0.98), rgba(241,245,249,0.98));
  color: rgba(71,85,105,0.9);
  border-right: 1px solid rgba(203,213,225,0.5);
  border-radius: 0;
}

.search-sticky .input-group-append .btn-default:hover,
#wordInfomationGroup .input-group-append .btn-default:hover {
  background: linear-gradient(135deg, rgba(241,245,249,0.98), rgba(226,232,240,0.98));
  color: rgba(51,65,85,1);
}

@media (max-width: 767px) {
  .search-sticky .input-group .form-control,
  #wordInfomationGroup .form-control {
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
  }
  
  .search-sticky .input-group-append .btn,
  #wordInfomationGroup .input-group-append .btn {
    padding: 0.55rem 0.9rem;
  }
}

.result-list {
  /* leave room for page header + search area */
  max-height: calc(100vh - 220px);
  overflow: auto;
}

/* Unified vocabulary list enhancements - used across all pages */
.vocabulary-list-card {
  border: 1px solid rgba(59,130,246,0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,250,255,0.96));
  box-shadow: 0 14px 34px rgba(59,130,246,0.12), 0 6px 16px rgba(15,23,42,0.06);
  border-radius: 14px;
}

.vocabulary-word-table {
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-bottom: 0;
}

.vocabulary-word-table tbody tr {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.vocabulary-word-table tbody td {
  background: rgba(255,255,255,0.94);
  border-top: 1px solid rgba(59,130,246,0.1);
  border-bottom: 1px solid rgba(59,130,246,0.1);
  padding: 0.52rem 0.62rem;
  color: rgba(21,43,92,0.92);
  vertical-align: middle;
}

.vocabulary-word-table tbody td:first-child {
  border-left: 1px solid rgba(59,130,246,0.18);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  font-weight: 700;
  color: #0b4dcf;
  background: linear-gradient(180deg, rgba(230,242,255,0.95), rgba(245,250,255,0.95));
}

.vocabulary-word-table tbody td:last-child {
  border-right: 1px solid rgba(59,130,246,0.18);
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  font-weight: 600;
}

.vocabulary-word-table tbody tr:hover {
  transform: translateY(-1px) scale(1.004);
}

.vocabulary-word-table tbody tr:hover td {
  background: linear-gradient(180deg, rgba(232,244,255,0.97), rgba(248,252,255,0.97));
  box-shadow: 0 10px 22px rgba(59,130,246,0.14);
}

@media (max-width: 767px) {
  .vocabulary-word-table {
    border-spacing: 0 6px;
  }

  .vocabulary-word-table tbody td {
    font-size: 0.82rem;
    padding: 0.44rem 0.46rem;
  }
}

/* Emphasize main word details */
.word-card {
  border-left: 6px solid rgba(30,144,255,0.9);
  box-shadow: 0 14px 40px rgba(16,24,40,0.12);
}

/* Enhanced word detail styling */
.word-card .card-body {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 1.5rem;
  overflow-x: hidden;
  word-break: break-word;
}

.word-card .d-flex {
  overflow-x: hidden;
  min-width: 0;
}

.word_textstl{
  font-size:3.2rem;
  font-weight: 700;
  color: rgba(9,110,235,0.98);
  line-height: 1.02;
  margin-bottom: 0.25rem;
}

.word_readingstl{
  font-size: 0.8rem;
  color: rgba(8,40,120,0.85);
  background: rgba(30,144,255,0.07);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  display: inline-block;
  margin-right: 0.5rem;
  word-break: break-word;
  max-width: 100%;
}

#word_pos{
  display: inline-block;
  background: rgba(15,23,42,0.06);
  color: rgba(15,23,42,0.8);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  margin-left: 0.4rem;
}

.word_meaningstl{
  font-size: 0.95rem;
  color: rgba(12,34,80,0.92);
  margin-top: 0.6rem;
  white-space: pre-line;
}

.word_notestl{
  font-size: 1.5rem;
  color: rgb(34, 38, 42);
  margin-top: 0.9rem;
  background: rgba(230,245,255,0.85);
  border-left: 4px solid rgba(30,144,255,0.22);
  padding: 0.8rem;
  border-radius: 8px;
  min-height: 7.1rem;
}

/* Make meaning / kun / on blocks visually consistent with notes */
#word_meaning,
#word_kun,
#word_on {
  font-size: 1rem;
  color: rgb(36, 39, 43);
  margin-top: 0.6rem;
  background: rgba(240,246,255,0.55);
  border-left: 3px solid rgba(30,144,255,0.14);
  padding: 0.5rem;
  border-radius: 6px;
  white-space: pre-line;
}

/* Subtitle label for sub-sections (Âm kun / Âm On) */
.word-subtitle{
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(8,40,120,0.6);
  margin-bottom: 0.35rem;
}

/* Slightly larger meaning / kun / on within card for better hierarchy */
.word-meaning-block {
  font-size: 1.02rem;
}

/* subtle divider between header and content */
.word-card .card-body > .d-flex + .word_textstl {
  margin-top: 0.4rem;
}

@media (max-width: 767px) {
  .word_textstl { font-size: 2.2rem; }
  .word_meaningstl { font-size: 1rem; }
  .word_notestl { font-size: 1.25rem; }
  .word-card .card-body { padding: 1rem; }
}

@media (max-width: 576px) {
  .word_textstl { font-size: 1.8rem; }
  .word_meaningstl { font-size: 0.9rem; }
  .word_notestl { font-size: 1.15rem; }
  .word-card .card-body { padding: 0.75rem; }
}

/* Layout for reading and part-of-speech on small screens */
@media (max-width: 576px) {
  .word-meta {
    display: flex !important;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
  }

  /* Allocate ~2/3 width to reading and fixed 1/3 to POS */
  #word_reading {
    flex: 1 1 calc(66.666% - 0.5rem);
    text-align: left;
    overflow: hidden;
    white-space: normal;
  }

  #word_pos {
    flex: 0 0 33.333% !important;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 1.6rem; /* keep space even when empty */
  }
}

.word_textstl{
  font-size:3em;
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* De-emphasize comments */
#div_comment {
  background-color: #f6f8fa;
  color: #6b7280;
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 60px;
  max-height: 450px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.3s ease;
  word-break: break-word;
}

/* Hide comments section if no actual comments exist */
#div_comment tbody:empty + div {
  display: none;
}

/* Adjust max-height for mobile */
@media (max-width: 576px) {
  #div_comment {
    min-height: 50px;
    max-height: 300px;
  }
}

.comment-input-area .form-control{
  background: #fff;
}

.comment-input-area .btn-primary{
  background-color: rgba(30,144,255,0.9);
  border-color: rgba(30,144,255,0.9);
}

/* Toggle buttons for unit view (glossy + active state) */
.toggle-btn{
  border-radius:10px;
  background: linear-gradient(180deg, rgba(59,130,246,0.95), rgba(99,102,241,0.95));
  color: #fff;
  border: none;
  padding: .35rem .7rem;
  box-shadow: 0 6px 18px rgba(59,130,246,0.12);
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
  opacity: .95;
}
.toggle-btn:hover{ transform: translateY(-2px); box-shadow: 0 12px 30px rgba(59,130,246,0.16); }
.toggle-btn:focus{ outline: none; box-shadow: 0 12px 30px rgba(59,130,246,0.18); }
.toggle-btn.active{
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  color: #fff;
  opacity: 1;
  box-shadow: 0 18px 40px rgba(59,130,246,0.22);
}
.toggle-btn.inactive{
  background: linear-gradient(180deg, #f3f6fb, #ffffff);
  color: #12325a;
  border: 1px solid rgba(9,110,235,0.08);
  box-shadow: none;
}

/* Muted name input for comment author */
.comment-input-area .comment-name{
  max-width: 100%;
  font-size: 0.85rem;
  color: rgba(0,0,0,0.45);
  background: transparent;
  border: none;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.comment-input-area .comment-name::placeholder{
  color: rgba(0,0,0,0.32);
}

.comment-input-area .comment-name:focus{
  outline: none;
  box-shadow: none;
  color: rgba(0,0,0,0.7);
}

/* Mobile: keep comment input + send on one row filling width, name below */
@media (max-width: 576px) {
  .comment-input-area {
    padding: 0 0.5rem;
  }

  .comment-input-area .input-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
  }

  .comment-input-area .input-row .form-control {
    flex: 1 1 auto;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    min-width: 0;
  }

  .comment-input-area .input-row .input-group-append {
    display: flex;
  }

  .comment-input-area .input-row .input-group-append .btn {
    flex: 0 0 auto;
    padding: 0.45rem 0.5rem;
    min-width: 40px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .comment-input-area .comment-name {
    width: 100%;
    margin-top: 8px;
    font-size: 0.75rem;
    text-align: left;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }
}

/* Extra small screens (iPhone SE, iPhone 11 mini, etc.) */
@media (max-width: 390px) {
  .comment-input-area {
    padding: 0 0.3rem;
  }

  .comment-input-area .input-row {
    gap: 4px;
  }

  .comment-input-area .input-row .form-control {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }

  .comment-input-area .input-row .input-group-append .btn {
    padding: 0.4rem 0.35rem;
    min-width: 36px;
    min-height: 36px;
    font-size: 0.9rem;
  }

  .comment-input-area .comment-name {
    font-size: 0.7rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}
#result_list{
  height: 80%;
}
#scroll_word{
  height: 80%;
}
#word_pos {
    font-size: 10px;
    color: #787676;
    margin-left: 8px;
    font-style: italic;
}
.leftImage {
  top: 100px; /* your required value */
  align-self: flex-start;
  position: fixed;
  display: flex;
  height: 400px;
  align-items: center;
  justify-content: center;
}

.rightImage {
  top: 100px; /* your required value */
  right: 0;
  position: fixed;
  display: flex;
  height: 400px;
  align-items: center;
  justify-content: center;
}

/* Placeholder color and alignment */
::placeholder {
  color: #cccccc; /* Paler color */
  text-align: left; /* Align left */
}

.input-group input:focus + .clear-btn,
.input-group input:not(:placeholder-shown) + .clear-btn {
  display: block;
}

/* On small screens, set height to 'auto' for sidenav and grid */
@media screen and (max-width: 767px) {
  .sidenav {
    height: fit-content;
  }
  .nav-link,
  .custom-navbar .dropdown-item {
    font-size: small;
  }
  .page_title{
    width: 100%; 
    border: 1px solid rgba(9,110,235,0.2);
    background: linear-gradient(90deg, rgba(9,110,235,0.12), rgba(59,130,246,0.06));
    box-shadow: 0 6px 18px rgba(9,110,235,0.12);
  }
  .leftImage {
    left: 0;
  }
  .sp-center{
    text-align: center!important;
    width: 100%;
  }
  #result_list{
    display: none;
    height:350px;
  }
  #scroll_word{
    height:350px;
  }
  #word_reading{
    float: none; width: auto; text-align: left;
  }
  #word_text{
    float: none; width:100%; text-align: left;
  }
  #word_meaning{
    float: none; width:100%; text-align: left;
  }
  #word_note{
    float: none; width:100%; text-align: left;
  }
  #pageheaderpc {
    color: rgba(9,110,235,0.98);
    display: none;
  }

  #pageheadersp {
    color: rgba(9,110,235,0.98);
    display: block;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  }

  .unit-label-mobile-wrap {
    display: block;
    margin-top: 0.45rem;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }

  .unit-label-mobile-wrap .unit-label {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.2rem 1rem;
    border-radius: 6px;
    letter-spacing: 0.01em;
  }

  .unit-label-desktop-wrap {
    display: none;
  }

  .row.content {height: auto;} 
}

.avatar{
  height: 50px; 
  width:50px ;
}
/* Units list container styling */
#unitsList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 8px;
  justify-content: center;
}

/* Unit button styling - enhanced for "lung linh" appearance */
.unit {
  margin: 0;
  min-width: 90px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0b4dcf;
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(235,245,255,0.96) 100%);
  border: 1px solid rgba(59,130,246,0.22);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(59,130,246,0.15), 0 2px 6px rgba(15,23,42,0.08);
  transition: all 0.2s ease;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.unit:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(135deg, rgba(240,248,255,0.98) 0%, rgba(225,242,255,0.98) 100%);
  box-shadow: 0 10px 24px rgba(59,130,246,0.25), 0 4px 12px rgba(30,64,175,0.15);
  border-color: rgba(59,130,246,0.35);
  color: #0847a8;
}

.unit:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}

.unit:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

@media (max-width: 767px) {
  #unitsList {
    gap: 8px;
    padding: 10px 6px;
  }
  
  .unit {
    min-width: 75px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}

/* Kanji radicals: mobile-friendly scrolling and layout */
#radicals_info {
  overflow: visible;
  max-height: none;
}

@media (max-width: 576px) {
  #radicals_visjs {
    max-width: calc(100% - 20px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    height: 250px;
  }
}

  .combobutton{
    background-color: #59a1ee; 
    border: none;
    width: 40%; 
    border-radius: 3px; 
    color: #FFFFFF; 
    margin: 4px; 
    padding: 8px; 
    font-size: 12px;
  }

  #added_by {
    width: 25%;
    float: right;
    border: none;
    text-align: right;  
  }

/* Navbar styles */
.navbar-nav .dropdown-menu {
  border: none;
  background-color: rgba(9, 110, 235, 0.5);
}

/* Unified custom navbar styles */
.custom-navbar {
  background: linear-gradient(100deg, rgba(2,46,158,1) 0%, rgba(7,96,222,1) 52%, rgba(25,151,255,1) 100%);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(3, 51, 170, 0.35);
}

.custom-navbar .navbar-brand {
  color: rgba(255,255,255,0.98);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.custom-navbar .navbar-brand:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,255,255,0.25), 0 4px 12px rgba(59,130,246,0.3);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
}

.custom-navbar .navbar-brand:active {
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(255,255,255,0.15);
}

.custom-navbar .navbar-brand img {
  width: 40px;
  height: auto;
  margin-right: 0;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.2)) drop-shadow(0 0 8px rgba(255,255,255,0.15));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.custom-navbar .navbar-brand:hover img {
  filter: drop-shadow(0 4px 12px rgba(59,130,246,0.4)) drop-shadow(0 0 12px rgba(255,255,255,0.25)) brightness(1.1);
  transform: scale(1.05);
}

.custom-navbar .nav-link,
.custom-navbar .navbar-text {
  color: rgba(255,255,255,0.92);
  font-size: 0.95rem;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link:focus {
  color: #ffffff;
  background-color: rgba(255,255,255,0.06);
  border-radius: 6px;
}

.custom-navbar .nav-link.active {
  color: #fff;
  background-color: rgba(255,255,255,0.08);
  border-radius: 6px;
}

.custom-navbar .navbar-toggler {
  border-color: rgba(255,255,255,0.18);
}

.custom-navbar .navbar-toggler-icon {
  filter: invert(1) brightness(1.8) contrast(0.9);
}

/* Dropdown toggles */
.custom-navbar .dropdown-toggle::after {
  border-top-color: rgba(255,255,255,0.85);
}

/* Make custom-dropdown consistent with navbar */
.navbar-nav .custom-dropdown {
  border: none;
  background-color: rgba(9, 110, 235, 0.98);
  min-width: 220px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(6,40,90,0.25);
  padding: 0.25rem 0;
  transform-origin: top center;
  transition: transform 180ms ease, opacity 180ms ease;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 6px;
}

.navbar-nav .custom-dropdown.show {
  opacity: 1;
  transform: translateY(0);
}

.navbar-nav .custom-dropdown .dropdown-item {
  color: #ffffff;
  padding: 0.6rem 1.25rem;
}

.navbar-nav .custom-dropdown .dropdown-item:hover,
.navbar-nav .custom-dropdown .dropdown-item:focus {
  background-color: rgba(255,255,255,0.08);
  color: #fff;
}

/* Enhanced custom dropdown appearance */
.navbar-nav .custom-dropdown {
  border: none;
  background-color: rgba(9, 110, 235, 0.98);
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(9, 40, 90, 0.25);
  padding: 0.25rem 0;
  transform-origin: top center;
  transition: transform 180ms ease, opacity 180ms ease;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 6px;
}

.navbar-nav .custom-dropdown.show {
  opacity: 1;
  transform: translateY(0);
}

.navbar-nav .custom-dropdown .dropdown-item {
  color: #ffffff;
  padding: 0.6rem 1.25rem;
}

.navbar-nav .custom-dropdown .dropdown-item:hover,
.navbar-nav .custom-dropdown .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Highlight active parent toggle */
.navbar-nav .dropdown-toggle.active {
  color: #fff;
  font-weight: 600;
}

.dropdown-item {
  color: #333;
  padding: 0.5rem 1.5rem;
}

.dropdown-item:hover, 
.dropdown-item:focus {
  color: #fff;
  background-color: rgba(9, 110, 235, 0.754);
}

.dropdown-item.active {
  color: #fff;
  background-color: rgba(9, 110, 235, 0.754);
}

/* Mobile styles */
@media (max-width: 991px) {
  .navbar-collapse {
    padding: 1rem 0;
  }

  .custom-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.65);
    background-color: rgba(255, 255, 255, 0.08);
  }

  .custom-navbar .navbar-toggler-icon {
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba%28255,255,255,1%29' stroke-width='2.6' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }
  
  .navbar-nav .dropdown-menu {
    padding: 0;
    margin: 0;
    background-color: transparent;
  }
  
  .dropdown-item {
    padding: 0.5rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
  }
  
  .dropdown-item:hover,
  .dropdown-item:focus,
  .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .nav-item {
    padding: 0.25rem 0;
  }
}

/* Word Navigation Buttons Styling */
.word-navigation-buttons {
  margin: 1.2rem 0;
  padding: 0.8rem 0.6rem;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(9, 110, 235, 0.1);
  border-bottom: 1px solid rgba(9, 110, 235, 0.1);
  background: rgba(9, 110, 235, 0.02);
  border-radius: 6px;
}

.prev-word-btn,
.next-word-btn {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.88) 0%, rgba(30, 144, 255, 0.82) 100%);
  border: 1px solid rgba(9, 110, 235, 0.35);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(9, 110, 235, 0.15);
  letter-spacing: 0.2px;
  cursor: pointer;
  flex: 1;
  max-width: 150px;
  text-align: center;
}

.prev-word-btn:hover,
.next-word-btn:hover {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.75) 0%, rgba(30, 144, 255, 0.68) 100%);
  box-shadow: 0 4px 14px rgba(9, 110, 235, 0.22);
  transform: translateY(-2px);
  border-color: rgba(9, 110, 235, 0.5);
}

.prev-word-btn:active,
.next-word-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(9, 110, 235, 0.15);
}

/* Remove fixed position styles for old buttons */
.leftImage,
.rightImage {
  display: none !important;
}

/* Toggle Buttons Styling (Danh sách từ, Bài học) */
.toggle-buttons-container {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.toggle-btn {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.88) 0%, rgba(30, 144, 255, 0.82) 100%);
  border: 1px solid rgba(9, 110, 235, 0.35);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(9, 110, 235, 0.15);
  letter-spacing: 0.2px;
  cursor: pointer;
  flex: 1;
  text-align: center;
}

.toggle-btn:hover {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.75) 0%, rgba(30, 144, 255, 0.68) 100%);
  box-shadow: 0 4px 14px rgba(9, 110, 235, 0.22);
  transform: translateY(-1px);
  border-color: rgba(9, 110, 235, 0.5);
}

.toggle-btn.active {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.95) 0%, rgba(30, 144, 255, 0.88) 100%);
  border-color: rgba(9, 110, 235, 0.6);
  box-shadow: 0 3px 10px rgba(9, 110, 235, 0.25);
}

.toggle-btn.inactive {
  opacity: 0.85;
}

/* Hint Button Styling (Xem gợi ý cách nhớ) */
.hint-btn {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.88) 0%, rgba(30, 144, 255, 0.82) 100%);
  border: 1px solid rgba(9, 110, 235, 0.35);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(9, 110, 235, 0.15);
  letter-spacing: 0.2px;
  cursor: pointer;
}
.hint-btn:hover {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.75) 0%, rgba(30, 144, 255, 0.68) 100%);
  box-shadow: 0 4px 14px rgba(9, 110, 235, 0.22);
  transform: translateY(-2px);
  border-color: rgba(9, 110, 235, 0.5);
}

.hint-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(9, 110, 235, 0.15);
}

/* Submit button active state (enabled) */
.btn-gradient {
  background: linear-gradient(135deg, rgba(9, 110, 235, 0.95) 0%, rgba(30, 144, 255, 0.88) 100%);
  border: 1px solid rgba(9, 110, 235, 0.55);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(9, 110, 235, 0.24);
}

.btn-gradient:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(9, 110, 235, 1) 0%, rgba(30, 144, 255, 0.95) 100%);
  border-color: rgba(9, 110, 235, 0.7);
  color: #ffffff;
}

/* Disabled button state */
.btn-primary:disabled,
.btn-gradient:disabled,
.btn-disabled {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.5) 0%, rgba(107, 114, 128, 0.5) 100%) !important;
  border-color: rgba(156, 163, 175, 0.3) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.6;
}

.btn-primary:disabled:hover,
.btn-gradient:disabled:hover,
.btn-disabled:hover {
  transform: none !important;
}

/* Comment table styling - compact and minimal */
#table_comment tbody tr {
  vertical-align: top;
}

#table_comment tbody td {
  padding: 0.35rem 0.5rem !important;
  vertical-align: top;
}

.comment-content {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
  color: rgba(15, 23, 42, 0.92);
  word-break: break-word;
  margin-bottom: 0.4rem;
}

.comment-author {
  font-size: 0.5rem !important;
  color: rgba(107, 114, 128, 0.8) !important;
  display: block;
  text-align: right;
  margin-top: 0.25rem;
}
