/* =========================================
   CSS TRANG TÌM KIẾM
   ========================================= */
.search-container {
    max-width: 800px;
    margin: 20px auto 40px auto;
    position: relative; /* Để hộp gợi ý neo theo ô tìm kiếm */
}

.search-box {
    display: flex;
    background: #1e1e1e;
    border-radius: 30px;
    border: 2px solid #333;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.search-box:focus-within {
    border-color: #00d2d3;
    box-shadow: 0 0 15px rgba(0, 210, 211, 0.2);
}

.search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 15px 25px;
    color: #fff;
    font-size: 16px;
    outline: none;
}

.search-input::placeholder {
    color: #777;
}

.search-btn {
    background: #00d2d3;
    color: #000;
    border: none;
    padding: 0 35px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #00b8b9;
}

/* Hộp thoại gợi ý thả xuống */
.search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 15px;
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
    display: none; /* Ẩn mặc định */
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

/* Tùy chỉnh thanh cuộn cho hộp gợi ý */
.search-suggestions::-webkit-scrollbar { width: 6px; }
.search-suggestions::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }

.suggestion-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    color: #ccc;
    text-decoration: none;
    transition: all 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #2a2a2a;
    color: #00d2d3;
}

.suggestion-item img {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.suggestion-title {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
}

.suggestion-meta {
    font-size: 12px;
    color: #888;
}

/* --- 3. LƯỚI PHIM & THẺ PHIM (CARD) --- */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.movie-card {
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    color: white;
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid #333;
    display: block;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: #00d2d3; /* Đổi màu viền khi di chuột */
}

/* Nhãn hiển thị số tập ở góc trái poster */
.movie-card .episode-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #00d2d3;
    text-align: center;
    padding: 5px;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
}

.movie-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
  /* Tiêu đề phim tối đa 2 dòng */
.movie-card h3 {
    font-size: 15px;
    padding: 10px;
    text-align: center;
    color: #fca311;
    /* CSS ép chữ cắt đuôi (...) nếu vượt quá 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 45px;
    margin: 0;
}

/* --- 4. PHÂN TRANG (PAGINATION) --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-btn {
    background-color: #222;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid #444;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background-color: #444;
}

.page-btn.active {
    background-color: #00d2d3;
    color: #000;
    font-weight: bold;
    border-color: #00d2d3;
    pointer-events: none; /* Khóa nút đang được chọn */
}  display: block;
}