/* assets/css/style.css */

/* Styles specific to index.php or Hero Section */
.hero-section {
    position: relative;
    height: 90vh; /* Adjust height as needed */
    overflow: hidden;
    color: #fff;
}

.hero-slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.hero-slider-item.active {
    opacity: 1;
    z-index: 1; /* Bring active slide to front */
}

.hero-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(70%);
}

.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0) 100%);
    z-index: -1;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-title {
    font-size: 3em;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.2em;
    line-height: 1.5;
    margin-bottom: 30px;
}

.hero-buttons .play-button, .hero-buttons .info-button {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hero-buttons .play-button {
    background-color: #fff;
    color: #141414;
}

.hero-buttons .play-button:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.hero-buttons .info-button {
    background-color: rgba(109, 109, 110, 0.7);
    color: #fff;
}

.hero-buttons .info-button:hover {
    background-color: rgba(109, 109, 110, 0.5);
}

/* Slider Controls */
.slider-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 2em;
    cursor: pointer;
    z-index: 2;
    height: 100%; /* Make button cover full height */
    display: flex;
    align-items: center;
}
.slider-control.left {
    left: 0;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}
.slider-control.right {
    right: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}
.slider-control:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Dots for pagination */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 10px;
}
.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.dot.active {
    background: #e50914; /* Netflix red */
}

/* Content Rows styles */
.content-rows {
    padding: 120px 50px;
    position: relative;
    margin-top: -100px; /* Overlap with hero section */
    z-index: 10;
}

.movie-category {
    margin-bottom: 40px;
    position: relative; /* สำหรับตำแหน่งของ Carousel Control */
}

.movie-category h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #fff;
}

.movie-carousel {
    display: flex;
    overflow-x: scroll;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px;
    position: relative;
    /* Hide scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.movie-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Basic movie card */
.movie-card {
    flex: 0 0 auto;
    width: 250px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
    border-radius: 5px;
    overflow: hidden;
    display: block; /* Ensure it behaves like a block for full click area */
}

.movie-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
    display: block; /* Remove extra space below image */
    aspect-ratio: 2/3; /* Consistent aspect ratio for posters */
}

.movie-card:hover {
    transform: scale(1.1);
    z-index: 50;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
}

.movie-card:hover img {
    transform: 1.05;
}

.movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.movie-card:hover .movie-info {
    transform: translateY(0);
    opacity: 1;
}

.movie-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-info p {
    font-size: 0.9rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* <<< Styles for Top Daily Content (Ranked Cards) >>> */
.ranked-carousel-wrapper {
    position: relative;
}

.ranked-carousel {
    display: flex;
    overflow-x: scroll;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 15px;
    position: relative;
    /* Hide scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */

    /* ไม่ต้องมี padding-left ที่นี่แล้ว */
    padding-left: 0px;
    padding-right: 50px; /* เพื่อให้เลื่อนได้สุด */
    box-sizing: border-box;
}
.ranked-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.ranked-card {
    flex: 0 0 auto;
    /* ความกว้างรวมของตัวเลข + โปสเตอร์ */
    width: 250px; /* เช่น 80px (ตัวเลข) + 170px (โปสเตอร์) */
    height: 270px; /* ความสูงโปสเตอร์ 270px */
    margin-right: 5px; /* ระยะห่างระหว่าง Card ให้เห็นตัวเลขชัดๆ */
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
    box-sizing: border-box;

    /* ใช้ Flexbox เพื่อจัดเรียงตัวเลขและโปสเตอร์ในแนวเดียวกัน */
    display: flex;
    align-items: flex-end; /* จัดเรียงแนวตั้งให้ชิดด้านล่าง */
    justify-content: flex-start; /* เริ่มจากซ้าย */
    overflow: hidden; /* ซ่อนส่วนที่เกินขอบ */
}

.ranked-card .rank-number {
    font-family: 'Netflix Sans', Arial, sans-serif; /* ถ้ามี Font นี้ */
    font-size: 12em; /* ขนาดตัวเลข (อาจปรับอีกตามความเหมาะสม) */
    font-weight: bold;
    color: #e50914; /* สีแดง Netflix */
    -webkit-text-stroke: 4px #e5e5e5; /* ขอบขาว */
    text-stroke: 4px #e5e5e5;
    -webkit-text-fill-color: transparent; /* โปร่งใส */
    text-fill-color: transparent;
    position: absolute; /* วางตำแหน่งอิสระบน Card */
    left: 15px; /* ปรับตำแหน่งไปทางซ้ายของ Card */
    bottom: -25px; /* ปรับตำแหน่งลงมาเกือบถึงขอบล่างของโปสเตอร์ */
    z-index: 5; /* ให้ตัวเลขอยู่บนโปสเตอร์ */
    flex-shrink: 0; /* ไม่ให้ตัวเลขถูกย่อ */
    width: 80px; /* กำหนดความกว้างให้ตัวเลขมีพื้นที่ */
    text-align: left; /* จัดตัวเลขชิดซ้าย */
    line-height: 1; /* ปรับ line-height */
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.8)); /* เงา */
    padding: 0; /* ไม่มี padding ที่ตัวเลขโดยตรง */
}

.ranked-card .poster-wrapper {
    position: relative; /* เพื่อให้ movie-info ซ้อนทับได้ */
    width: 170px; /* ความกว้างของโปสเตอร์ (กำหนดแน่นอน) - 250px(total) - 80px(rank-width) */
    height: 270px; /* 170px * (3/2) */
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    flex-shrink: 0; /* ไม่ให้โปสเตอร์ถูกย่อ */
    display: block; /* แก้ปัญหาช่องว่างด้านล่าง img */
    z-index: 2; /* อยู่ด้านหลังตัวเลข */
    margin-left: 80px; /* ดันโปสเตอร์ไปทางขวา เพื่อให้ตัวเลขมีพื้นที่ */
}

.ranked-card .poster-wrapper img {
    width: 100%;
    height: 100%; /* ให้ภาพเต็ม wrapper */
    object-fit: cover;
    border-radius: 5px;
    display: block;
    transition: transform 0.3s ease;
    filter: brightness(80%); /* หรี่ภาพลงเล็กน้อยเพื่อให้ตัวเลขชัดขึ้น */
}

.ranked-card:hover {
    transform: scale(1.1); /* ขยายเมื่อ Hover */
    z-index: 50; /* อยู่ด้านบนสุดเมื่อ Hover */
}

.ranked-card:hover .poster-wrapper img {
    transform: 1.05;
}
/* Movie info overlay for ranked cards (similar to movie-card) */
.ranked-card .movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    z-index: 99; /* ต้องอยู่บน poster-wrapper และ rank-number */
}

.ranked-card:hover .movie-info {
    transform: translateY(0);
    opacity: 1;
}
/* <<< END NEW: Styles for Top Daily Content (Ranked Cards) >>> */


/* Carousel Navigation Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    color: #fff;
    border: none;
    padding: 15px 10px;
    font-size: 2em;
    cursor: pointer;
    z-index: 15; /* อยู่บน carousel content */
    opacity: 0; /* ซ่อนตอนแรก */
    transition: opacity 0.3s ease;
}

.movie-category:hover .carousel-arrow {
    opacity: 1; /* แสดงเมื่อ hover ที่ category */
}

.carousel-arrow.left {
    left: 0;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}
.carousel-arrow.right {
    right: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

/* Responsive adjustments for overall page */
@media (max-width: 1200px) {
    /* Adjust padding for larger screens */
    .netflix-header,
    .hero-section .hero-slider-item,
    .content-rows {
        padding-left: 20px;
        padding-right: 30px;
    }
    /* Ranked cards responsive */
    .ranked-carousel {
        padding-left: 70px; /* เว้นที่ให้ตัวเลข */
        padding-right: 30px; /* ลด padding ขวา */
    }
    .ranked-card {
        width: 220px; /* 70px (ตัวเลข) + 150px (โปสเตอร์) */
        height: 225px; /* 150px * 1.5 */
        margin-right: 15px; /* ลดระยะห่าง */
    }
    .ranked-card .rank-number {
        font-size: 10em; /* ปรับขนาดตัวเลข */
        left: 0px; /* แก้ไข: ให้ติดขอบซ้ายของ card */
        bottom: -20px; /* ปรับให้พอดีกับภาพ */
        width: 70px; /* ปรับความกว้างตัวเลข */
    }
    .ranked-card .poster-wrapper {
        width: 150px; /* ปรับความกว้างโปสเตอร์ให้เล็กลง */
        margin-left: 70px; /* ดันโปสเตอร์ไปทางขวา */
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 70vh; /* Adjust height for mobile */
        padding-top: 80px; /* Adjust for mobile header */
    }
    .hero-slider-item {
        padding: 0 20px;
        text-align: center;
        justify-content: center;
    }
    .hero-content {
        max-width: 100%;
    }
    .hero-title {
        font-size: 2.2em;
    }
    .hero-description {
        font-size: 1em;
    }
    .slider-control {
        padding: 10px;
        font-size: 1.5em;
    }
    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .hero-buttons .play-button, .hero-buttons .info-button {
        margin-right: 0;
        width: 80%;
    }
    .content-rows {
        padding: 10px;
        margin-top: -50px;
    }
    .movie-category h2 {
        font-size: 1.5rem;
    }
    .movie-card {
        width: 180px;
    }

    /* Ranked cards responsive */
    .ranked-carousel {
        padding-left: 50px; /* ลด padding ซ้าย */
        padding-right: 20px; /* ลด padding ขวา */
    }
    .ranked-card {
        width: 150px; /* 50px (ตัวเลข) + 100px (โปสเตอร์) */
        height: 225px; /* 150px * 1.5 */
        margin-right: 10px; /* ระยะห่างระหว่าง Card */
        align-items: flex-end; /* ให้โปสเตอร์ชิดขอบล่าง */
    }
    .ranked-card .rank-number {
        font-size: 8em;
        width: 50px;
        left: 0px; /* แก้ไข: ปรับตำแหน่งให้ติดขอบซ้ายของ card */
        bottom: -10px; /* แก้ไข: ปรับให้พอดี */
    }
    .ranked-card .poster-wrapper {
        width: 100px; /* ปรับความกว้างโปสเตอร์ */
        margin-left: 50px;
    }
    .netflix-footer {
        padding: 30px 20px;
    }
    .footer-links ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 60vh;
    }
    .hero-title {
        font-size: 1.8em;
    }
    .hero-description {
        font-size: 0.9em;
    }
    .movie-card {
        width: 150px;
    }
    .ranked-carousel {
        padding-left: 40px;
        padding-right: 15px;
    }
    .ranked-card {
        width: 120px; /* 40px (ตัวเลข) + 80px (โปสเตอร์) */
        height: 180px; /* 120px * 1.5 */
        margin-right: 5px;
        align-items: flex-end; /* ให้โปสเตอร์ชิดขอบล่าง */
    }
    .ranked-card .rank-number {
        font-size: 6em;
        width: 40px;
        left: 0px; /* แก้ไข: ปรับให้ติดขอบซ้ายของ card */
        bottom: -10px; /* แก้ไข: ปรับให้พอดี */
    }
    .ranked-card .poster-wrapper {
        width: 160px;
        margin-left: 10px;
    }
    .footer-links ul {
        grid-template-columns: 1fr;
    }
}

.netflix-footer .footer-content {
    max-width: 960px; /* Max width to center content */
    margin: 0 auto; /* Center the content */
    padding: 0 20px; /* Horizontal padding for smaller screens */
}


.netflix-footer .footer-links li a {
    color: #808080; /* Link color */
    text-decoration: none; /* Remove underline */
    font-size: 0.9em; /* Slightly smaller font size */
    transition: color 0.3s ease; /* Smooth transition for hover effect */
}

.netflix-footer .footer-links li a:hover {
    color: #ffffff; /* White color on hover */
}

/* Styles for the social media icons */
.netflix-footer .footer-social {
    margin-top: 30px; /* Space above social icons */
    text-align: center; /* Center the icons */
}

.netflix-footer .footer-social a {
    color: #808080; /* Icon color */
    font-size: 1.8em; /* Size of the icons */
    margin: 0 15px; /* Space between icons */
    transition: color 0.3s ease; /* Smooth transition for hover effect */
}

.netflix-footer .footer-social a:hover {
    color: #ffffff; /* White color on hover */
}

/* Styles for the copyright information */
.netflix-footer .footer-copyright {
    text-align: center; /* Center the copyright text */
    margin-top: 30px; /* Space above copyright */
    font-size: 0.85em; /* Smaller font size for copyright */
    line-height: 1.5; /* Line height for readability */
}

.netflix-footer .footer-copyright p {
    margin: 5px 0; /* Small margin between paragraphs */
}



    .netflix-footer .footer-social {
        margin-top: 20px;
    }

    .netflix-footer .footer-social a {
        font-size: 1.5em; /* Smaller icons on very small screens */
        margin: 0 10px;
    }
