/* FILE: css/section-book.css */

/* 1. KHUNG CHÍNH SECTION */
.section-book {
    position: relative !important;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    display: block;
    /* Màu nền dự phòng nếu ảnh background chưa load */
    background-color: #cd6b2e;
}

/* 2. BACKGROUND LAYER */
.layer-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.book-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 3. WRAPPER CHÍNH (QUAN TRỌNG: Làm mốc tọa độ) */
.book-surreal-wrapper {
    position: relative !important;
    width: 100%;
    height: 100%;
    display: block !important;
    margin: 0;
    padding: 0;
}

/* 4. CONTAINER SÁCH */
.book-sequence-container {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    margin: 0 !important;
}

/* 5. ĐỊNH DẠNG ẢNH SÁCH (FIX LỖI JPG CÓ NỀN) */
.book-sequence-img {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    /* Dính đáy màn hình */
    bottom: 0 !important;
    top: auto !important;

    /* Kích thước */
    width: auto !important;
    height: auto !important;
    max-height: 85vh !important;
    /* Cao 85% màn hình */
    max-width: 100% !important;

    display: block !important;
    object-fit: contain;
    object-position: bottom center;

    /* Ẩn mặc định để JS xử lý */
    opacity: 0;
    visibility: hidden;
    will-change: opacity, visibility;

    /* --- XỬ LÝ ẢNH JPG --- */
    /* mix-blend-mode: multiply giúp làm trong suốt phần màu trắng của ảnh JPG */
    /* để nó hòa trộn vào nền nâu/cam của web */
    mix-blend-mode: multiply;
}

/* 6. CONTAINER NÚT BẤM (FIX VỊ TRÍ) */
.book-cta-container {
    position: absolute !important;

    /* Căn giữa màn hình */
    left: 50% !important;
    transform: translate(-50%, -50%) !important;

    /* Đặt vị trí nút: Thấp xuống dưới (khoảng 70% chiều cao màn hình) */
    /* Để nó nằm đè lên phần dưới của quyển sách */
    top: 70% !important;
    bottom: auto !important;

    z-index: 100 !important;
    /* Luôn nổi lên trên cùng */
    width: auto !important;
    text-align: center;
    pointer-events: auto;
    /* Để click được */
}

/* 7. STYLE NÚT BẤM (ĐẸP HƠN) */
.btn-open-book {
    position: relative;
    display: inline-block;
    padding: 15px 40px;

    /* Nền đen mờ + Viền vàng */
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #ffb74d;

    /* Chữ vàng */
    color: #ffb74d;
    font-family: 'Oswald', sans-serif;
    /* Hoặc font mặc định nếu chưa load */
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;

    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.btn-open-book:hover {
    background: #ffb74d;
    /* Hover thành nền vàng */
    color: #000;
    /* Chữ đen */
    box-shadow: 0 0 40px rgba(255, 183, 77, 0.6);
    transform: translateY(-3px);
}

/* Hiệu ứng bóng loáng (Shine) */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: 0.5s;
    pointer-events: none;
}

.btn-open-book:hover .btn-shine {
    left: 200%;
    transition: 0.7s;
}

/* 8. NOISE */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
}