/* =========================================
   1. GLOBAL & VARS
   ========================================= */
   :root {
    --netflix-red: #e50914;
    --netflix-dark: #141414;
    --netflix-card: #1f1f1f;
    --text-main: #ffffff;
    --text-sec: #b3b3b3;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--netflix-dark);
    color: var(--text-main);
    padding-top: 70px;
}

/* =========================================
   2. FIX REVIEW TEXT OVERFLOW (แก้ปัญหาข้อความทะลุ)
   ========================================= */
#detail-content {
    /* สำคัญมาก: สั่งให้ตัดคำเมื่อสุดขอบ แม้จะเป็นคำยาวๆ */
    overflow-wrap: break-word; 
    word-wrap: break-word;
    word-break: break-word;
    
    /* จัดการเว้นบรรทัด */
    white-space: pre-wrap; 
    line-height: 1.8;
    color: #ddd;
}

/* =========================================
   3. MODERN SEARCH BAR (ช่องค้นหาแบบใหม่)
   ========================================= */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid transparent !important;
    border-radius: 50px !important; /* ทรงแคปซูล */
    padding-left: 45px !important; /* เว้นที่ให้ไอคอน */
    color: white !important;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: var(--netflix-red) !important;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sec);
    pointer-events: none;
}

/* =========================================
   4. COMPACT VIEW TOGGLES (ปุ่มสลับ Grid/List)
   ========================================= */
.view-toggle-btn {
    border-radius: 50px !important;
    padding: 6px 15px !important;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

/* ซ่อน Text บนมือถือให้เหลือแค่ไอคอน */
@media (max-width: 576px) {
    .view-toggle-text {
        display: none;
    }
}

/* =========================================
   5. MOBILE LIST VIEW (ปรับ List ในมือถือให้สวย)
   ========================================= */
.movie-card.list-mode {
    display: flex;
    flex-direction: row; /* เรียงแนวนอนเสมอ */
    height: 140px; /* กำหนดความสูงแน่นอน */
    background: var(--netflix-card);
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.movie-card.list-mode .movie-poster {
    width: 110px; /* รูปด้านซ้ายขนาดคงที่ */
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.movie-card.list-mode .movie-info {
    padding: 12px 15px;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ปรับตัวหนังสือใน List View บนมือถือ */
@media (max-width: 576px) {
    .movie-card.list-mode {
        height: 110px; /* ลดความสูงลงเล็กน้อยในมือถือ */
    }
    .movie-card.list-mode .movie-poster {
        width: 85px; /* ลดขนาดรูป */
    }
    .movie-card.list-mode .movie-info {
        padding: 10px;
    }
    .movie-card.list-mode h4 {
        font-size: 1rem; /* ลดขนาดชื่อหนัง */
        margin-bottom: 4px !important;
    }
    .movie-card.list-mode .badge {
        font-size: 0.7rem; /* ลดขนาดป้าย */
    }
}

/* =========================================
   6. OTHER ESSENTIALS (ส่วนอื่นๆ คงเดิม)
   ========================================= */
.page-section { display: none; opacity: 0; transition: opacity 0.3s ease-in-out; }
.page-section.active { display: block; opacity: 1; }
.navbar { background-color: rgba(0,0,0,0.9) !important; backdrop-filter: blur(10px); }
.navbar-brand { color: var(--netflix-red) !important; font-weight: bold; font-size: 1.5rem; cursor: pointer; }
.hero-section { position: relative; height: 70vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.4; mask-image: linear-gradient(to bottom, black 50%, transparent 100%); }
.hero-content { position: relative; z-index: 2; padding-top: 50px; }
.custom-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.custom-modal-box { background: var(--netflix-card); padding: 30px; border-radius: 12px; width: 90%; max-width: 500px; border: 1px solid #333; text-align: center; }
.movie-card { background: var(--netflix-card); border-radius: 8px; overflow: hidden; transition: transform 0.2s; cursor: pointer; height: 100%; border: 1px solid #333; }
.movie-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); border-color: #555; }
.movie-poster { aspect-ratio: 2/3; width: 100%; object-fit: cover; }
.review-hero { height: 400px; position: relative; margin-bottom: -100px; }
.review-hero-img { width: 100%; height: 100%; object-fit: cover; mask-image: linear-gradient(to bottom, black 0%, transparent 100%); opacity: 0.5; }
.content-wrapper { position: relative; z-index: 10; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; background: black; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery-item { aspect-ratio: 16/9; cursor: pointer; overflow: hidden; border-radius: 4px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.gallery-item:hover img { transform: scale(1.1); }
.profile-img { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--netflix-red); object-fit: cover; }
.about-card { background: var(--netflix-card); padding: 25px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #333; }
.hover-danger:hover { color: var(--netflix-red) !important; transform: scale(1.1); }
.transition { transition: all 0.2s ease; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #141414; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--netflix-red); }


/* =========================================
   7. MOBILE HERO ADJUSTMENT (จัดระเบียบ Hero ในมือถือ)
   ========================================= */
   @media (max-width: 576px) {
    .hero-content {
        /* เพิ่มระยะห่างด้านซ้าย-ขวา ให้เนื้อหาไม่ติดขอบจอเกินไป */
        padding-left: 25px !important;
        padding-right: 25px !important;
    }

    /* ปรับขนาดตัวหนังสือ Hero ในมือถือให้พอดีขึ้น (แถมให้ครับ) */
    #hero-title {
        font-size: 2.5rem; /* ลดขนาดหัวข้อไม่ให้ล้น */
    }
}



/* ปรับขนาดตัวหนังสือสำหรับ Grid 3 ช่องในมือถือ */
@media (max-width: 576px) {
    .movie-card h6 {
        font-size: 0.8rem; /* ลดขนาดชื่อเรื่อง */
    }
    .movie-card .small {
        font-size: 0.65rem; /* ลดขนาดปีและดาว */
    }
    .movie-card .p-3 {
        padding: 0.5rem !important; /* ลด padding รอบๆ */
    }
}


/* เพิ่มใน styles.css */

.search-input::placeholder {
    color: #ffffff !important; /* สีขาว */
    opacity: 0.7; /* ความจาง (1 = ขาวทึบ, 0.7 = ขาวโปร่งแสงนิดๆ ดูแพงกว่า) */
}