/* Biến màu và font chữ toàn cục */
:root {
    --primary-color: #0c0c0c;
    --secondary-color: #e50914;
    --text-color: #ffffff;
    --text-color-secondary: #a0a0a0;
    --card-bg-color: #1a1a1a;
    --border-color: #2a2a2a;
    --font-family: 'Inter', sans-serif;
}

/* Reset và cài đặt cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.hidden {
    display: none !important;
}

/* Header */
header {
    background-color: rgba(12, 12, 12, 0.8);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo img {
    height: 75px;
    filter: brightness(1.2);
}

.search-bar {
    flex-grow: 1;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

/* Featured Slider */
.featured-section {
    width: 100%;
    height: 80vh;
    min-height: 450px;
    max-height: 700px;
    position: relative;
}

.featured-slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.featured-movie {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 40px 5%;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
}

.featured-movie::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(12, 12, 12, 1) 10%, rgba(12, 12, 12, 0.7) 30%, rgba(12, 12, 12, 0) 60%);
}

.movie-info {
    position: relative;
    z-index: 2;
    max-width: 50%;
}

.movie-info h3 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.movie-info p {
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.play-button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.play-button:hover {
    background-color: var(--text-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10;
    padding: 0 15px;
    height: 100px;
    transition: background-color 0.3s ease;
}

.slider-nav:hover {
    background-color: rgba(229, 9, 20, 0.7);
}

.slider-nav.prev {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.slider-nav.next {
    right: 0;
    border-radius: 8px 0 0 8px;
}

/* Movie Lists (Categories & Search) */
.movie-list-section {
    padding: 50px 0;
}

.movie-list-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}

.tabs {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-button {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color-secondary);
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-button.active, .tab-button:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-color: var(--secondary-color);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px 20px;
    min-height: 300px;
}

.movie-card {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid transparent;
}

.movie-card:hover {
    transform: scale(1.05);
    z-index: 10;
    border-color: var(--secondary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.movie-card:hover .share-button {
    opacity: 1;
    transform: translateY(0);
}

.movie-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.movie-card-title {
    padding: 15px 10px;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nút chia sẻ trên Card */
.share-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text-color);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.share-button:hover {
    background-color: var(--secondary-color);
}


/* --- Pagination --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background-color: #1f1f1f;
    padding: 8px 15px;
    border-radius: 50px;
    max-width: max-content;
    margin: 40px auto 0;
    border: 1px solid var(--border-color);
}

.pagination-button {
    background-color: #2f2f2f;
    color: var(--text-color);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.pagination-button:hover:not(:disabled) {
    background-color: var(--secondary-color);
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color-secondary);
}

.pagination-page-input {
    width: 45px;
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    text-align: center;
    font-size: 1rem;
    padding: 5px;
    -moz-appearance: textfield; /* Firefox */
}
.pagination-page-input::-webkit-outer-spin-button,
.pagination-page-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- Footer Mới --- */
.site-footer {
    background-color: #000;
    color: var(--text-color-secondary);
    padding: 50px 0 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.footer-sovereignty-statement {
    display: inline-flex;
    align-items: center;
    background-color: #78140f;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.footer-sovereignty-statement img {
    height: 1.2em;
    width: auto;
    margin-right: 10px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.footer-brand .logo img {
    height: 230px;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 1.2rem;
}
.social-links a:hover {
    color: var(--secondary-color);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
}
.footer-nav a:hover {
    color: var(--text-color);
}

.footer-middle {
    margin-bottom: 30px;
}

.footer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-tags a {
    font-size: 0.85rem;
    padding: 5px 10px;
    background-color: var(--card-bg-color);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}
.footer-tags a:hover {
    border-color: var(--secondary-color);
    color: var(--text-color);
}

.footer-description {
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 900px;
}

.footer-bottom {
    text-align: center;
    font-size: 0.85rem;
}

/* --- Nút Lên Đầu Trang --- */
.scroll-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-to-top-btn.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.scroll-to-top-btn:hover {
    opacity: 0.8;
}

/* --- THÊM MỚI: Định dạng cho Popup và Nút chia sẻ trên Player --- */
.share-on-player-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}
.share-on-player-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

#share-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
#share-popup.hidden {
    display: none;
}
.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}
.popup-content {
    position: relative;
    background-color: #252525;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    z-index: 1;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}
.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color-secondary);
    font-size: 2rem;
    cursor: pointer;
}
.popup-content h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}
.popup-content p {
    color: var(--text-color-secondary);
    margin-bottom: 20px;
}
.popup-link-container {
    display: flex;
}
#popup-share-link {
    flex-grow: 1;
    padding: 10px;
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 5px 0 0 5px;
    font-size: 0.9rem;
}
#popup-copy-btn {
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
#popup-copy-btn:hover {
    opacity: 0.8;
}
/* --- KẾT THÚC PHẦN THÊM MỚI --- */

/* Responsive Design */
@media (max-width: 992px) {
    .movie-info { max-width: 70%; }
    .movie-info h3 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .search-bar { max-width: 100%; width: 100%; }
    .featured-section { height: 70vh; }
    .movie-info { max-width: 90%; padding-bottom: 20px; }
    .movie-info h3 { font-size: 2rem; }
    .movie-info p { font-size: 1rem; -webkit-line-clamp: 2; }
    .slider-nav { height: 80px; font-size: 2rem; }
    .movie-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 15px; }
    .movie-card img { height: 220px; }
    .footer-top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .featured-section { height: 60vh; }
    .movie-info h3 { font-size: 1.5rem; }
    .movie-info p { display: none; }
    .play-button { padding: 8px 20px; font-size: 1rem; }
    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .movie-card img { height: auto; }
}