/* Cấu trúc cơ bản */
:root {
    --bg-color: #121212;
    --bg-surface: #1e1e1e;
    --primary-color: #e50914; /* Màu đỏ mượt chuẩn phim */
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: rgba(18, 18, 18, 0.9);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 1px;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    font-size: 16px;
    font-weight: 500;
}

.search-bar {
    display: flex;
}

.search-bar input {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 12px;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Main Content */
main#app {
    min-height: calc(100vh - 160px);
    padding: 30px 0;
}

.page-title {
    font-size: 28px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Movie List Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.movie-card {
    background-color: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.movie-status {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    background-color: var(--bg-surface);
    color: white;
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Single Movie Page */
.movie-detail-container {
    display: flex;
    gap: 30px;
    background-color: var(--bg-surface);
    padding: 20px;
    border-radius: 10px;
}

.movie-detail-poster {
    width: 250px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.movie-detail-info {
    flex: 1;
}

.movie-detail-title {
    font-size: 32px;
    margin-bottom: 10px;
}

.movie-detail-org {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

.movie-meta-item {
    margin-bottom: 10px;
}

.movie-meta-item strong {
    color: var(--primary-color);
}

.movie-desc {
    margin-top: 20px;
    line-height: 1.8;
}

.watch-btn {
    display: inline-block;
    margin-top: 20px;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
}

.watch-btn:hover {
    background-color: #ff1c28;
    color: white;
}

/* Watch Page */
.player-wrapper {
    background-color: black;
    aspect-ratio: 16/9;
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.player-wrapper h2 {
    color: #555;
}

.episode-list {
    background-color: var(--bg-surface);
    padding: 20px;
    border-radius: 10px;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.episode-btn {
    background-color: #2a2a2a;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.episode-btn:hover, .episode-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Footer */
footer {
    background-color: rgba(18, 18, 18, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: var(--text-secondary);
}

/* Error */
.error-msg {
    text-align: center;
    color: var(--primary-color);
    font-size: 20px;
    margin-top: 50px;
}
