body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;

    /* Background image */
    background: 
        linear-gradient(
            rgba(255, 182, 193, 0.75),
            rgba(255, 182, 193, 0.75)
        ),
        url("img/background.jpg");

    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Header */
.header {
    position: relative;
    width: 100%;
    background:
        url("img/sakura-left.png") left center no-repeat,
        url("img/sakura-right.png") right center no-repeat,
        linear-gradient(90deg, #f6a6b2, #f8c3cd);

    background-size:
        300px auto,
        300px auto,
        cover;

    color: #ffffff;
    text-align: center;
    padding: 26px 20px;
    font-size: 26px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* ✅ LAYER CHỮ – TRÊN CÙNG */
.header > *:not(.sakura-container) {
    position: relative;
    z-index: 3;
}

.header span {
    display: block;
    font-size: 16px;
    font-weight: normal;
    color: #fff7fb;
    margin-top: 6px;
}

/* 🌸 Hoa anh đào rơi – DƯỚI CHỮ */
.sakura-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.sakura {
    position: absolute;
    top: -30px;
    font-size: 16px;
    opacity: 0.8;
    z-index: 1;
    animation: sakura-fall linear forwards;
}

@keyframes sakura-fall {
    to {
        transform: translateY(220px) rotate(360deg);
        opacity: 0;
    }
}

.header-title{
    position: relative;
    z-index: 999;
}

/* Menu */
.menu {
    background: #ff8fb1;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.3);
    
}

.menu a {
    color: #ffffff;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s, text-shadow 0.3s;
}

.menu a:hover {
    color: #ffe6ef;
    text-shadow: 0 0 6px rgba(255,255,255,0.8);
}

/* Content */
.container {
    width: 90%;
    margin: 25px auto;
}

.section-title {
    font-size: 22px;
    margin-bottom: 15px;
    color: #ff4f8b;
    font-weight: bold;
}

/* Comic grid */
.comic-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
}

/* Comic item */

.comic-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(255, 105, 180, 0.25);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    
}

.comic-item:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 25px rgba(255, 105, 180, 0.45);
}

/* Image */
.comic-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.comic-item:hover img {
    transform: scale(1.08);
}

/* Title */
.comic-item h3 {
    font-size: 14px;
    padding: 10px;
    margin: 0;
    color: #ff4f8b;
    background: linear-gradient(180deg, #fff, #ffe6ef);
}

/* Footer */
.footer {
    background: linear-gradient(90deg, #ff65a3, #ff7eb3);
    color: #ffffff;
    text-align: center;
    padding: 18px;
    margin-top: 35px;
    font-size: 14px;
    box-shadow: 0 -3px 10px rgba(255, 105, 180, 0.4);
}



/* Header trong khung */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0d4dc;
}

.section-title {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
    color: #d94b7d;
    white-space: nowrap;
}


/* Search */
.search-box {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    margin-left: auto;
}


.search-box input {
    border: none;
    outline: none;
    padding: 8px 14px;
    width: 180px;
    font-size: 14px;
}

.search-box button {
    border: none;
    background: #f6a6b2;
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
}

.search-box button:hover {
    background: #f08fa1;
}

#backToTop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f6a6b2, #f08fa1);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: none;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 999;
}

#backToTop:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.3);
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}


a {
    text-decoration: none;
}


/* ============================= */
/* TABLE COMIC LIST – FIX CỨNG */
/* ============================= */

.comic-table {
    width: auto;                
    margin: -20px auto;             
    border-collapse: separate;
    border-spacing: 15px 15px;   
}

/* CARD TRUYỆN */
.comic-table td {
    width: 210px;                /* 👈 KHÓA KÍCH THƯỚC */
    height: 250px;
    padding: 0;

    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-align: center;
    vertical-align: top;

    box-shadow: 0 6px 15px rgba(255,105,180,0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* hover */
.comic-table td:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 22px rgba(255,105,180,0.4);
}

/* link full ô */
.comic-table td a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

/* ảnh */
.comic-table img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    flex-shrink: 0;
}

/* tên truyện */
.comic-table h3 {
    margin: 5px;
    padding: 6px 4px;
    font-size: 14px;
    font-weight: bold;
    color: #ff4f8b;
    background: #fff0f5;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1200px) {
    .comic-table {
        border-spacing: 60px 20px;
    }
}

@media (max-width: 900px) {
    .comic-table {
        border-spacing: 60px 20px;
    }
}

@media (max-width: 600px) {
    .comic-table {
        border-spacing: 60px 20px;
    }
}

.comic-table img,
.comic-table h3 {
    transition: transform 0.3s ease, 
                color 0.3s ease;
}
.comic-table td:hover img {
    transform: scale(1.12);
}


.comic-table td:hover h3 {
    transform: scale(1.08) translateY(-2px);
    color: #ff2f7d;
}
.comic-table td {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.header-title {
  border: #d94b7d;
}
.header-title {
  color: #fff;
  text-shadow:
    -1px -1px 0 #ff9acb,
     1px -1px 0 #ff9acb,
    -1px  1px 0 #ff9acb,
     1px  1px 0 #ff9acb,
     0 0 5px #ffb6d9,
     0 0 10px #ff7fbf;
}

