/* ========================================
   VIDEO DISPLAY
   ======================================== */

/* Video Row Layout - Wraps video and sidebar */
.video-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.video-row-inner {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
}

/* Video Container */
.video-container {
    position: relative;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    aspect-ratio: 9 / 16; /* Default for vertical video */
}

/* Override for YouTube videos - set height to 98vh */
.video-container:has(.youtube-player) {
    aspect-ratio: auto !important;
    max-height: 98vh !important;
    height: 98vh !important;
    width: auto !important;
}

/* Vertical video (portrait) */
.video-container:has(.tiktok-video[data-aspect-ratio="portrait"]) {
    aspect-ratio: 9 / 16;
    max-height: 98vh;
    max-width: 100vw;
}

/* Landscape video - adjusted for better viewing */
.video-container:has(.tiktok-video[data-aspect-ratio="landscape"]) {
    aspect-ratio: 16 / 9;
    max-width: 60vw;
    max-height: 98vh;
}

/* Square video - balanced dimensions */
.video-container:has(.tiktok-video[data-aspect-ratio="square"]) {
    aspect-ratio: 1 / 1;
    max-width: 100vw;
    max-height: 98vh;
}

/* YouTube video - set max height to 98vh */
.video-container:has(.youtube-player) {
    max-height: 98vh !important;
}

/* Direct style for YouTube player iframe */
.video-container .youtube-player {
    max-height: 98vh !important;
    height: 98vh !important;
}

/* Video loading placeholder */
.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.video-container::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-spin 1s linear infinite;
}

@keyframes video-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Hide placeholder when video is loaded */
.video-container:has(.tiktok-video.loaded)::before,
.video-container:has(.tiktok-video.loaded)::after {
    opacity: 0;
    pointer-events: none;
}

/* Never show loader for YouTube videos */
.video-container:has(.youtube-player)::before,
.video-container:has(.youtube-player)::after {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Video Top Controls */
.video-top-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    gap: 12px;
}

.volume-control-wrapper {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 0 12px;
    border-radius: 999px;
    transition: all 0.3s ease;
}

.volume-control-wrapper.muted .volume-slider-container {
    width: 0;
    opacity: 0;
}

.volume-control-wrapper:not(.muted) .volume-slider-container {
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.volume-control-wrapper:not(.muted):hover .volume-slider-container {
    width: 80px;
    opacity: 1;
}


.volume-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.volume-toggle-btn:hover {
    transform: scale(1.1);
}

.volume-toggle-btn .icon-svg,
.volume-toggle-btn .icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    color: #fff;
    display: block;
    opacity: 1;
}

.volume-slider-container {
    transition: all 0.3s ease;
    overflow: hidden;
    padding-bottom: 10px;
}

.volume-slider {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 8px;
    background: var(--puna-bg);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 8px;
    height: 8px;
    background: var(--puna-bg);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Video Options Menu */
.video-options-menu {
    display: none !important;
}


.options-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.options-item:hover {
    background-color: var(--puna-muted);
}


.options-item .icon-svg,
.options-item .icon-img {
    filter: none;
    color: currentColor;
    transition: filter 0.2s ease, color 0.2s ease;
}

.options-item span {
    flex: 1;
    color: var(--puna-text);
    font-weight: 500;
    transition: color 0.2s ease;
}

.options-item:hover .icon-svg,
.options-item:hover .icon-img {
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
    color: var(--puna-primary);
}

.options-item:hover span {
    color: var(--puna-primary);
}

.options-item.delete-video-item {
    color: #ff3040;
}


.options-item.delete-video-item:hover {
    background-color: rgba(255, 48, 64, 0.1);
}

.tiktok-video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* YouTube Player (iframe) - same style as .tiktok-video */
.youtube-player {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none;
    display: block;
    border-radius: 12px;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* Hide YouTube controls overlay with CSS - target iframe content */
.video-container:has(.youtube-player) iframe {
    pointer-events: auto;
}

/* YouTube player in video container - set specific height */
.video-container .youtube-player,
.youtube-video-98vh {
    max-height: 98vh !important;
    height: 98vh !important;
    width: auto !important;
    aspect-ratio: 9 / 16 !important;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

/* Container with YouTube video */
.video-container:has(.youtube-video-98vh) {
    max-height: 98vh !important;
    height: 98vh !important;
}

/* Ensure video overlay and sidebar are above YouTube iframe */
.video-container .video-overlay {
    z-index: 150;
    pointer-events: none;
}

.video-container .video-overlay * {
    pointer-events: auto;
}


/* Video Sidebar - Desktop: positioned next to video */
.video-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 200;
    pointer-events: auto;
}

/* Overlay content */
.video-container .video-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 16px;
    color: var(--puna-bg);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
    display: block;
    z-index: 10;
}

.video-container .video-details {
    max-width: 100%;
    position: relative;
    z-index: 11;
}

.video-container .video-details h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
}

.video-container .video-caption-wrapper {
    position: relative;
    margin: 0 0 8px 0;
}

.video-container .video-caption {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: -webkit-line-clamp 0.3s ease;
}

.video-container .video-caption.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.video-container .video-caption-toggle {
    background: none;
    border: none;
    color: var(--puna-bg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    transition: opacity 0.2s ease;
}

.video-container .video-caption-toggle:hover {
    opacity: 0.8;
}

.video-container .video-tags .tag {
    color: var(--puna-bg);
    font-weight: bold;
    text-decoration: none;
    margin-right: 6px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--puna-primary);
    object-fit: contain;
    background: var(--puna-bg);
    padding: 4px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 201;
    pointer-events: auto;
}

.action-icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--puna-muted);
    color: var(--puna-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
}

.action-item .icon-svg,
.action-item .icon-img {
    width: 24px;
    height: 24px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.action-item:hover .icon-svg,
.action-item:hover .icon-img {
    opacity: 1;
}

/* Filter rules moved to Liked/Saved State sections below - no duplication */

/* Play Icon in Video Cards */
.play-icon .icon-svg,
.play-icon .icon-img {
    width: 48px;
    height: 48px;
    color: #fff;
}

/* Video Views Overlay Icon */
.video-views-overlay .icon-svg,
.video-views-overlay .icon-img {
    width: 14px;
    height: 14px;
    color: #fff;
}

.action-item:hover .action-icon-wrapper {
    transform: scale(1.05);
}

/* Liked State */
.action-item.liked .action-icon-wrapper {
    background: color-mix(in srgb, var(--puna-primary) 12%, transparent);
}

.action-item.liked .icon-svg,
.action-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%);
}

.action-item.liked .count {
    color: var(--puna-primary);
}

.action-item.saved .action-icon-wrapper {
    background: color-mix(in srgb, var(--puna-secondary) 12%, transparent);
}

.action-item.saved .count {
    color: var(--puna-secondary);
}

.action-item.saved .icon-svg,
.action-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%);
}

/* Like animation */
.action-item.liking {
    animation: like-pulse 0.3s ease;
}

/* Save animation */
.action-item.saving {
    animation: like-pulse 0.3s ease;
}

@keyframes like-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.action-item span {
    color: var(--puna-text);
    font-size: 16px;
}

.action-item .count {
    font-size: 12px;
    font-weight: 600;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none !important;
    align-items: center;
    justify-content: center;
}

.share-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.share-modal-content {
    position: relative;
    background: var(--puna-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 350px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(22, 24, 35, 0.12);
}

.share-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--puna-text);
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: var(--puna-text);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.share-modal-close:hover {
    opacity: 0.7;
}

.share-modal-close .icon-svg,
.share-modal-close .icon-img {
    width: 18px;
    height: 18px;
}

.share-modal-body {
    padding: 20px 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.share-options-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    justify-items: center;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
    min-width: 80px;
}

.share-option:hover {
    transform: translateY(-2px);
}

.share-option:active {
    transform: translateY(0);
}

.share-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.share-option-icon .icon-svg,
.share-option-icon img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
    transition: filter 0.2s ease;
}

/* Share option icon colors */
.share-option[data-share="facebook"] .share-option-icon {
    background: #1877F2;
}

.share-option[data-share="zalo"] .share-option-icon {
    background: #0068FF;
}

.share-option[data-share="copy"] .share-option-icon {
    background: #007AFF;
}

.share-option[data-share="instagram"] .share-option-icon {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-option[data-share="email"] .share-option-icon {
    background: #EA4335;
}

.share-option[data-share="telegram"] .share-option-icon {
    background: #0088cc;
}

.share-option:hover .share-option-icon {
    transform: scale(1.1);
}

.share-option-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--puna-text);
    text-align: center;
    white-space: nowrap;
}

/* ========================================
   EMPTY STATE (for video feed pages)
   ======================================== */

.main-content .taxonomy-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 60px 20px;
    text-align: center;
    width: 100%;
}

.main-content .taxonomy-empty-state .icon-svg,
.main-content .taxonomy-empty-state .icon-img {
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
    color: #666;
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(38%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(95%);
}

.main-content .taxonomy-empty-state h3 {
    color: #666;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.main-content .taxonomy-empty-state p {
    color: #999;
    font-size: 16px;
    margin: 0 0 24px 0;
    line-height: 1.5;
    max-width: 500px;
}

.main-content .taxonomy-empty-state .empty-state-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--puna-primary);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.main-content .taxonomy-empty-state .empty-state-btn:hover {
    background: color-mix(in srgb, var(--puna-primary) 90%, black);
    transform: translateY(-1px);
}

.main-content .taxonomy-empty-state .empty-state-btn:active {
    transform: translateY(0);
}