/* ============================================
   VIDEO WATCH PAGE - 2 COLUMN LAYOUT
   ============================================ */

/* Hide sidebar on video watch page - but allow it on mobile/tablet when toggled */
body.single .tiktok-app .sidebar {
    display: none;
}


body.single .tiktok-app .main-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Video Watch Page Container */
.video-watch-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--puna-bg);
    display: flex;
    flex-direction: column;
}

/* Back Button - High z-index to ensure it's clickable above all elements */
.video-watch-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10001 !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: transparent;
    pointer-events: auto !important;
}

.video-watch-back-btn:hover {
    transform: scale(1.1);
    background: transparent;
}

/* Hide fixed-top-container when video watch page exists */
.video-watch-page ~ * .fixed-top-container,
body:has(.video-watch-page) .fixed-top-container {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Video Watch Icons */
.video-watch-back-btn .icon-svg,
.video-watch-back-btn .icon-img {
    width: 20px;
    height: 20px;
    color: #fff;
    filter: brightness(0) invert(1);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Video Info More Button Icons */
.video-info-more-btn .icon-svg,
.video-info-more-btn .icon-img {
    width: 18px;
    height: 18px;
    color: inherit;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.video-info-more-btn:hover .icon-svg,
.video-info-more-btn:active .icon-svg {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

.video-watch-back-btn:hover .icon-svg,
.video-watch-back-btn:active .icon-svg {
    opacity: 1;
    filter: brightness(0) invert(1);
}

/* Share Modal Icons - styles inherited from video-feed.css */

.share-option-icon .icon-svg,
.share-option-icon .icon-img {
    width: 24px;
    height: 24px;
    color: inherit;
    transition: opacity 0.2s ease, filter 0.2s ease;
    filter: brightness(0) invert(1);
}

.share-option:hover .share-option-icon .icon-svg,
.share-option:active .share-option-icon .icon-svg {
    opacity: 1;
    filter: brightness(0) invert(1);
}

/* Options Item Icons */
.options-item .icon-svg,
.options-item .icon-img {
    width: 16px;
    height: 16px;
    color: inherit;
    margin-right: 8px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.options-item:hover .icon-svg,
.options-item:active .icon-svg {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

.options-item:hover span {
    color: var(--puna-primary);
}
.video-info-more-btn:hover {
    color: var(--puna-primary);
}

.video-info-more-btn:hover .icon-svg,
.video-info-more-btn:active .icon-svg {
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

/* Volume Toggle Button Icons */
.volume-toggle-btn .icon-svg,
.volume-toggle-btn .icon-img {
    width: 24px;
    height: 24px;
    color: #fff;
    filter: brightness(0) invert(1);
    transition: opacity 0.2s ease, filter 0.2s ease;
    display: block;
    opacity: 1;
}

.volume-toggle-btn:hover .icon-svg,
.volume-toggle-btn:active .icon-svg {
    opacity: 1;
    filter: brightness(0) invert(1);
}

/* Video Navigation Buttons */
.video-nav-btn .icon-svg,
.video-nav-btn .icon-img {
    width: 20px;
    height: 20px;
    color: inherit;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.video-nav-btn:hover .icon-svg,
.video-nav-btn:active .icon-svg {
    opacity: 1;
}

/* Main Container: 2 Columns */
.video-watch-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    gap: 0;
}

/* Left Column: Video Player (75%) */
.video-watch-player {
    flex: 0 0 75%;
    width: 75%;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    z-index: 1;
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.video-player-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.5s ease;
    pointer-events: none;
    animation: video-watch-spin 1s linear infinite;
}

@keyframes video-watch-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.video-player-wrapper:has(.tiktok-video.loaded)::after {
    opacity: 0;
    pointer-events: none;
}

/* Never show loader for YouTube videos */
.video-player-wrapper:has(.youtube-player)::after {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Video shares class with index page */
.video-watch-player .tiktok-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100vh;
}

/* YouTube Player (iframe) - same style as .tiktok-video */
.video-watch-player .youtube-player {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100vh;
    border: none;
    display: block;
    position: relative;
    z-index: 1;
}

/* Video Player Controls - Fix z-index to prevent overlap */
.video-watch-player .video-top-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

/* Only show options menu button at top right */
.video-watch-player .video-top-controls .video-options-menu {
    display: flex;
}

/* Hide volume control in top controls */
.video-watch-player .video-top-controls .volume-control-wrapper {
    display: none;
}

.video-player-bottom-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

/* Volume control at bottom right */
.video-watch-player .video-player-bottom-actions .volume-control-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 0 12px;
    border-radius: 999px;
    transition: all 0.3s ease;
}

.video-watch-player .video-player-bottom-actions .volume-control-wrapper.muted .volume-slider-container {
    width: 0;
    opacity: 0;
}

.video-watch-player .video-player-bottom-actions .volume-control-wrapper:not(.muted) .volume-slider-container {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-watch-player .video-player-bottom-actions .volume-control-wrapper:not(.muted):hover .volume-slider-container {
    width: 80px;
    opacity: 1;
}


.video-watch-player .video-player-bottom-actions .volume-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 8px;
}

.video-watch-player .video-player-bottom-actions .volume-toggle-btn:hover {
    transform: scale(1.1);
}

.video-watch-player .video-player-bottom-actions .volume-slider-container {
    transition: all 0.3s ease;
    overflow: hidden;
    padding-bottom: 10px;
}

.video-watch-player .video-player-bottom-actions .volume-slider {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.video-player-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--puna-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-player-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Right Column: Info & Comments (25%) */
.video-watch-info {
    flex: 0 0 25%;
    width: 25%;
    display: flex;
    flex-direction: column;
    background: var(--puna-bg);
    border-left: 1px solid var(--puna-muted);
    max-height: 100vh;
    overflow-y: auto;
}

/* Video Info Section */
.video-info-section {
    padding: 24px 24px 0 24px ;
}

/* Author Info */
.video-info-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.author-info-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    color: var(--puna-text);
}

.author-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    border: 2px solid var(--puna-primary);
    background: var(--puna-bg);
    padding: 4px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--puna-text);
    margin: 0;
    line-height: 1.3;
}

.author-username {
    font-size: 14px;
    color: var(--puna-primary);
}

.follow-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--puna-primary) 0%, color-mix(in srgb, var(--puna-primary) 80%, white) 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.follow-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.video-info-more-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--puna-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-info-more-btn .icon-svg,
.video-info-more-btn .icon-img {
    color: var(--puna-text);
}

.video-info-more-btn:hover {
    background: var(--puna-muted);
}

.video-info-more-menu {
    position: relative;
}

.video-info-more-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--puna-bg);
    border: 1px solid var(--puna-muted);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    display: none !important;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.video-info-more-dropdown.show {
    display: block !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.video-info-more-dropdown .options-item {
    padding: 12px 16px; /* Override padding from base .options-item (12px 20px) */
    color: var(--puna-text); /* Explicit color for clarity */
}


.video-info-more-dropdown .options-item.delete-video-item {
    color: #ff3040;
}

.video-info-more-dropdown .options-item.delete-video-item:hover {
    background: rgba(255, 48, 64, 0.1);
}

/* Video Caption */
.video-info-caption {
    margin-bottom: 16px;
}

.video-info-caption .video-caption-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.video-caption-content {
    font-size: 16px;
    line-height: 1.5;
    color: var(--puna-text);
    margin-bottom: 8px;
    word-wrap: break-word;
}

.video-caption-content .caption-text {
    color: var(--puna-text);
    margin-right: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: -webkit-line-clamp 0.3s ease;
}

.video-info-caption .video-caption-content .caption-text.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.video-info-caption .video-caption-toggle {
    background: none;
    border: none;
    color: var(--puna-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    transition: opacity 0.2s ease;
}

.video-info-caption .video-caption-toggle:hover {
    opacity: 0.7;
}

.video-caption-content .tag {
    color: #161823;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    margin-left: 4px;
    transition: opacity 0.2s ease;
    display: inline;
}

body.theme-dark .video-caption-content .tag {
    color: #fff;
}

.video-caption-content .tag:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.video-tags {
    display: inline;
}

.video-tags .tag {
    color: #161823;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    margin-left: 4px;
    transition: opacity 0.2s ease;
    display: inline;
}

.video-tags .tag:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.video-post-date {
    font-size: 14px;
    color: rgba(22, 24, 35, 0.5);
    margin-top: 4px;
}

/* Interaction Stats */
.video-interaction-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: rgba(22, 24, 35, 0.04);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    margin: 0 16px 20px;
}

.interaction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--puna-text);
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.interaction-item:hover {
    transform: translateY(-1px);
}

.interaction-icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(22, 24, 35, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.interaction-item .icon-svg,
.interaction-item .icon-img {
    width: 24px;
    height: 24px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.interaction-item:hover .interaction-icon-wrapper {
    background: rgba(22, 24, 35, 0.15);
}

.interaction-item:hover .icon-svg,
.interaction-item:hover .icon-img {
    opacity: 1;
}

.interaction-item.liked .icon-svg,
.interaction-item.liked .icon-img {
    color: var(--puna-primary);
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

.interaction-item.liked .interaction-icon-wrapper {
    background: color-mix(in srgb, var(--puna-primary) 12%, transparent);
}

.interaction-item.saved .interaction-icon-wrapper {
    background: color-mix(in srgb, var(--puna-secondary) 12%, transparent);
}

.interaction-item.saved .icon-svg,
.interaction-item.saved .icon-img {
    color: var(--puna-secondary);
    filter: brightness(0) saturate(100%) invert(77%) sepia(100%) saturate(1352%) hue-rotate(1deg) brightness(103%) contrast(101%);
}

.stat-count {
    font-size: 12px;
    color: var(--puna-text);
    font-weight: 600;
}

.interaction-item.liked .stat-count {
    color: var(--puna-primary);
}

.interaction-item.saved .stat-count {
    color: var(--puna-secondary);
}


/* Share Options */
.video-share-options {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--puna-muted);
    flex-wrap: wrap;
}

.share-option-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--puna-muted);
    border: none;
    color: var(--puna-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-option-btn .icon-svg,
.share-option-btn .icon-img {
    color: var(--puna-text);
}

.share-option-btn:hover {
    background: linear-gradient(135deg, var(--puna-primary) 0%, color-mix(in srgb, var(--puna-primary) 80%, white) 100%);
    color: #fff;
    transform: scale(1.1);
}

.share-option-btn:hover .icon-svg,
.share-option-btn:hover .icon-img {
    color: #fff;
}

/* Comments Section */
.video-comments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Comments Tabs */
.video-comments-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--puna-muted);
    padding: 0 24px;
}

.comments-tab {
    padding: 16px 24px;
    background: transparent;
    border: none;
    color: var(--puna-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.comments-tab.active {
    color: var(--puna-text);
    border-bottom-color: var(--puna-primary);
}

.comments-tab:hover {
    color: var(--puna-text);
}

.comments-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    flex-direction: column;
}

.comments-tab-content.active {
    display: flex;
}

/* Video Watch Comments */
.video-watch-comments {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.video-watch-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.video-watch-comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}

.video-watch-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.video-watch-comment-content {
    flex: 1;
    min-width: 0;
}

.video-watch-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

/* Override for video watch page to ensure correct text color and display */
.video-watch-comments .comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    min-height: 200px;
}

.video-watch-comments .comment-author,
.video-watch-comments .comment-text,
.video-watch-comments .comment-date,
.video-watch-comments .reply-link {
    color: var(--puna-text);
}

/* .video-watch-comments .comment-likes rules removed - using base .comment-likes rules from comments.css */

.video-watch-comments .comment-input {
    color: var(--puna-text);
}

.video-watch-comments .comment-input::placeholder {
    color: rgba(17, 24, 35, 0.5);
}


/* Comment input container cho video watch */
.video-watch-comments .comment-input-container {
    padding: 16px 24px;
    border-top: 1px solid var(--puna-muted);
    background: var(--puna-bg);
}

/* Creator Videos Tab */
.creator-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 24px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar styling for creator videos grid */
.creator-videos-grid::-webkit-scrollbar {
    width: 6px;
}

.creator-videos-grid::-webkit-scrollbar-track {
    background: var(--puna-muted);
    border-radius: 3px;
}

.creator-videos-grid::-webkit-scrollbar-thumb {
    background: var(--puna-primary);
    border-radius: 3px;
}

.creator-videos-grid::-webkit-scrollbar-thumb:hover {
    background: var(--puna-primary);
    opacity: 0.8;
}

.creator-video-item {
    text-decoration: none;
    color: var(--puna-text);
    transition: transform 0.3s ease;
}

.creator-video-item:hover {
    transform: scale(1.05);
}

.creator-video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    overflow: hidden;
    background: var(--puna-muted);
}

.creator-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.creator-video-overlay {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
}

.creator-video-views {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
}

.creator-video-views .icon-svg,
.creator-video-views .icon-img {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
}

.creator-video-views span {
    font-size: 12px;
    color: #fff;
}


.no-creator-videos {
    padding: 40px 24px;
    text-align: center;
    color: var(--puna-primary);
}
