/* ====== HEADER ====== */
#main_nav {
  background-color: var(--bg-light);
}

/* --- Logo --- */
#main_nav .logo .img {
  max-height: 45px;
  object-fit: contain;
}

/* --- Toggle (mobile) --- */
#main_nav .navbar-toggler {
  border: none;
  padding: 0;
}
#main_nav .navbar-toggler > i {
  color: #ffffff;
  font-size: 32px;
}

/* --- Menu chính --- */
/* ===== MENU CHÍNH ===== */
#main_menu {
  display: flex;
  gap: 12px;
  padding-left: 32px;
}

/* Liên kết menu */
#main_menu > li > .nav-link {
  color: #fff;
  font-weight: bold;
  transition: color 0.2s;
}

#main_menu > li:hover > .nav-link {
  color: var(--text-secondary);
}

/* ===== DROPDOWN CHUNG ===== */
#main_menu > li.nav-item.dropdown {
  position: relative;
}

#main_menu > li.nav-item.dropdown > .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: none; /* 🔹 Ẩn mặc định */
  background-color: rgb(64 64 64 / 1);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  min-width: 220px;
  z-index: 1050;
}

/* Khi hover menu cha -> hiện dropdown */
#main_menu > li.nav-item.dropdown:hover > .dropdown-menu {
  display: grid; /* 🔹 Hiện và chuyển sang grid */
}

/* PC – chia 4 cột tự động */
@media (min-width: 992px) {
  #main_menu > li.nav-item.dropdown > .dropdown-menu {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 6px 16px;
    width: 640px; /* tùy chỉnh, có thể để 720px nếu muốn rộng hơn */
  }
}

/* Mục con trong dropdown */
#main_menu .dropdown-menu .dropdown-item {
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s;
  white-space: nowrap;
}
#main_menu .dropdown-menu .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Nếu có <hr> trong menu – cho chiếm toàn cột */
#main_menu .dropdown-menu hr.dropdown-divider {
  grid-column: 1 / -1;
  border-color: rgba(255, 255, 255, 0.2);
  margin: 8px 0;
}

/* Mobile – về dạng 1 cột */
@media (max-width: 991px) {
  #main_menu > li.nav-item.dropdown > .dropdown-menu {
    position: static;
    transform: none;
    display: block;
    grid-template-columns: 1fr;
    width: 100%;
    box-shadow: none;
    background-color: transparent;
    padding: 0;
  }

  #main_menu .dropdown-menu .dropdown-item {
    color: var(--text-primary);
    padding-left: 20px;
  }
}

/* --- Tìm kiếm --- */
#main_nav #main_search {
  display: flex;
  background-color: #ffffff;
  padding: 2px;
  border-radius: 6px;
  position: relative;
}

#main_search .search-input {
  border: none;
  flex: 1;
}

#main_search .search-button {
  border: none;
  background-color: var(--bg-light);
  color: #ffffff;
}

#main_search .search-results {
  top: 100%;
  left: 0;
  display: none;
  position: absolute;
  width: 100%;
  z-index: 999;
}

/* --- Nút đăng nhập --- */
#main_nav .btn-login {
  border-color: #ffffff;
  color: var(--text-primary);
  background-color: #ffffff;
  width: 120px;
  text-align: left;
  overflow: hidden;
}
#main_nav .btn-login:hover {
  color: var(--text-secondary);
}

/* --- Toggle Dark/Light --- */
#main_nav #theme-toggle {
  color: #ffffff;
}
#theme-toggle {
  border: none;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s;
}
#theme-toggle:hover {
  transform: scale(1.1);
}

/* ====== END HEADER ====== */

/* ====== HOME SLIDER ====== */
.home_slider{
  background-color: var(--bg-light);
  padding-top: 24px;
}
.swiper_home_slider {
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
}
.slider_item {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem;
}
.slider_item_left {
  z-index: 2;
  position: relative;
  flex: 1;
  max-width: 55%;
}
.slider_item_chapter {
  font-weight: 700;
  text-transform: uppercase;
  color: #ffe066;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}
.slider_item_story {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #fff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.slider_item_des {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  opacity: 0.9;
  max-height: 120px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  margin-bottom: 1rem;
  transition: all 0.4s ease;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* Giới hạn 3 dòng */
  overflow: hidden;
  min-height: calc(1.6em * 3); /* đảm bảo chiều cao tối thiểu bằng 3 dòng */
}
.slider_item:hover .slider_item_des {}
.slider_item_genre {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.slider_item_genre li {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.slider_item_genre li:hover {
  background: linear-gradient(90deg, #0d6efd, #6610f2);
}
.slider_item_action {
  display: flex;
  gap: 1rem;
}
.slider_item_action a {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.slider_item_action a:first-child {
  background: linear-gradient(90deg, #ffb300, #ff6f00);
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 179, 0, 0.4);
}
.slider_item_action a:first-child:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}
.slider_item_action a:last-child {
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.slider_item_action a:last-child:hover {
  background: #fff;
  color: #000;
}
.slider_item_right {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  perspective: 1000px;
}
.slider_item_right img {
  width: 240px;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  transform: rotateY(-10deg) rotateX(3deg);
  transition: all 0.6s ease;
  filter: brightness(0.95);
}
.slider_item_right::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.3) 0%, transparent 100%);
  transform: skewX(-25deg);
  transition: left 0.8s ease;
}
.slider_item:hover .slider_item_right img {
  transform: rotateY(0deg) rotateX(0deg) scale(1.05);
  filter: brightness(1.05);
}
.slider_item:hover .slider_item_right::after {
  left: 120%;
}
.slider_item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-slider) center/cover no-repeat;
  filter: blur(25px) brightness(0.5);
  transform: scale(1.2);
  z-index: 1;
}
.slider_item > * {
  position: relative;
  z-index: 2;
}

.swiper_home_slider .swiper-wrapper {
  transition-timing-function: ease-in-out;
}
.swiper_home_slider .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.7;
}
.swiper_home_slider .swiper-pagination-bullet-active {
  background: #7b2ff7;
}
/* ====== END HOME SLIDER ====== */

/* ====== HOME INFO ====== */
.home_info{
  background-color: var(--bg-light);
  padding: 24px 0 24px 0;
  color: #ffffff;
}
.home_info .content{
  font-size: 14px;
  line-height: unset;
}
.home_info .share{
  display: flex;
  gap: 12px;
}
.home_info .share .img{
  width: 68px;
  border-radius: 50%;
}
.home_info .share .des{
  margin: 0;
  padding: 0;
}
/* ====== END HOME INFO ====== */

/* ====== HOME TRENDING ====== */
.home_trending{
  background-color: var(--bg-light-primary);
  padding: 12px 0 48px 0;
}
.home_trending .section_title{
  color: #ffffff;
  padding-bottom: 12px;
}
.trending_card {
  display: flex;
  align-items: stretch;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s ease;
  max-width: 420px;
  position: relative;
}
.trending_card:hover {
  transform: translateY(-6px);
}
.trending_side {
  background-image: linear-gradient(to top, #7b2ff7, #f107a3);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: end;
  padding: 0.5rem 0.5rem;
  min-width: 32px;
  text-align: center;
  position: relative;
  gap: 12px;
}
.trending_side .rank {
  font-weight: 800;
  font-size: 1.4rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: normal;
}
.trending_side .vertical_text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  line-height: 1.2;
  max-height: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trending_thumb {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.trending_thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}
.trending_card:hover .trending_thumb img {
  transform: scale(1.1);
  filter: brightness(0.6);
}
.trending_info {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.2rem;
  text-align: center;
}
.trending_card:hover .trending_info {
  opacity: 1;
  visibility: visible;
}
.trending_info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending_info p {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #ddd;
}
.trending_info i {
  color: #ffca28;
  margin-right: 4px;
}
.trending_info .buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.trending_info .buttons .btn {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.trending_info .btn_read {
  background: #ffca28;
  color: #000;
  box-shadow: 0 2px 6px rgba(255, 179, 0, 0.4);
}
.trending_info .btn_read:hover {
  background: #ffd740;
}
.trending_info .btn_info {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.trending_info .btn_info:hover {
  background: #fff;
  color: #000;
}
/* ====== END HOME TRENDING ====== */

/* ====== HOME MAIN ====== */
.home_main{
  background: #f8f9fa;
}
.home_main_content {
  display: flex;
  gap: 2rem;
}
.main_left {
  flex: 1 1 65%;
}
.main_right {
  flex: 1 1 30%;
}
.section_home_stories{}
.section_home_stories .section_title{
  color: var(--text-primary);
  margin: 0;
  padding-bottom: 12px;
}
.section_home_stories .ls_story {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 24px;
}
.section_home_stories .story_item {
  /*flex: 0 0 calc(50% - 0.5rem);
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;*/
  flex: 0 0 calc(50% - 0.5rem);
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.section_home_stories .story_item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(123,47,247,0.15), rgba(255,202,40,0.15));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}
.section_home_stories .story_item:hover::before {
  opacity: 1;
}
.section_home_stories .story_item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
/*.section_home_stories .story_item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}*/
/*.section_home_stories .story_item:hover .title a{
  color: var(--text-hover) !important;
}*/
.section_home_stories .story_item .thumb {
  display: block !important; /* ép block để aspect-ratio hoạt động */
  aspect-ratio: 7 / 10;
  width: 140px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #222;
}
.section_home_stories .story_item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}
.section_home_stories .story_item:hover .thumb img {
  transform: scale(1.1);
  filter: brightness(0.9);
}
.section_home_stories .story_item .info{
  flex-flow: column;
  justify-content: space-between;
}
.section_home_stories .story_item .title a {
  color: #333;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color 0.3s ease;
}
.section_home_stories .story_item:hover .title a {
  color: var(--text-hover);
}
.section_home_stories .story_item .genre {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  font-size: 14px;
  line-height: 20px;

  max-height: 46px;  /* 🔥 giới hạn đúng 2 dòng */
  overflow: hidden;  /* ẩn phần dư */
  color: rgb(82 82 82/1);
}
.section_home_stories .story_item .chapter {
  color: #7b2ff7;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  flex-flow: column;
  gap: 6px;
}
.section_home_stories .story_item .chapter a{
  transition: color 0.3s ease, transform 0.3s ease;
  color: var(--text-primary);
}
/*.section_home_stories .story_item:hover .chapter a {
  color: var(--text-secondary);
  transform: translateX(4px);
}*/
.section_home_stories .story_item .chapter a:hover{
  color: var(--text-hover);
}
.section_home_stories .story_item .chapter a > i{
  padding-right: 6px;
}
/* ====== END HOME MAIN ====== */

/* ====== STORY/STORY ====== */
.section_story{}
.story_main{
  padding: 32px 0;
  background-color: rgb(69 17 132 / 1);
}
.story_main .left{
  gap: 24px;
  flex: 1 1 75%;
  padding-right: 32px;
}
.story_main .left .img{
  width: 176px;
  height: fit-content;
  border-radius: 12px;
  border: 4px solid #ffffff;
}
.story_main .left .info{
  color: #ffffff;
}
.story_main .left .info .title{
  text-transform: capitalize;
  font-size: 26px;
  padding-bottom: 12px;
  margin: 0;
  line-height: unset;
}
.story_main .left .info .group_action{
  margin-bottom: 24px;
  gap: 12px;
}
.story_main .left .info .group_action .btn{
  padding: 6px 16px;
  border-radius: 8px;
}
.story_main .left .info .group_action .read{
  background-color: rgb(255 215 2 / 1);
}
.story_main .left .info .group_action .follow{
  background-color: #ffffff;
}
.story_main .left .info .group_action .follow:hover{
  color: var(--text-hover);
}
.story_main .left .info .genres{
  gap: 12px;
  font-size: 15px;
  margin-bottom: 12px;
}
.story_main .left .info .genres > li{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;
  background-color: rgb(95 37 166 / 1);
  border-radius: 6px;
}
.story_main .left .info .des{
  font-size: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.story_main .right{
  flex: 1 1 25%;
}
.story_main .right .published{
  color: #ffffff;
  font-size: 14px;
  display: flex;
  gap: 4px;
  flex-flow: column;
}
.story_main .right .published > li{

}
.story_main .right .rate{
  border-radius: 12px;
  border-left: 1px solid #ffffff;
  padding-left: 24px;
  color: #ffffff;
  margin-top: 24px;
}
.story_main .right .rate .title{
  display: flex;
  gap: 6px;
  align-items: end;
}
.story_main .right .rate .title i{
  color: rgb(255 215 2 / 1);
}
.story_main .right .rate .title .sum{
  font-weight: 700;
}
.story_main .right .rate .title .count{
  font-size: 12px;
}
.story_main .right .rate .des{
  font-size: 14px;
}
.story_main .right .rate .group_rate{
  display: flex;
  gap: 12px;
  justify-content: space-between; /* hoặc center */
}
.story_main .right .rate .group_rate .rate_item{
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: bold;
  flex-flow: column;
  color: #000000;
  padding: 8px 0;
}
.story_main .right .rate .group_rate .rate_item p{
  padding: 0;
  margin: 0;
  font-size: 13px;
}
.story_body{
  padding: 24px 0;
  background: #f8f9fa;
}
.story_body .container{
  gap: 32px;
}
.story_body .left{
  display: flex;
  gap: 24px;
  flex: 1 1 70%;
}
.story_chapter{
  width: 100%;
}
.story_chapter .section_title{
  color: var(--text-primary);
  font-weight: bold;
  font-size: 22px;
}
.story_chapter .chapter_search{
  display: flex;
  gap: 6px;
  background-color: rgb(245 245 245 / 1);
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
}
.story_chapter .chapter_search input{
  padding: 4px 12px;
  width: 168px;
}
.story_chapter .chapter_search button{
  width:40px;
  height: 40px;
}
.story_chapter .ls_chapter{
  font-size: 15px;
  display: flex;
  flex-flow: column;
  gap: 3px;
  max-height: 660px;
  overflow-y: auto;
  padding-right: 10px;
}
.story_chapter .ls_chapter::-webkit-scrollbar {
  width: 8px;
}

.story_chapter .ls_chapter::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.story_chapter .ls_chapter::-webkit-scrollbar-thumb:hover {
  background: #999;
}
.story_chapter .ls_chapter > li{
  width: 100%;
}
.story_chapter .ls_chapter > li > a{
  background-color: rgb(245 245 245/1);
  width: 100%;
  padding: 12px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.story_chapter .ls_chapter > li > a > span:first-child{
  display: flex;
  gap: 8px;
}
.story_chapter .ls_chapter > li > a > .btn{
  background-color: #ffffff;
  font-size: 13px;
  display: flex;
  gap: 6px;
}
.story_chapter .ls_chapter > li > a:hover{
  color: var(--text-primary);
  background-color: #ffffff;
  border-left: 2px solid var(--text-primary);
}
.story_chapter .ls_chapter > li > a:hover .btn{
  background-color: var(--bg-light);
  color: #ffffff;
}
.sidebar {
  flex: 1 1 30%;
  display: flex;
  flex-flow: column;
  gap: 24px;
}

.sidebar .section_story .title {
  color: var(--text-primary);
  font-weight: bold;
  font-size: 22px;
  padding-bottom: 12px;
}

.story_genre .ls_genre {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  position: relative;
}

.story_genre .ls_genre.expanded {
  max-height: 1000px; /* Mở rộng */
}

.story_genre .ls_genre .genre_item {
  list-style: none;
  margin-bottom: 5px;
}

.story_genre .ls_genre .genre_item a {
  background-color: rgb(238 238 238 / 1);
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
}

.story_genre .ls_genre .genre_item a:hover {
  background-color: var(--bg-light);
  color: #ffffff;
}

.li_toggle {
  text-align: center;
  width: 100%;
}

.btn_toggle_genre {
  background: #f1f1f1;
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn_toggle_genre:hover {
  background: #e2e2e2;
}
.story_like{
  background-color: #ffffff;
  padding: 12px;
  border-radius: 8px;
}
.story_like .ls_stories{
  display: flex;
  flex-flow: column;
  gap: 12px;
}
.story_like .ls_stories > li{
  
}
.story_like .ls_stories > li > a{
  display: flex;
  gap: 12px;
  align-items: start;
  transition: transform 0.3s;
}
.story_like .ls_stories > li:hover{
  background: rgba(123, 47, 247, 0.05);
  transform: scale(1.03);
}
.story_like .ls_stories > li:hover a{
  color: var(--text-primary);
}
.story_like .ls_stories > li:hover{

}
.story_like .ls_stories > li .img{
  width: 66px;
}
.story_like .ls_stories > li .info{
  display: flex;
  flex-flow: column;
  gap: 4px;
  padding: 6px 6px 6px 0px;
}
.story_like .ls_stories > li .info .name{
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color 0.3s ease;
}
.story_like .ls_stories > li .info .genre{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
.story_like .ls_stories > li .info .more{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.story_like .ls_stories > li .info .more .chapter{}
.story_like .ls_stories > li .info .more .view{}
/* ====== END STORY/STORY ====== */

/* ====== CHAPTER ====== */
.section_chapter{}
.pages_chepter{
  display: flex;
  flex-flow: column;
}
.pages_chepter .page_item{
  display: flex;
  justify-content: center;
}
.pages_chepter .page_item img{
  width: 100%;
  max-width: 880px;
  height: auto;
}
/* ====== END CHAPTER ====== */

/* ====== SIDEBAR ====== */
.section_sidebar{
  border-radius: 10px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  background-color: #ffffff;
}
.section_sidebar .section_title{
  color: var(--text-primary);
  margin: 0;
  padding-bottom: 12px;
}
.section_story_top .nav-tabs{
  border-color: var(--text-primary);
}
.section_story_top .nav-link{
  color: var(--text-primary);
}
.section_story_top .nav-link.active{
  color: #ffffff;
  background-color: var(--bg-light);
  border-color: var(--text-primary);
}
.section_story_top .top_item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  position: relative;
  margin-bottom: 12px;
  transition: transform 0.3s;
}
.section_story_top .top_item:hover{
  background: rgba(123, 47, 247, 0.05);
  transform: scale(1.03);
}
.section_story_top .top_item:hover a{
  color: var(--text-hover);
}
.section_story_top .top_item .left {
  width: 78px;
  flex-shrink: 0;
}
.section_story_top .top_item .left img{
  width: 100%;
  height: auto;
  object-fit: contain;
}
.section_story_top .top_item .right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-flow: column;
  justify-content: space-between;
  padding: 8px 0;
}
.section_story_top .top_item .right .info{
  display: flex;
  flex-flow: column;
  gap: 6px;
}
.section_story_top .top_item .right .info .name{
  font-size: 15px;
  padding-right: 40px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.6em * 2);
}
.section_story_top .top_item .right .info .chapter{
  font-size: 13px;
  color: var(--text-primary);
}
.section_story_top .top_item .right .rank {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(45deg, #ff9800, #ffc107, #ff5722);
  background-size: 200%;
  border-radius: 8px;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.section_story_top .top_item .right .view{
  font-size: 13px;
  padding-top: 6px;
}
.section_top_member .ls_member {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section_top_member .member_item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-radius: 12px;
  background: #f8f9fa;
  color: #000;
  transition: transform 0.3s;
  font-size: 14px;
  color: var(--text-primary);
}
.section_top_member .member_item:hover {
  transform: scale(1.03);
}
.section_top_member .rank {
  font-weight: bold;
  font-size: 22px;
  width: 25px;
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-hover) !important;
  background: linear-gradient(90deg, gold, orange, red);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: moveGradient 2s linear infinite;
}
@keyframes moveGradient {
  to { background-position: 200% center; }
}
.section_top_member .img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.section_top_member .info .name {
  display: block;
  font-weight: bold;
}
/* ============ TOP 1 ============ */
.section_top_member .rank_1 {
  position: relative;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  color: #000;
  animation: glowGold 1.5s infinite alternate;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  font-size: 16px;
  border-radius: 12px;
  padding: 10px 15px;
  overflow: hidden;
}

/* Border chạy quanh */
.section_top_member .rank_1::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #fff3b0, #ffb300, #ff8000, #fff3b0);
  animation: rotateBorderGold 2s linear infinite;
  z-index: 0;
}
.section_top_member .rank_1::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  border-radius: inherit;
  z-index: 1;
}
.section_top_member .rank_1 * {
  z-index: 2;
}

/* ============ TOP 2 ============ */
.section_top_member .rank_2 {
  position: relative;
  background: linear-gradient(135deg, #d3d3d3, #a9a9a9);
  color: #fff;
  font-size: 15px;
  border-radius: 12px;
  padding: 10px 15px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(192, 192, 192, 0.7);
}

.section_top_member .rank_2::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #f0f0f0, #bfbfbf, #808080, #f0f0f0);
  animation: rotateBorderSilver 2.5s linear infinite;
  z-index: 0;
}
.section_top_member .rank_2::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(135deg, #d3d3d3, #a9a9a9);
  border-radius: inherit;
  z-index: 1;
}
.section_top_member .rank_2 * {
  z-index: 2;
}

/* ============ TOP 3 ============ */
.section_top_member .rank_3 {
  position: relative;
  background: linear-gradient(135deg, #cd7f32, #a65e2e);
  color: #fff;
  font-size: 15px;
  border-radius: 12px;
  padding: 10px 15px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.7);
}

.section_top_member .rank_3::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #ffd7a0, #cd7f32, #8b4513, #ffd7a0);
  animation: rotateBorderBronze 2.5s linear infinite;
  z-index: 0;
}
.section_top_member .rank_3::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(135deg, #cd7f32, #a65e2e);
  border-radius: inherit;
  z-index: 1;
}
.section_top_member .rank_3 * {
  z-index: 2;
}

/* ============ KEYFRAMES ============ */
@keyframes rotateBorderGold {
  to { transform: rotate(360deg); }
}
@keyframes rotateBorderSilver {
  to { transform: rotate(360deg); }
}
@keyframes rotateBorderBronze {
  to { transform: rotate(360deg); }
}

@keyframes glowGold {
  from { box-shadow: 0 0 10px rgba(255,215,0,.6); }
  to { box-shadow: 0 0 25px rgba(255,165,0,.9); }
}

/* ✨ Animation phát sáng cho top 1 */
@keyframes glowGold {
  0% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6),
                0 0 30px rgba(255, 165, 0, 0.4);
  }
  100% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 1),
                0 0 60px rgba(255, 165, 0, 0.9);
  }
}
/* ====== END SIDEBAR ====== */

/* ====== FOOTER ====== */
footer{
  background-color: var(--bg-light);
}
.footer_content{
  display: flex;
  gap: 1.5 rem;
}
.footer_content p{
  padding: 0;
  margin: 0;
}
.footer_content_left{
  flex: 1 1 60%;
  display: flex;
  gap: 24px;
  flex-flow: column;
  text-align: left;
}
.footer_content_right{
  flex: 1 1 40%;
}
.footer_content_left .img{
  width: 168px;
}
.footer_content_left .about,
.footer_content_left .ads,
.footer_content_left .noted{
  padding-right: 24px;
  color: #ffffff;
}
.footer_content_left .ads .title,
.footer_content_left .noted .title{
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 6px;
}
.footer_content_left .about > ul{
  display: flex;
  gap: 12px;
}
.footer_content_left .about > ul > li{}
.footer_content_left .about > ul > li > a{}
.footer_content_left .noted .des{
  padding-bottom: 12px;
}
.footer_content_right .menu_link{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.footer_content_right .menu_link > li{}
.footer_content_right .menu_link > li > a{
  font-size: 12px;
  border: 1px solid var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}
.copy_right{
  color: #ffffff;
  margin: 12px 0 0 0;
  padding: 0;
  font-size: 12px;
}
/* ====== END FOOTER ====== */

/* ====== PAGINATION ====== */
.pagination{}
.pagination .page-item{}
.pagination .page-item .disabled{}
.pagination .page-item .active{}
.pagination .page-item a{
  color: var(--text-primary);
}
.active>.page-link, .page-link.active {
  z-index: 3;
  color: #ffffff !important;
  background-color: var(--bg-light-primary);
  border-color: var(--bg-light-primary);
}
/* ====== END PAGINATION ====== */

/* ====== MODAL ====== */
.modal-title{
  color: var(--text-primary);
}
.form-label{
  color: #000;
}
.modal-body{}
.modal-body button{
  background-color: var(--bg-light);
  color: #ffffff;
  border: none;
}
.modal-footer{
  color: #000;
}
.modal-footer a{
  color: var(--text-primary);
}
/* ====== END MODAL ====== */

.section_member_collection {
    padding: 20px 0;
}

.section_member_collection .section_title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.section_member_collection table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section_member_collection thead {
    background: #f5f6f7;
}

.section_member_collection thead th {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e5e5;
}

.section_member_collection tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.section_member_collection tbody tr:hover {
    background: #fafafa;
}

.section_member_collection tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 15px;
    color: #333;
}

/* Ảnh truyện */
.section_member_collection tbody td img {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Tên truyện */
.section_member_collection tbody td p {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    color: #222;
}

/* Chap mới nhất */
.section_member_collection td p {
    margin-bottom: 4px;
}
.section_member_collection a{
  color: var(--text-primary);
}
.section_member_collection td span {
    font-size: 13px;
    color: #777;
}
.btn_unfollow {
    padding: 6px 12px;
    background: #ffebeb;
    color: #d9534f;
    border: 1px solid #f5b5b5;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.btn_unfollow i {
    margin-right: 4px;
}

.btn_unfollow:hover {
    background: #ffcccc;
    border-color: #d9534f;
    color: #b52b27;
}
/* Responsive */
/* --- MOBILE STYLE --- */
@media (max-width: 768px) {

    /* Ẩn bảng và chuyển sang dạng block-list */
    .section_member_collection table {
        display: block;
        border: none;
        box-shadow: none;
    }

    .section_member_collection thead {
        display: none;
    }

    .section_member_collection tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .section_member_collection tbody tr {
        display: flex;
        flex-direction: row;
        gap: 12px;
        padding: 12px;
        background: #ffffff;
        border-radius: 10px;
        border: 1px solid #eee;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }

    /* Ảnh */
    .section_member_collection tbody td img {
        width: 70px;
        height: 95px;
        border-radius: 6px;
        object-fit: cover;
    }

    /* Nội dung */
    .section_member_collection tbody td {
        padding: 0;
        border: none;
    }

    /* Bố cục 2 cột: ảnh + thông tin */
    .section_member_collection tbody td:first-child {
        flex-shrink: 0;
    }

    .section_member_collection tbody td:nth-child(2),
    .section_member_collection tbody td:nth-child(3) {
        flex: 1;
    }

    /* Tên truyện */
    .section_member_collection tbody td p {
        font-size: 15px;
        font-weight: 600;
        margin: 0;
        color: #222;
    }

    /* Chap + ngày */
    .section_member_collection tbody td span {
        display: block;
        margin-top: 3px;
        font-size: 13px;
        color: #777;
    }

    /* Nút bỏ theo dõi */
    .btn_unfollow {
        margin-left: auto;
        height: fit-content;
        padding: 5px 10px;
        font-size: 13px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .btn_unfollow i {
        font-size: 15px;
    }
    .section_member_collection tbody td p.story_title {
        max-width: 180px;   /* ✨ chỉnh tùy ý */
        word-wrap: break-word;
        white-space: normal;
        line-height: 1.3;
    }
}


.search-box {
  position: relative;
}
.search-results {
  max-height: 350px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f1f1;
  transition: background 0.2s;
  cursor: pointer;
}
.search-result-item:hover {
  background: #f8f9fa;
}
.search-result-item img {
  width: 45px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
}
.search-result-item h6 {
  font-size: 0.9rem;
  margin: 0;
  font-weight: 600;
}
.search-result-item p {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
}
/* ===========================
    PROFILE SECTION
=========================== */

.section_member_info {
    padding: 40px 0;
    background: #f7f9fc;
    font-family: 'Inter', sans-serif;
}

/* CARD AVATAR */
.card_avatar {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    text-align: center;
    transition: .3s ease;
}

.card_avatar:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card_avatar img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    transition: .3s;
}

.card_avatar img:hover {
    transform: scale(1.08);
}

/* Input fullname */
.card_avatar input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #dcdfe6;
    font-size: 15px;
    outline: none;
    transition: .25s;
}

.card_avatar input:focus {
    border-color: #4a7dff;
    box-shadow: 0 0 0 3px rgba(74,125,255,0.18);
}

/* Save button */
.card_avatar button {
    margin-top: 12px;
    width: 100%;
    border: none;
    background: #4a7dff;
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: .25s;
}

.card_avatar button:hover {
    background: #3468f7;
    transform: translateY(-1px);
}

.card_avatar button:active {
    transform: scale(0.97);
}

/* ============================
    CARD PASSWORD
============================= */

.card_password {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: .3s ease;
}

.card_password:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card_password label {
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    display: block;
}

.card_password input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #dcdfe6;
    outline: none;
    margin-bottom: 15px;
    font-size: 15px;
    transition: .25s;
}

.card_password input:focus {
    border-color: #ff7d3b;
    box-shadow: 0 0 0 3px rgba(255,125,59,0.18);
}

/* Submit password */
#btn_password {
    width: 100%;
    background: #ff7d3b;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .25s;
}

#btn_password:hover {
    background: #ff6412;
    transform: translateY(-1px);
}

#btn_password:active {
    transform: scale(0.97);
}