/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff5252;
}

/* Custom Scrollbar - Phiên bản nâng cao */
body {
    scrollbar-width: thin;
    /* Cho Firefox */
    scrollbar-color: #ff6b6b #f1f1f1;
    /* Cho Firefox */
}

/* Cho Chrome, Safari, và các trình duyệt dựa trên Webkit */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff6b6b, #ff8686);
    border-radius: 10px;
    border: 2px solid #f1f1f1;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ff5252, #ff7070);
}

::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* Custom cho thanh cuộn ngang (horizontal scrollbar) trong các thành phần */
.main-nav ul::-webkit-scrollbar,
.category-pills::-webkit-scrollbar {
    height: 5px;
}

.main-nav ul::-webkit-scrollbar-track,
.category-pills::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
}

.main-nav ul::-webkit-scrollbar-thumb,
.category-pills::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.7);
    border-radius: 5px;
    border: none;
}

/* Ẩn scrollbar nhưng vẫn giữ chức năng cuộn cho một số phần tử */
.scrollable-hidden {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    overflow-y: auto;
}

.scrollable-hidden::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Phiên bản scrollbar mini cho phần đọc truyện */
.reading-container::-webkit-scrollbar {
    width: 6px;
}

.reading-container::-webkit-scrollbar-track {
    background: transparent;
}

.reading-container::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.5);
    border-radius: 3px;
}

.reading-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 107, 0.8);
}

/* Hiệu ứng ẩn hiện scrollbar khi hover */
.hover-scrollbar {
    overflow-y: auto;
}

.hover-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.3);
}

.hover-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 107, 0.7);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
li {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Mobile container */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding-bottom: env(safe-area-inset-bottom);
}

.site-footer.scrolled {
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
}

/* Header */
.site-header {
    background-color: #ff6b6b;
    color: #fff;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.logo h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.search-container {
    display: flex;
    width: 100%;
}

.search-container input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px 0 0 20px;
    outline: none;
}

.search-container button {
    background: #ff8686;
    border: none;
    padding: 8px 12px;
    border-radius: 0 20px 20px 0;
    color: white;
    cursor: pointer;
}

/* Navigation */
.main-nav {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 59px;
    /* Header height */
    z-index: 999;
    transition: transform 0.3s ease;
}

.main-nav ul {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
    /* Firefox */
}

.main-nav ul::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.main-nav li {
    flex: 0 0 auto;
    margin-right: 15px;
    white-space: nowrap;
}

.main-nav a {
    color: #666;
    font-weight: 500;
    padding: 5px 0;
    display: block;
}

.main-nav a i {
    margin-right: 5px;
    color: #ff6b6b;
}

/* Content container */
.content-container {
    padding: 15px;
    padding-bottom: 95px;
}

/* Hero Banner */
.hero-banner {
    position: relative;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 30px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-banner h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-banner p {
    font-size: 1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary {
    background-color: white;
    color: #ff6b6b;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary i,
.btn-outline i {
    margin-right: 8px;
}

.btn-outline {
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Category Pills */
.category-pills {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 5px 0 15px;
    scrollbar-width: none;
    /* Firefox */
    margin-bottom: 15px;
}

.category-pills::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.category-pill {
    display: inline-flex;
    align-items: center;
    background-color: white;
    color: #666;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.category-pill:hover {
    background-color: #ff6b6b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.category-pill i {
    margin-right: 6px;
    font-size: 0.9rem;
    color: #ff6b6b;
}

.category-pill:hover i {
    color: white;
}

/* Sections */
.home-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.2rem;
    color: #333;
    display: flex;
    align-items: center;
}

.section-header h2 i {
    color: #ff6b6b;
    margin-right: 8px;
}

.view-all {
    color: #ff6b6b;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.view-all i {
    margin-left: 5px;
    transition: transform 0.2s;
}

.view-all:hover i {
    transform: translateX(3px);
}

/* Comics Grid */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.comic-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.comic-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comic-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.comic-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.comic-card:hover .comic-cover img {
    transform: scale(1.08);
}

.comic-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
}

.comic-status.ongoing {
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
}

.comic-status.completed {
    background-color: rgba(33, 150, 243, 0.9);
    color: white;
}

.comic-views {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    z-index: 2;
}

.comic-rank {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background-color: #ffd700;
    color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 2;
}

.comic-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.comic-card:hover .comic-overlay {
    opacity: 1;
}

.comic-quick-info {
    font-size: 0.75rem;
}

.comic-tags-preview {
    margin-bottom: 5px;
}

.comic-tags-preview span {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    margin-right: 5px;
    border-radius: 20px;
    font-size: 0.7rem;
}

.comic-chapter-count {
    font-size: 0.75rem;
}

.comic-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.comic-info h3 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.comic-author {
    font-size: 0.8rem;
    color: #777;
    display: flex;
    align-items: center;
    margin-top: auto;
}

.comic-author i {
    margin-right: 5px;
    color: #999;
    font-size: 0.75rem;
}

.no-comics {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #777;
    background-color: #f9f9f9;
    border-radius: 10px;
}

/* Popular Featured */
.popular-banner-section {
    margin-bottom: 30px;
}

.popular-featured {
    margin-bottom: 15px;
}

.featured-card {
    display: block;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.featured-cover {
    position: relative;
    width: 100%;
    height: 180px;
}

.featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.3));
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffd700;
    color: #333;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.featured-badge i {
    margin-right: 5px;
}

.featured-info h3 {
    font-size: 1.2rem;
    color: white;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.featured-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.featured-info p i {
    margin-right: 5px;
}

.featured-stats {
    display: flex;
    gap: 15px;
}

.featured-stats span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.featured-stats span i {
    margin-right: 5px;
    color: #ff6b6b;
}

/* Home Genres */
.genres-section {
    margin-bottom: 30px;
}

.popular-genres {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.genre-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    border-radius: 10px;
    padding: 15px 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.genre-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.genre-icon {
    width: 50px;
    height: 50px;
    background-color: #f9f9f9;
    color: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: background-color 0.3s, color 0.3s;
}

.genre-card:hover .genre-icon {
    background-color: #ff6b6b;
    color: white;
}

.genre-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    text-align: center;
}

/* Latest chapters section */
.latest-chapters-section {
    margin-bottom: 30px;
}

.chapters-list {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.latest-chapter-item {
    border-bottom: 1px solid #eee;
}

.latest-chapter-item:last-child {
    border-bottom: none;
}

.latest-chapter-item a {
    display: flex;
    padding: 12px 15px;
    color: #555;
    transition: background-color 0.2s;
}

.latest-chapter-item a:hover {
    background-color: #f9f9f9;
}

.chapter-thumb {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.chapter-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-chapter-info {
    flex: 1;
}

.latest-chapter-info h3 {
    font-size: 0.95rem;
    margin-bottom: 3px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latest-chapter-info p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.chapter-meta {
    display: flex;
    gap: 10px;
}

.chapter-meta span {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
}

.chapter-meta i {
    margin-right: 3px;
    font-size: 0.75rem;
    color: #ff6b6b;
}

.no-chapters {
    text-align: center;
    padding: 20px;
    color: #777;
}

/* Footer */
.site-footer {
    background-color: #fff;
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 1px solid #eee;
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.07);
    z-index: 900;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
    padding: 0 10px;
}

.footer-nav a {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
    position: relative;
    transition: all 0.2s ease;
}

.footer-nav a.active {
    color: #ff6b6b;
}

.footer-nav a.active:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background-color: #ff6b6b;
    border-radius: 50%;
}

.footer-nav a:hover {
    color: #ff6b6b;
}

.footer-nav i {
    font-size: 1.3rem;
    margin-bottom: 3px;
    background-color: #f5f5f5;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s ease;
}

.copyright {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    background-color: #f9f9f9;
    padding: 5px 0;
    border-radius: 20px;
    margin: 0 auto;
    max-width: 90%;
}

/* Comic Detail Page */
.comic-detail {
    margin-bottom: 20px;
}

.comic-detail-header {
    display: flex;
    margin-bottom: 20px;
}

.comic-detail-cover {
    width: 180px;
    aspect-ratio: 2/3;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-right: 15px;
}

.comic-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comic-detail-header .comic-info {
    flex: 1;
}

.comic-detail-header h1 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.comic-detail-header .comic-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.comic-detail-header .comic-author span {
    font-weight: 500;
}

.comic-detail-header .comic-status {
    display: inline-flex;
    align-items: center;
    position: static;
    margin-bottom: 10px;
}

.comic-detail-header .comic-status i {
    margin-right: 5px;
    font-size: 0.6rem;
}

.comic-detail-header .comic-views {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
    position: static;
    background: none;
    padding: 0;
}

.comic-detail-header .comic-views i {
    margin-right: 5px;
    color: #ff6b6b;
}

.comic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.tag {
    background-color: #f3f3f3;
    color: #666;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.comic-actions {
    display: flex;
    gap: 10px;
}

.comic-actions button {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
}

.start-reading {
    background-color: #ff6b6b;
    color: white;
    width: 150px;
}

.start-reading i {
    margin-right: 5px;
}

.bookmark {
    background-color: #f3f3f3;
    color: #666;
}

.bookmark i {
    margin-right: 5px;
}

.bookmark.active {
    background-color: #ff6b6b;
    color: white;
}

.comic-description {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.comic-description h2 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.description-content {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.comic-chapters h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
}

/* Cải thiện hiển thị danh sách chương trong chi tiết truyện */
.chapter-list {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.chapter-list li {
    border-bottom: 1px solid #eee;
}

.chapter-list li:last-child {
    border-bottom: none;
}

.chapter-list a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-gap: 10px;
    align-items: center;
    padding: 12px 15px;
    color: #555;
    transition: background-color 0.2s;
}

.chapter-list a:hover {
    background-color: #f9f9f9;
}

.chapter-number {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.chapter-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chapter-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
}

.chapter-info .chapter-views {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.chapter-date {
    font-size: 0.8rem;
    color: #999;
}

.no-chapters {
    text-align: center;
    padding: 20px;
    color: #777;
    background-color: #f9f9f9;
    border-radius: 10px;
}

/* Cải thiện trang đọc truyện */
.reading-container {
    padding: 10px;
    padding-bottom: 15px;
    max-width: 100%;
}

/* Định dạng lại phần header chương */
.reading-container .chapter-info {
    margin-bottom: 20px;
    text-align: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: block;
}

.reading-container .chapter-info h1 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #333;
    /* Xử lý tiêu đề dài */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.reading-container .chapter-info h2 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
    /* Xử lý tiêu đề dài */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* Tách thông tin thống kê thành 2 dòng cho màn hình nhỏ */
.reading-container .chapter-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #777;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

.reading-container .chapter-stats span {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #f3f3f3;
    border-radius: 20px;
}

.reading-container .chapter-stats i {
    margin-right: 5px;
    color: #ff6b6b;
}

/* Phần thanh điều hướng chương */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chapter-navigation a,
.chapter-navigation span {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #555;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
    text-align: center;
    white-space: nowrap;
}

.chapter-navigation a:hover {
    background-color: #e9e9e9;
}

.chapter-navigation i {
    margin-right: 5px;
    font-size: 0.9rem;
}

.chapter-navigation .next-chapter i {
    margin-right: 0;
    margin-left: 5px;
}

.chapter-navigation .disabled {
    color: #ccc;
    cursor: not-allowed;
}

.back-to-detail {
    background-color: #f1f1f1;
    white-space: nowrap;
    min-width: 33%;
    justify-content: center;
}

/* Cải thiện phần nội dung chương */
.chapter-content {
    margin-bottom: 20px;
}

.chapter-image {
    margin-bottom: 15px;
    text-align: center;
}

.chapter-image img {
    max-width: 100%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.chapter-navigation.bottom {
    margin-top: 20px;
}

.no-images {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    background-color: #f9f9f9;
    border-radius: 10px;
    font-size: 0.95rem;
}

/* Hot Comics Page */
.page-header {
    margin-bottom: 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header h1 i {
    color: #ff6b6b;
    margin-right: 10px;
}

.page-description {
    color: #777;
    font-size: 0.9rem;
}

.hot-comics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.hot-comic-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
}

.hot-comic-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
}

.hot-comic-item:nth-child(1) .hot-comic-rank {
    background-color: #ffd700;
    /* Gold */
    color: #333;
}

.hot-comic-item:nth-child(2) .hot-comic-rank {
    background-color: #c0c0c0;
    /* Silver */
    color: #333;
}

.hot-comic-item:nth-child(3) .hot-comic-rank {
    background-color: #cd7f32;
    /* Bronze */
    color: white;
}

.hot-comic-link {
    display: flex;
    color: inherit;
}

.hot-comic-cover {
    position: relative;
    width: 110px;
    height: 150px;
    flex-shrink: 0;
}

.hot-comic-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-comic-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.hot-comic-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-comic-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.hot-comic-author i {
    margin-right: 5px;
    color: #999;
}

.hot-comic-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.hot-comic-views,
.hot-comic-chapters {
    font-size: 0.85rem;
    color: #777;
    display: flex;
    align-items: center;
}

.hot-comic-views i,
.hot-comic-chapters i {
    margin-right: 5px;
    color: #ff6b6b;
}

.hot-comic-tags {
    margin-top: auto;
}

.hot-comic-tags .tag {
    display: inline-block;
    background-color: #f3f3f3;
    color: #666;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Search Results Page */
.search-results-header {
    margin-bottom: 20px;
    text-align: center;
}

.search-results-header h1 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results-header h1 i {
    color: #ff6b6b;
    margin-right: 10px;
}

.search-form {
    margin-bottom: 15px;
}

.search-input-container {
    display: flex;
    width: 100%;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input-container input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 0.95rem;
}

.search-input-container button {
    background: #ff6b6b;
    border: none;
    padding: 0 20px;
    color: white;
    cursor: pointer;
}

.search-message {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.search-results-count {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.comics-search-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.comic-search-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s;
}

.comic-search-item:hover {
    transform: translateY(-3px);
}

.comic-search-link {
    display: flex;
    color: inherit;
}

.comic-search-cover {
    position: relative;
    width: 100px;
    height: 150px;
    flex-shrink: 0;
}

.comic-search-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comic-search-info {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.comic-search-title {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comic-search-author {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.comic-search-author i {
    margin-right: 5px;
    color: #999;
}

.comic-search-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.comic-search-views,
.comic-search-chapters {
    font-size: 0.8rem;
    color: #777;
    display: flex;
    align-items: center;
}

.comic-search-views i,
.comic-search-chapters i {
    margin-right: 5px;
    color: #ff6b6b;
}

.comic-search-tags {
    margin-top: auto;
}

.comic-search-tags .tag {
    display: inline-block;
    background-color: #f3f3f3;
    color: #666;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Trang Khám Phá */
.explore-header {
    margin-bottom: 20px;
    text-align: center;
}

.explore-header h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explore-header h1 i {
    color: #ff6b6b;
    margin-right: 10px;
}

.explore-description {
    color: #777;
    font-size: 0.9rem;
}

.explore-message {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.random-comic-container {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.random-comic-refresh {
    background-color: #f8f8f8;
    padding: 10px 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.refresh-button {
    display: inline-flex;
    align-items: center;
    background-color: #f3f3f3;
    color: #666;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.refresh-button:hover {
    background-color: #e6e6e6;
}

.refresh-button i {
    margin-right: 5px;
    font-size: 0.9rem;
}

.random-comic-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.random-comic-cover {
    position: relative;
    width: 100%;
    height: 250px;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
}

.random-comic-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.random-comic-info {
    flex: 1;
}

.random-comic-info h2 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 10px;
}

.random-comic-author {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.random-comic-author i {
    margin-right: 5px;
    color: #999;
}

.random-comic-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.random-comic-views,
.random-comic-chapters {
    font-size: 0.9rem;
    color: #777;
    display: flex;
    align-items: center;
}

.random-comic-views i,
.random-comic-chapters i {
    margin-right: 5px;
    color: #ff6b6b;
}

.random-comic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.random-comic-description {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.random-comic-description h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.random-comic-actions {
    display: flex;
    gap: 10px;
}

.view-detail-button,
.read-button {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.2s;
}

.view-detail-button {
    background-color: #f3f3f3;
    color: #666;
}

.view-detail-button:hover {
    background-color: #e6e6e6;
}

.read-button {
    background-color: #ff6b6b;
    color: white;
}

.read-button:hover {
    background-color: #ff5252;
}

.read-button.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.view-detail-button i,
.read-button i {
    margin-right: 8px;
}

.similar-heading {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.similar-heading:before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: #ff6b6b;
    margin-right: 10px;
    border-radius: 2px;
}

/* Trang danh sách thể loại */
.genre-nav {
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    z-index: 100;
}

.genre-nav.sticky {
    position: sticky;
    top: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.genre-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f3f3f3;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
}

.genre-nav-item:hover {
    background-color: #ff6b6b;
    color: white;
}

.genres-container {
    margin-bottom: 30px;
}

.genre-letter-section {
    margin-bottom: 25px;
    scroll-margin-top: 80px;
}

.genre-letter {
    position: relative;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3f3f3;
}

.genre-letter:before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: #ff6b6b;
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.genre-tag {
    display: inline-flex;
    align-items: center;
    background-color: white;
    color: #666;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.genre-tag:hover {
    background-color: #ff6b6b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.genre-tag i {
    margin-right: 5px;
    font-size: 0.8rem;
}

.genre-popular-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.genre-popular-section h2 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.popular-genres {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.popular-genre {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 10px;
    transition: all 0.2s;
}

.popular-genre:hover {
    background-color: #f9f9f9;
    transform: translateY(-3px);
}

.genre-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.genre-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

/* Trang truyện theo thể loại */
.genre-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.genre-breadcrumb a {
    color: #666;
}

.genre-breadcrumb .separator {
    margin: 0 10px;
    color: #ccc;
}

.genre-breadcrumb .current-genre {
    color: #ff6b6b;
    font-weight: 500;
}

.genre-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.filter-section {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.filter-label {
    margin-right: 10px;
    font-size: 0.9rem;
    color: #666;
}

.sort-select,
.status-select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
}

.sort-select:focus,
.status-select:focus {
    outline: none;
    border-color: #ff6b6b;
}

.genre-comics-grid {
    margin-bottom: 30px;
}

.comic-latest {
    font-size: 0.8rem;
    margin-top: 5px;
}

.latest-chapter {
    display: inline-block;
    background-color: #f3f3f3;
    color: #666;
    padding: 3px 8px;
    border-radius: 20px;
    transition: all 0.2s;
}

.latest-chapter:hover {
    background-color: #ff6b6b;
    color: white;
}

.related-genres {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.related-genres h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.related-genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.related-genre-tag {
    display: inline-block;
    background-color: #f3f3f3;
    color: #666;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.related-genre-tag:hover {
    background-color: #ff6b6b;
    color: white;
}

/* Error page */
.error-container {
    text-align: center;
    padding: 30px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    margin: 30px auto;
}

.error-icon {
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.error-container h1 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

.error-message {
    color: #666;
    margin-bottom: 25px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Hiệu ứng khi tương tác */
.comic-card:active,
.latest-chapter-item a:active,
.chapter-list a:active,
.chapter-navigation a:active,
.comic-actions button:active,
.back-home:active,
.btn-primary:active,
.btn-outline:active,
.category-pill:active,
.genre-card:active,
.refresh-button:active,
.view-detail-button:active,
.read-button:active,
.genre-tag:active,
.related-genre-tag:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Hiệu ứng loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #777;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 107, 107, 0.3);
    border-radius: 50%;
    border-top-color: #ff6b6b;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Nút scroll to top */
.scroll-to-top {
    position: fixed;
    bottom: 90px;
    /* Điều chỉnh vị trí để ở trên footer */
    right: calc(50% - 230px);
    background-color: #ff6b6b;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.scroll-to-top.visible {
    opacity: 1;
}

/* Media Queries */
@media (min-width: 400px) {
    .comics-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .featured-cover {
        height: 200px;
    }

    .hero-banner h1 {
        font-size: 2rem;
    }

    .hero-banner p {
        font-size: 1.1rem;
    }

    .reading-container .chapter-info h1 {
        font-size: 1.4rem;
    }

    .reading-container .chapter-info h2 {
        font-size: 1.1rem;
    }

    .reading-container .chapter-stats {
        justify-content: center;
        gap: 15px;
    }

    .random-comic-content {
        flex-direction: row;
        gap: 20px;
    }

    .random-comic-cover {
        width: 180px;
        height: 250px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
}

@media (max-width: 359px) {
    .comics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .comic-info h3 {
        font-size: 0.85rem;
    }

    .category-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .chapter-navigation {
        flex-wrap: wrap;
        gap: 8px;
    }

    .chapter-navigation a,
    .chapter-navigation span {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .prev-chapter,
    .next-chapter {
        flex: 1;
        min-width: 40%;
    }

    .back-to-detail {
        flex: 1;
        order: 3;
        width: 100%;
    }

    .reading-container .chapter-stats {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .chapter-list a {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }

    .chapter-number {
        grid-column: 1;
        grid-row: 1;
    }

    .chapter-title {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.9rem;
    }

    .chapter-info {
        grid-column: 2;
        grid-row: 1 / 3;
        font-size: 0.75rem;
    }

    .genre-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-section {
        width: 100%;
        margin-bottom: 10px;
    }

    .sort-select,
    .status-select {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .trending-section .featured-comic {
        max-width: 280px;
    }

    .trending-thumb {
        width: 70px;
        height: 105px;
    }

    .latest-updates {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 600px) {
    .latest-updates {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .hot-comic-cover {
        width: 80px;
        height: 120px;
    }

    .comic-detail-cover {
        width: 130px;
    }
}