/* =========================================================
   TeenNovel_WED — trang-chu.css
   ========================================================= */

/* ── HERO ── */
.tc-hero {
    background: linear-gradient(180deg, #faf5ff 0%, #f5f0ff 100%);
    border-bottom: 1px solid #ede9fe;
    padding: 40px 24px 32px;
    text-align: center;
}
.tc-banner {
    width: 100%;
    height: 450px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    border-radius: 18px;
}



.tc-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: .7s;
}



    .tc-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }



    .tc-slide.active {
        opacity: 1;
    }



/* nút trái phải */


.tc-prev,
.tc-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(0,0,0,.35);
    color: white;
    border-radius: 50%;
    cursor: pointer;
}


.tc-prev {
    left: 20px;
}


.tc-next {
    right: 20px;
}





/* dots */


.tc-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}



.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    opacity: .5;
    margin: 5px;
    cursor: pointer;
}


    .dot.active {
        opacity: 1;
    }




/* đẩy search cách banner */


.tc-hero-content {
    margin-top: 20px;
}
.tc-hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px 16px;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(124,58,237,.08);
    transition: box-shadow .15s, border-color .15s;
}
.tc-hero-search:focus-within {
    border-color: #a78bfa;
    box-shadow: 0 2px 14px rgba(124,58,237,.15);
}
.tc-hero-search i { font-size: 16px; color: #c4b5fd; flex-shrink: 0; }
.tc-hero-search input {
    border: none; outline: none;
    font-size: 14px; color: #3b0764;
    flex: 1; background: transparent;
    font-family: inherit;
}
.tc-hero-search input::placeholder { color: #c4b5fd; }
.tc-hero-search button {
    padding: 7px 18px;
    border-radius: 8px;
    border: none;
    background: #7c3aed;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s;
    font-family: inherit;
}
.tc-hero-search button:hover { background: #6d28d9; }

/* ── THỂ LOẠI ── */
.tc-genre-wrap {
    border-bottom: 1px solid #ede9fe;
    background: #fff;
}
.tc-genre-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tc-genre-tabs::-webkit-scrollbar { display: none; }
.tc-genre-tab {
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #ede9fe;
    background: #faf5ff;
    font-size: 13px;
    font-weight: 500;
    color: #7c3aed;
    text-decoration: none;
    transition: all .12s;
    flex-shrink: 0;
}
.tc-genre-tab:hover { background: #ede9fe; color: #6d28d9; }
.tc-genre-tab.active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}
/* ================= THỂ LOẠI KÉO NGANG ================= */


.tc-genre-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}


.tc-genre-tabs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    padding: 5px;
}


    /* ẩn thanh kéo mặc định */

    .tc-genre-tabs::-webkit-scrollbar {
        display: none;
    }
.tc-genre-tab {
    white-space: nowrap;
    padding: 10px 20px;
    border-radius: 25px;
    background: #f2e8ff;
    color: #7b3fe4;
    text-decoration: none;
    font-weight: 600;
    transition: .3s;
}
    .tc-genre-tab:hover,
    .tc-genre-tab.active {
        background: #8b4dff;
        color: white;
    }
.genre-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #8b4dff;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
}
    .genre-btn:hover {
        opacity: .8;
    }

/* ── SECTION ── */
.tc-section {
    padding: 28px 24px 0;
}
.tc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.tc-section-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}
.tc-section-title i { font-size: 18px; color: #a855f7; }
.tc-section-more {
    font-size: 13px;
    color: #7c3aed;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.tc-section-more:hover { text-decoration: underline; color: #6d28d9; }

/* ── CARDS GRID — poster đồng đều ── */
.tc-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.tc-card {
    text-decoration: none;
    display: block;
    cursor: pointer;
}
.tc-card:hover .tc-cover img,
.tc-card:hover .tc-cover-placeholder {
    transform: scale(1.03);
    transition: transform .2s ease;
}

/* ── COVER — cùng kích cỡ tuyệt đối ── */
.tc-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;      /* tỉ lệ 2:3 giống bìa sách */
    border-radius: 10px;
    overflow: hidden;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    margin-bottom: 9px;
}
.tc-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;         /* cắt đều, không méo */
    display: block;
    transition: transform .2s ease;
}
.tc-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}
.tc-cover-placeholder i {
    font-size: 36px;
    color: #c4b5fd;
}

/* Badge trạng thái */
.tc-badge {
    position: absolute;
    top: 7px; left: 7px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.tc-badge--green  { background: #f0fdf4; color: #15803d; }
.tc-badge--blue   { background: #eff6ff; color: #1d4ed8; }
.tc-badge--amber  { background: #fffbeb; color: #b45309; }

/* Card info */
.tc-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #a78bfa;
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tc-card-author {
    font-size: 11px;
    color: #a78bfa;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-card-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #9ca3af;
}
.tc-card-meta i { font-size: 12px; vertical-align: -1px; margin-right: 2px; }

/* ── 2 CỘT ── */
.tc-two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    padding: 28px 24px 0;
}

/* ── XẾP HẠNG ── */
.tc-rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tc-rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    text-decoration: none;
    transition: border-color .12s, background .12s;
}
.tc-rank-item:hover { border-color: #c4b5fd; background: #faf5ff; }

.tc-rank-num {
    font-size: 18px;
    font-weight: 700;
    min-width: 26px;
    text-align: center;
    color: #d1d5db;
}
.tc-rank-num.top-1 { color: #f59e0b; }
.tc-rank-num.top-2 { color: #9ca3af; }
.tc-rank-num.top-3 { color: #c2774a; }

.tc-rank-cover {
    width: 40px;
    height: 56px;           /* tỉ lệ 2:3 giống poster */
    border-radius: 6px;
    overflow: hidden;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-rank-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tc-rank-cover i { font-size: 16px; color: #c4b5fd; }

.tc-rank-info { flex: 1; min-width: 0; }
.tc-rank-title {
    font-size: 13px;
    font-weight: 600;
    color: #3b0764;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-rank-meta {
    font-size: 11px;
    color: #a78bfa;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-rank-views {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tc-rank-views i { font-size: 13px; }

/* ── MỚI CẬP NHẬT ── */
.tc-new-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tc-new-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    text-decoration: none;
    transition: border-color .12s, background .12s;
}
.tc-new-item:hover { border-color: #c4b5fd; background: #faf5ff; }

.tc-new-cover {
    width: 36px;
    height: 50px;           /* tỉ lệ 2:3 */
    border-radius: 5px;
    overflow: hidden;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-new-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tc-new-cover i { font-size: 14px; color: #c4b5fd; }

.tc-new-info { flex: 1; min-width: 0; }
.tc-new-title {
    font-size: 13px;
    font-weight: 600;
    color: #3b0764;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-new-chapter {
    font-size: 11px;
    color: #7c3aed;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-new-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── EMPTY ── */
.tc-empty {
    padding: 32px;
    text-align: center;
    font-size: 13px;
    color: #c4b5fd;
}

.search-box-wrapper {
    position: relative;
    max-width: 520px;
    margin: auto;
}



.search-suggest {
    position: absolute;
    top: 58px;
    left: 0;
    width: 100%;
    background: #11101c;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    z-index: 999;
    box-shadow: 0 15px 40px rgba(0,0,0,.4);
}



    .search-suggest.show {
        display: block;
    }



.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: white;
    text-decoration: none;
    transition: .2s;
}



    .search-item:hover {
        background: rgba(168,85,247,.15);
    }



    .search-item img {
        width: 45px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
    }



.search-item-title {
    font-size: 14px;
    font-weight: 600;
}



.search-empty {
    padding: 15px;
    color: #aaa;
    text-align: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
    .tc-cards-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .tc-two-col { grid-template-columns: 1fr; }
    .tc-cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .tc-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .tc-hero-title { font-size: 20px; }

    .tc-hero { padding: 20px 12px 18px; }
    .tc-banner { height: clamp(180px, 58vw, 240px); margin-bottom: 14px; border-radius: 12px; }
    .tc-prev, .tc-next { width: 34px; height: 34px; }
    .tc-prev { left: 10px; }
    .tc-next { right: 10px; }
    .tc-hero-search { padding: 8px 10px; gap: 7px; }
    .tc-hero-search input { min-width: 0; font-size: 12px; }
    .tc-hero-search button { padding: 7px 10px; font-size: 12px; }
    .tc-genre-tabs { padding: 10px 12px; }
    .tc-section { padding-left: 12px; padding-right: 12px; }
    .tc-section-head { align-items: flex-start; gap: 8px; }
    .tc-section-title { font-size: 17px; }
    .tc-card-title { font-size: 12px; }
    .tc-card-author, .tc-card-meta { font-size: 10px; }
}

@media (max-width: 768px) {

    .tc-genre-wrap {
        display: none !important;
    }
}
