/* PHIM.CSS - Styling cho trang chi tiết phim */

/* Tab Navigation */
.tab-btn {
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #3b82f6;
}

.tab-btn:not(.active):hover {
    color: #fff;
    border-bottom-color: #64748b;
}

/* Tab Content */
.tab-content.hidden {
    display: none;
}

/* Prose styles cho nội dung */
.prose {
    line-height: 1.75;
}

.prose p {
    margin-bottom: 1.25em;
}

.prose strong {
    font-weight: 600;
    color: #f1f5f9;
}

/* Danh sách tập phim */
.tap-phim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
}

.tap-phim-item {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid #334155;
    background-color: rgba(15, 23, 42, 0.5);
    color: #fff;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tap-phim-item:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.tap-episode-btn {
    border: 1px solid #1e293b;
    background-color: #333366;
    color: #e2e8f0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tap-episode-btn:hover {
    border-color: #3b82f6;
    background-color: #1b2e4d;
    color: #dbeafe;
}

.tap-episode-btn:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.35);
    outline-offset: 2px;
}

.tap-episode-btn--current,
.tap-episode-btn.tap-page-btn.active {
    border-color: #3b82f6;
    background-color: #1d4ed8;
    color: #f8fafc;
}

.tap-episode-btn--current:hover,
.tap-episode-btn.tap-page-btn.active:hover {
    background-color: #2563eb;
}

/* Trailer embed */
.trailer-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #1e293b;
}

.trailer-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Movie card grid */
.phim-lien-quan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .phim-lien-quan-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .phim-lien-quan-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Comments section */
.comment-box {
    border-radius: 1rem;
    border: 1px solid #1e293b;
    background-color: rgba(15, 23, 42, 0.5);
    padding: 1.5rem;
}

.comment-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #334155;
    background-color: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    transition: all 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Episode pagination buttons */
.tap-page-btn {
    transition: all 0.3s ease;
}

.tap-page-btn.active {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.tap-page-btn:hover {
    border-color: #3b82f6;
    color: #60a5fa;
}

/* Chức năng xem thêm cho các mục thông tin phim */
.info-content-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.info-content-label {
    flex: 0 0 8rem;
    font-weight: 600;
    color: #fff;
}

.info-content-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.info-content {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #cbd5f5;
}

.info-content a {
    color: #3b82f6;
    transition: color 0.2s ease;
}

.info-content a:hover {
    color: #60a5fa;
}

.info-content .info-chip {
    display: inline-flex;
    margin: 0 0.35rem 0.35rem 0;
}

/* Trên máy tính: giới hạn 1 dòng */
@media (min-width: 1024px) {
    .info-content.collapsed {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
}

/* Trên thiết bị nhỏ hơn: giới hạn 2 dòng */
@media (max-width: 1023px) {
    .info-content.collapsed {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

.info-content.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
}

@media (max-width: 640px) {
    .info-content-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .info-content-label {
        flex: none;
        width: auto;
    }

    .info-content-wrapper {
        width: 100%;
    }
}

.btn-toggle-content {
    flex-shrink: 0;
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    color: #3b82f6;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.btn-toggle-content:hover {
    color: #60a5fa;
    background-color: rgba(59, 130, 246, 0.12);
}

.btn-toggle-content svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.btn-toggle-content.expanded svg {
    transform: rotate(180deg);
}

.btn-toggle-content.is-visible {
    display: inline-flex;
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .tap-page-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}
