@font-face {
  font-family: 'Roboto';
  src: url('/assets/webfonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Merriweather';
  src: url('/assets/webfonts/Merriweather_24pt-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes firework {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0.5);
        opacity: 0;
    }
}

.firework-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: hsl(calc(360 * var(--i)), 100%, 60%);
    border-radius: 50%;
    animation: firework 0.8s ease-out forwards;
    --x: calc(100px * cos(var(--angle)));
    --y: calc(100px * sin(var(--angle)));
}

.firework-particle:nth-child(1) { --angle: 0rad;    --i: 0.1; }
.firework-particle:nth-child(2) { --angle: 0.6rad;  --i: 0.2; }
.firework-particle:nth-child(3) { --angle: 1.2rad;  --i: 0.3; }
.firework-particle:nth-child(4) { --angle: 1.8rad;  --i: 0.4; }
.firework-particle:nth-child(5) { --angle: 2.4rad;  --i: 0.5; }
.firework-particle:nth-child(6) { --angle: 3.0rad;  --i: 0.6; }
.firework-particle:nth-child(7) { --angle: 3.6rad;  --i: 0.7; }
.firework-particle:nth-child(8) { --angle: 4.2rad;  --i: 0.8; }
.firework-particle:nth-child(9) { --angle: 4.8rad;  --i: 0.9; }
.firework-particle:nth-child(10){ --angle: 5.4rad;  --i: 1.0; }


.vip-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: gold;
    color: #000;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.vip-link:hover {
    background-color: #ffd700;
    color: #111;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#startSpeechReader1 {
    border: none;
    border-radius: 12px;
    padding: 2px 4px;
    background: #d35400;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
}

.btn {
    display: inline-block;
    margin: 10px;
    padding: 10px 18px;
    background-color: #007BFF;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    user-select: none;
    transition: background-color 0.3s;
}

.btn:hover:not(.disabled) {
    background-color: #0056b3;
}

.btn.disabled, 
.btn[aria-disabled="true"] {
    background-color: #cccccc;
    pointer-events: none;
    cursor: default;
    color: #666666;
}

.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    z-index: 1001;
}

.search-container {
display: flex;
gap: 10px; 
}

#chapterPositionInput {
flex: 1; 
width: 100%;
height: 24px;
}

a.title:visited {
color: #007BFF; /* Màu không thay đổi khi đã được click vào */
}

h1  {
text-align: center; /* Căn giữa chữ */
font-size: 20px;
}

h2  {
text-align: center; /* Căn giữa chữ */
font-size: 16px;
}

.content * {
font-size: inherit !important; /* Hoặc inherit nếu muốn kế thừa từ phần tử cha */
}

.content {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #FDF6E3;
    color: #3C3C3C;
    position: relative;
    font-size: 18px;
    font-family: 'Times New Roman', Times, serif;
    margin-left: 50px;
    margin-right: 50px;
    border-radius: 5px;
}

.content1 {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #FDF6E3;
    color: #3C3C3C;
    position: relative;
    font-size: 18px;
    font-family: 'Times New Roman', Times, serif;
    margin-left: 50px;
    margin-right: 50px;
    border-radius: 5px;
    text-align: center;
}

.text-form {
font-size:20px !important;
}
.btn-buy {
padding: 10px 10px;
font-size: 16px;
font-weight: bold;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.2s ease-in-out;
display: inline-block;
min-width: 150px;
}

.btn-chapter {
background-color: #ff9800;
color: white;
}

.btn-chapter:hover {
background-color: #f57c00;
}

.btn-story {
background-color: #2196f3;
color: white;
}

.btn-story:hover {
background-color: #1976d2;
}

form {
display: block;
}

.button-container {
display: flex;
justify-content: center; /* Căn giữa */
align-items: center; /* Căn giữa theo chiều dọc */
margin: 0px 0px; /* Khoảng cách trên và dưới */
}

button {
margin: 5px;
padding: 5px 10px; /* Giảm kích thước nút */
}

#settingsPanel {
    display: none; /* Ẩn bảng điều khiển ban đầu */
    position: fixed; /* Đặt bảng điều khiển ở vị trí cố định */
    top: 20px; /* Khoảng cách từ đầu trang */
    right: 20px;
    left:20px;
    border: 1px solid #ddd;
    background-color: white;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 1001; /* Đảm bảo bảng điều khiển nằm trên tất cả các phần tử khác */
}

#settingsPanel.visible {
    display: block;  /* Hiển thị khi có class 'visible' */
}

.gear-icon {
font-size: 20px; /* Kích thước biểu tượng bánh răng */
cursor: pointer;
}

.content p {
text-align:left;
}
button.toggle-button{
border:none;
font-size:30px;
cursor: pointer;
}

.icon-bar {
    display: flex; /* Sử dụng flexbox để căn chỉnh các biểu tượng */
    justify-content: space-around; /* Căn giữa các biểu tượng */
    align-items: center; /* Căn giữa theo chiều dọc */
    font-size: 24px; /* Kích thước biểu tượng */
    width: 100%; /* Độ rộng đầy đủ */
    padding: 0px; /* Khoảng cách bên trong */
    background-color: #f1f1f1; /* Màu nền cho icon bar */
    border-top: 1px solid #ccc; /* Đường viền trên cùng */
    position: fixed; /* Giữ icon bar cố định */
    bottom: 0; /* Nằm ở đáy màn hình */
    transition: transform 0.3s ease; /* Hiệu ứng chuyển động mượt mà */
    transform: translateY(0); /* Hiển thị khi có class visible */
    z-index: 999; /* Đảm bảo nằm trên các phần tử khác */
}

.icon-bar.hidden {
    transform: translateY(100%);
}

.icon-bar i {
cursor: pointer; /* Hiện con trỏ khi di chuột qua biểu tượng */
transition: color 0.3s; /* Hiệu ứng chuyển màu */
}

.icon-bar i:hover {
color: #007bff; /* Màu khi di chuột qua */
}

/* CSS cho sidebar */
.sidebar {
    position: fixed;
    left: -30%; /* Ẩn ra ngoài */
    top: 0;
    width: 25%;
    height: 100%;
    background: #f1f1f1;
    transition: left 0.3s ease;
    z-index: 1002;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.sidebar.active {
left: 0; /* Hiện sidebar */
}

.chapter-list {
list-style-type: none;
padding: 0;
margin-bottom: 15px;
margin-left: -15px;
}

.chapter-list li {
    margin: -2px 0;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.chapter-list li a {
display: block;
width: 100%;  /* Chiều rộng đầy đủ */
overflow: hidden;  /* Ẩn phần tràn */
text-overflow: ellipsis;  /* Thêm dấu ba chấm */
color: #007bff;  /* Màu chữ tùy chọn */
text-decoration: none;  /* Loại bỏ gạch chân */
padding: 8px;
border-radius: 4px;
transition: background-color 0.3s ease;
}

.chapter-list li a:hover {
text-decoration: underline;
background-color: #f0f0f0;
}

.pagination {
    margin-top: -5px;
    padding-bottom: 40px;
}

.pagination button {
margin: 0 5px;
padding: 10px;
}

.highlighted-chapter {
background-color: #FFD700; /* Màu nền vàng, bạn có thể thay đổi theo ý thích */
color: #000; /* Màu chữ */
}

.highlighted-page {
background-color: #007BFF; /* Màu nền nổi bật */
color: white; /* Màu chữ nổi bật */
border: none; /* Bỏ đường viền nếu cần */
}

.tit {
margin-top: 55px;
}

.hidden {
display: none !important;
}

a.ncv {
background-color: gold;
padding: 7px;
border-radius: 6px;
}

a.ncv:hover {
background-color: greenyellow;
padding: 7px;
border-radius: 6px;
}

.no-scroll {
overflow: hidden;
}

.blurred {
filter: blur(5px); /* Điều chỉnh mức độ làm mờ */
transition: filter 0.3s ease;
}

.search-container {
display: flex;
align-items: center; /* Căn giữa các phần tử theo chiều dọc */
gap: 5px; /* Khoảng cách giữa các phần tử */
}

#scroll-buttons {
position: fixed;
right: 0px;
bottom: 60px;
display: flex;
flex-direction: column;
gap: 8px;
z-index: 9999;
}

#scroll-buttons button {
color: white;
border: none;
padding: 0px;
border-radius: 50%;
font-size: 18px;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
transition: background-color 0.3s;
}


#scroll-buttons button:hover {
background-color: #0056b3;
}

#bgColorOptions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
}

.colorBox {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.buy-range-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.buy-range-form .form-group {
    display: flex;
    flex-direction: column;
}

.buy-range-form label {
    font-weight: bold;
    margin-bottom: 4px;
}

.buy-range-form input[type="number"] {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-buy.btn-range {
    background-color: #6c5ce7;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-buy.btn-range:hover {
    background-color: #5a4dcf;
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    text-align: center;
}
.modal-actions {
    margin-top: 15px;
}
.btn-confirm, .btn-cancel {
    padding: 8px 16px;
    margin: 0 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.btn-confirm {
    background-color: #28a745;
    color: white;
}
.btn-cancel {
    background-color: #dc3545;
    color: white;
}


@media (max-width: 768px) { /* Áp dụng cho màn hình có chiều rộng tối đa 768px */
* {
    text-decoration: none; /* Bỏ gạch chân cho tất cả các phần tử */
}

.content1 {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #FDF6E3;
    color: #3C3C3C;
    position: relative;
    font-size: 18px;
    font-family: 'Times New Roman', Times, serif;
    margin-left: 3px;
    margin-right: 3px;
    border-radius: 5px;
}

.btn {
    display: inline-block;
    margin: 5px;
    padding: 5px 5px;
    background-color: #007BFF;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 5px;
    font-weight: 600;
    user-select: none;
    transition: background-color 0.3s;
}

.sidebar {
    position: fixed;
    left: -620px; /* Ẩn ra ngoài */
    top: 0;
    width: 70%;
    height: 97dvh;
    background: #f1f1f1;
    transition: left 0.3s ease;
    z-index: 1002;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
}

.content {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #FDF6E3;
    color: #3C3C3C;
    position: relative;
    font-size: 18px;
    margin-left: 0px;
    margin-right: 0px;
}

a.ncv {
    background-color: gold;
    padding: 2px;
    border-radius: 6px;
}

.pagination {
    left: 1px;
    bottom: 1px;
    width: 100vh;
    padding-top: 5px;
    margin-left: -20px;
    padding-bottom: 20px;
}
.play_audio {
    margin-left: 135px;
}
}