/* src/main/resources/static/css/home.css */

body { margin: 0; padding: 0; font-family: 'Inter', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #141414; color: #fff; overflow-x: hidden; }

/* NAVBAR TRÊN CÙNG */
.navbar { position: fixed; top: 0; width: 100%; height: 68px; padding: 0 4%; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; z-index: 100; transition: background-color 0.4s; background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%); }
.navbar.scrolled { background-color: #141414; }

.nav-left { display: flex; align-items: center; gap: 30px; }
.logo { color: #e50914; font-size: 28px; font-weight: 900; text-decoration: none; letter-spacing: -1px; }
.nav-links { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0; }
.nav-links a { color: #e5e5e5; text-decoration: none; font-size: 14px; transition: color 0.4s; }
.nav-links a:hover, .nav-links a.active { color: #fff; font-weight: bold; }

.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-icon { color: #fff; font-size: 20px; cursor: pointer; }
.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -9px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e50914;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #141414;
}

.nav-search {
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.12);
    transition: border-color .2s ease, background .2s ease;
}

.nav-search-toggle {
    border: none;
    background: transparent;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-search-input {
    width: 0;
    opacity: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    transition: width .22s ease, opacity .15s ease;
}

.nav-search-input::placeholder {
    color: #bdbdbd;
}

.nav-search.is-open {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
}

.nav-search.is-open .nav-search-input {
    width: 220px;
    opacity: 1;
    margin-left: 8px;
}

/* HERO SECTION */
.hero { position: relative; height: 90vh; min-height: 600px; display: flex; align-items: center; padding: 0 4%; background-image: url('https://image.tmdb.org/t/p/original/9n2tDcwV2b3dD4B1r7z6Xn1pW4S.jpg'); background-size: cover; background-position: center top; }
.hero-gradient { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to right, #141414 0%, transparent 70%), linear-gradient(to top, #141414 0%, transparent 40%); }
.hero-content { position: relative; z-index: 2; max-width: 600px; margin-top: 100px;}

.movie-title { font-size: 64px; font-weight: 900; margin: 0 0 15px 0; text-transform: uppercase; line-height: 1.1; text-shadow: 2px 2px 4px rgba(0,0,0,0.45); }
.movie-desc { font-size: 1.2vw; line-height: 1.5; color: #fff; margin-bottom: 30px; text-shadow: 2px 2px 4px rgba(0,0,0,0.45); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500;}

.btn-group { display: flex; gap: 15px; }
.btn { padding: 10px 24px; font-size: 1.1rem; font-weight: bold; border-radius: 4px; border: none; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: 0.2s; }
.btn-play { background-color: #fff; color: #000; }
.btn-play:hover { background-color: rgba(255,255,255,0.7); }
.btn-info { background-color: rgba(109, 109, 110, 0.7); color: #fff; }
.btn-info:hover { background-color: rgba(109, 109, 110, 0.4); }


/* =========================================
   DANH MỤC PHIM (CẬP NHẬT HIỆU ỨNG HOVER)
   ========================================= */

/* Bọc toàn bộ các danh mục phim */
.main-content {
    position: relative;
    z-index: 3;
    margin-top: -120px; /* Kéo dòng phim đầu tiên lên đè vào ảnh Hero */
    padding-bottom: 50px;
}

.categories-container {
    padding-bottom: 40px;
}

.row-title {
    font-size: 1.4vw;
    color: #e5e5e5;
    margin: 0 4% 10px;
    font-weight: bold;
}

.row-posters {
    display: flex;
    overflow-y: visible; /* QUAN TRỌNG: Phải để visible để ảnh phóng to không bị cắt xén */
    overflow-x: scroll;
    padding: 20px 4%;
    scroll-behavior: smooth;
    gap: 15px;
}
.row-posters::-webkit-scrollbar { display: none; } /* Ẩn thanh cuộn ngang */

/* Thẻ bọc ngoài Poster và Tên phim */
.movie-card {
    position: relative;
    flex: 0 0 auto; /* Tránh ảnh bị bóp méo khi cuộn ngang */
    border-radius: 4px;
    overflow: hidden; /* Cắt bỏ phần tên phim nằm chờ ở ngoài thẻ */
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.row-poster {
    width: 250px;
    height: 375px; /* Ép tỷ lệ ảnh đẹp nhất cho poster phim 2:3 */
    object-fit: cover; /* Thay vì contain, dùng cover để lấp đầy khung viền */
    display: block;
}

/* Lớp phủ chứa Tên phim (Bình thường sẽ bị ẩn xuống dưới) */
.movie-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 10px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
    transform: translateY(100%); /* Giấu lớp phủ này tuột xuống dưới đáy */
    transition: transform 0.4s ease; /* Hiệu ứng trượt lên mượt mà */
}

/* KHI HOVER CHUỘT VÀO THẺ PHIM */
.movie-card:hover {
    transform: scale(1.08); /* Phóng to thẻ phim */
    z-index: 5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.7); /* Thêm bóng đổ cho phim nổi lên */
}

.movie-card:hover .movie-title-overlay {
    transform: translateY(0); /* Trượt tên phim lên lại vị trí ban đầu */
}

@media (max-width: 768px) {
    .nav-search.is-open .nav-search-input {
        width: 150px;
    }
}

/* ===== Site footer (static pages links) ===== */
.site-footer {
    margin-top: 48px;
    padding: 34px 4% 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0) 0%, rgba(20, 20, 20, 0.65) 22%, rgba(0, 0, 0, 0.92) 100%);
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px 30px;
    align-items: start;
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer__title {
    color: #b3b3b3;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-size: 12px;
}

.site-footer__hint {
    color: rgba(229, 229, 229, 0.75);
    font-size: 13px;
    line-height: 1.45;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    justify-content: flex-start;
}

.site-footer__link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(6px);
}

.site-footer__link:hover {
    background: rgba(229, 9, 20, 0.14);
    border-color: rgba(229, 9, 20, 0.28);
    transform: translateY(-1px);
}

.site-footer__link:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .site-footer {
        margin-top: 30px;
        padding: 26px 4% 36px;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .site-footer__link {
        padding: 9px 12px;
        font-size: 13px;
    }
}
