﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

body {
    background-color: #f4f6f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2. Hiệu ứng cho Card Truyện (Di chuột vào sẽ nổi lên) */
.novel-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

    .novel-card:hover {
        transform: translateY(-5px); /* Nổi lên trên 5px */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important; /* Đổ bóng đậm hơn */
    }

/* 3. Tiêu đề chuyên mục (Tạo dải ruy-băng bên trái giống Hako) */
.section-title {
    border-left: 5px solid #0d6efd; /* Màu xanh Primary của Bootstrap */
    padding-left: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.section-title-hot {
    border-left: 5px solid #dc3545; /* Màu đỏ cho Top Truyện */
}

/* 4. Xử lý tên truyện quá dài (Cắt gọn sau 2 dòng) */
/* Rất quan trọng vì tên Light Novel thường cực kỳ dài */
.novel-title-2lines {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Số dòng tối đa */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    height: 2.8em; /* 1.4 * 2 lines */
}

/* 5. Tùy chỉnh màu sắc cho Top Rank (1, 2, 3) ở Cột phải */
/* Vàng cho Top 1 */
.rank-badge-1 {
    background-color: #ffd700 !important;
    color: #000 !important;
    font-weight: bold;
}
/* Bạc cho Top 2 */
.rank-badge-2 {
    background-color: #c0c0c0 !important;
    color: #000 !important;
    font-weight: bold;
}
/* Đồng cho Top 3 */
.rank-badge-3 {
    background-color: #cd7f32 !important;
    color: #fff !important;
    font-weight: bold;
}
/* Xám cho các Top còn lại */
.rank-badge-other {
    background-color: #6c757d !important;
    color: #fff !important;
}

/* 6. Hiệu ứng hover cho danh sách Top Truyện */
.top-novel-item {
    transition: background-color 0.2s;
    border-bottom: 1px dashed #e9ecef;
}

    .top-novel-item:hover {
        background-color: #f8f9fa;
    }
/* =========================================
   THANH TRƯỢT TRUYỆN ĐỀ XUẤT
   ========================================= */

.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 15px; /* Khoảng cách giữa các truyện */
    padding-bottom: 15px;
    scroll-snap-type: x mandatory; /* Bắt dính thẻ truyện khi cuộn trên điện thoại */
    -webkit-overflow-scrolling: touch;
}

    /* Tùy chỉnh thanh cuộn cho nhỏ và tinh tế hơn */
    .horizontal-scroll-container::-webkit-scrollbar {
        height: 6px;
    }

    .horizontal-scroll-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .horizontal-scroll-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }

        .horizontal-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

/* Định dạng từng thẻ truyện */
.novel-item-horizontal {
    flex: 0 0 160px; /* Độ rộng cố định của mỗi thẻ truyện là 160px */
    scroll-snap-align: start;
}

.novel-cover-wrapper {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

    .novel-cover-wrapper img {
        width: 100%;
        height: 220px;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

.novel-item-horizontal:hover .novel-cover-wrapper img {
    transform: scale(1.08); /* Zoom nhẹ ảnh khi đưa chuột vào */
}
.text-decoration-none :hover {
    transition: color 0.3s ease;
    color: #fd7e14 !important;
}
/* === NHÃN (BADGES) GIỐNG ẢNH MẪU === */
.badge-hot {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #ff2853; /* Màu đỏ hồng */
    color: white;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge-time {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #00c4ff; /* Màu xanh lơ */
    color: white;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}