/* watch-page.css - Halim Style */
.watch-page-main {
    background: #0a0a0a;
    color: #fff;
    min-height: 100vh;
}

/* Player Zone */
.player-zone {
    position: relative;
    background: #000;
    margin-bottom: 0;
}

.player-aspect-ratio-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

#mixi-player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vjs-container {
    width: 100%;
    height: 100%;
}

/* VideoJS Customization */
.vjs-default-skin {
    color: #fff;
}

.vjs-default-skin .vjs-control-bar {
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    height: 60px;
    padding: 0 20px;
}

.vjs-default-skin .vjs-play-progress,
.vjs-default-skin .vjs-volume-level {
    background: #e50914;
}

.vjs-default-skin .vjs-big-play-button {
    background: rgba(229, 9, 20, 0.8);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    line-height: 80px;
    margin: -40px 0 0 -40px;
    font-size: 40px;
}

.vjs-default-skin .vjs-big-play-button:hover {
    background: #e50914;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Ambient Canvas */
#ambient-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

/* Info Zone */
.info-zone-wrapper {
    background: linear-gradient(transparent, #1a1a1a);
    padding: 30px 0;
}

.info-zone {
    max-width: 100%;
    margin: 0 auto;
}

.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.episode-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    flex: 1;
    min-width: 300px;
}

.episode-nav {
    display: flex;
    gap: 10px;
}

.episode-nav-btn, .movie-interaction-btn {
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    gap: 5px;
    font-size: 14px;
    background: transparent !important;
    margin-bottom: 0px !important;
    text-transform: capitalize !important;
    
}
.episode-nav-btn > i {
    margin: 0px 5px;
    margin-top: 2px !important;
}
.button i, button i {
    top: 0px !important;
}
.episode-nav-btn:hover:not(:disabled) {
    background: rgba(229, 9, 20, 0.8);
    border-color: #e50914;
    transform: translateY(-2px);
}

.episode-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Interactions Bar */
.movie-interactions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.interactions-left {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 14px;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star {
    color: #666;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s ease;
}

.star:hover,
.star.hover {
    color: #ffc107;
}

.star.active {
    color: #ffc107;
}

.rating-count {
    color: #ccc;
    font-size: 14px;
}

.interactions-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.movie-interaction-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.movie-interaction-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.movie-interaction-btn.voted {
    background: rgba(229, 9, 20, 0.2);
    border-color: #e50914;
    color: #e50914;
}

#light-toggle-btn {
    background: rgba(255,193,7,0.1);
    border: 1px solid rgba(255,193,7,0.3);
    color: #ffc107;
}

#light-toggle-btn:hover {
    background: rgba(255,193,7,0.2);
}

/* Stream Options */
.stream-options {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.server-list,
.stream-type-list {
    margin-bottom: 15px;
}

.server-list strong,
.stream-type-list strong {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-size: 16px;
}

.server-btn,
.stream-type-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px 5px 0;
    font-size: 14px;
}

.server-btn:hover,
.stream-type-btn:hover {
    background: rgba(255,255,255,0.2);
}

.server-btn.active,
.stream-type-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

/* Episode List Section */
.movie-main-content {
    padding: 50px 0;
    background: #1a1a1a;
}

.server-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.server-tab-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.server-tab-btn:hover {
    background: rgba(255,255,255,0.2);
}

.server-tab-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    display: none;
}

.episode-grid.active {
    display: grid;
}

.episode-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.episode-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    border-color: rgba(229, 9, 20, 0.5);
}

.episode-card.current {
    background: rgba(229, 9, 20, 0.2);
    border-color: #e50914;
}

.episode-number {
    font-weight: 500;
    font-size: 14px;
}

.current-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e50914;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Content & Comments */
.content-comment-wrapper {
    padding: 50px 0;
    background: #0a0a0a;
}

.movie-extra-info {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.movie-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meta-item strong {
    color: #ccc;
    font-size: 14px;
}

.meta-item span {
    color: #fff;
    font-size: 15px;
}

.meta-item.full-width {
    grid-column: 1 / -1;
}

.movie-full-content h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 18px;
}

.movie-full-content {
    color: #ccc;
    line-height: 1.6;
}

/* Related Movies */
.related-movies-sidebar {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 25px;
    position: sticky;
    top: 20px;
}

.related-movies-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.related-movie-card {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-movie-card:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.1);
}

.related-movie-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-movie-poster {
    position: relative;
    overflow: hidden;
}

.related-movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-movie-card:hover .related-movie-poster img {
    transform: scale(1.05);
}

.related-movie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-movie-card:hover .related-movie-overlay {
    opacity: 1;
}

.play-icon {
    color: #fff;
    font-size: 24px;
}

.related-movie-info {
    padding: 12px;
}

.related-movie-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 5px 0;
    color: #fff;
    line-height: 1.3;
}

.related-movie-year {
    font-size: 12px;
    color: #ccc;
}

/* Error States */
.player-error-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0,0,0,0.8);
    padding: 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-message {
    font-size: 16px;
    margin-bottom: 20px;
    color: #fff;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.retry-btn,
.switch-source-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.retry-btn {
    background: #e50914;
    color: #fff;
}

.switch-source-btn {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.retry-btn:hover {
    background: #b8070f;
}

.switch-source-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Light Off Mode */
.lights-off {
    background: #000;
}

.lights-off .player-zone {
    background: #000;
}

.lights-off .info-zone-wrapper,
.lights-off .movie-main-content,
.lights-off .content-comment-wrapper {
    background: #000;
}

.light-off-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9998;
    display: none;
}

.lights-off .light-off-overlay {
    display: block;
}

.lights-off .player-zone {
    z-index: 9999;
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .episode-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .episode-nav {
        width: 100%;
        justify-content: center;
    }
    
    .movie-interactions-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .interactions-left,
    .interactions-right {
        width: 100%;
        justify-content: center;
    }
    
    .episode-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .movie-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .vjs-default-skin .vjs-control-bar {
        height: 50px;
        padding: 0 10px;
    }
}

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

.vjs-loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.row.container {
    max-width: 95%;
    margin: auto;
}

/* --- RELATED SIDEBAR VERTICAL SLIDER --- */
/* --- RELATED SIDEBAR VERTICAL SLIDER (FIXED) --- */
.related-movies-sidebar {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    /* Đảm bảo sidebar không bị tràn */
    overflow: hidden; 
}

.related-swiper-vertical {
    width: 100%;
    height: 600px; /* Chiều cao cố định của khung nhìn */
    padding-right: 5px; 
}

.related-slide-item {
    /* QUAN TRỌNG: Ghi đè style inline của Swiper */
    height: auto !important; 
    margin-bottom: 15px;
    /* Đảm bảo không bị co giãn méo mó */
    flex-shrink: 0 !important; 
    display: block !important;
}

.related-movie-link {
    display: flex; /* Layout ngang: Ảnh trái - Chữ phải */
    gap: 15px;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.3s;
}

.related-movie-link:hover {
    background: #2a2a2a;
}

.related-movie-poster {
    width: 90px;
    height: 135px; /* Tỉ lệ 2:3 */
    flex-shrink: 0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.related-movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.related-movie-link:hover .related-overlay {
    opacity: 1;
}

.related-movie-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-movie-title {
    color: #fff;
    font-size: 15px;
    margin: 0 0 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Cắt dòng nếu tên dài */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-movie-link:hover .related-movie-title {
    color: #00C4FF;
}

.related-meta {
    font-size: 12px;
    color: #aaa;
}

.related-meta .quality {
    background: #E50914;
    color: #fff;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 5px;
    font-weight: bold;
}

/* Custom Scrollbar Swiper */
.swiper-scrollbar-drag {
    background: #555;
}
.swiper-wrapper {
    padding-bottom: 20px;
    overflow: scroll;
    height: 100%;
}