/* Videos Feed - TikTok Style with Header and Side Margins */

/* Container uses standard page width with margins */
.videos-snap-container {
    max-width: var(--container-width, 640px);
    margin: 0 auto;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    position: relative;
    overflow: hidden;
}

/* Snap scroll container */
.videos-snap-scroll {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.videos-snap-scroll::-webkit-scrollbar {
    display: none;
}

/* Each video takes full viewport height minus header */
.video-snap-slide {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    min-height: calc(100vh - 56px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 0;
    overflow: hidden;
}

/* Video player fills the slide */
.video-snap-player {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-snap-player .video-player-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.video-snap-player .video-player-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Author Overlay - Inline Start Side */
.video-snap-author {
    position: absolute;
    bottom: 80px;
    inset-inline-start: 16px;
    inset-inline-end: 80px;
    z-index: 30;
    color: white;
}

.video-snap-author-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    margin-bottom: 8px;
}

.video-snap-name {
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.video-snap-caption {
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin: 0;
    transition: all 0.2s ease;
}

.video-snap-caption.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-snap-see-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.video-snap-see-more i {
    width: 16px;
    height: 16px;
}

.video-snap-see-more:hover {
    color: white;
}

/* Actions - Inline End Side */
.video-snap-actions {
    position: absolute;
    inset-inline-end: 12px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 30;
}

.video-snap-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.video-snap-action:hover {
    transform: scale(1.1);
}

.video-snap-action svg,
.video-snap-action i {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.video-snap-action span {
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.video-snap-action.is-liked svg {
    fill: #fff;
    stroke: #fff;
}

/* Comments Panel - Slides up from bottom */
.video-comments-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(0);
}

/* Animation classes for Alpine.js transitions */
.translate-y-full {
    transform: translateY(100%) !important;
}

.translate-y-0 {
    transform: translateY(0) !important;
}

.video-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.video-comments-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 16px 16px 16px;
}

/* Override comments section styles for video context */
.video-comments-content .comments-section {
    display: block !important;
    background: transparent;
    padding: 0;
    overflow-x: hidden;
}

/* Override pcard__stat for vertical video layout */
.video-snap-actions .pcard__stat {
    flex-direction: column;
    gap: 4px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.video-snap-actions .pcard__stat svg,
.video-snap-actions .pcard__stat i {
    width: 28px;
    height: 28px;
}

.video-snap-actions .pcard__stat span {
    font-size: 12px;
    font-weight: 600;
}

/* Override options menu positioning for video context */
.video-snap-options {
    position: relative;
}

.video-snap-options .pcard__options-menu {
    /* Desktop: position to the inline-start side instead of below */
    position: absolute;
    inset-inline-end: 100%;
    bottom: 0;
    margin-inline-end: 8px;
    min-width: 180px;
}

/* Mobile: full-width bottom sheet */
@media (max-width: 639px) {
    .video-snap-options .pcard__options-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin-inline-end: 0;
        border-radius: 16px 16px 0 0;
    }
}

/* Empty state */
.video-snap-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loader */
.video-snap-loader {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .videos-snap-container {
        height: calc(100vh - 48px);
        max-width: 100%;
        padding: 0 8px;
    }

    .video-snap-author {
        bottom: 70px;
        inset-inline-start: 12px;
        inset-inline-end: 70px;
    }

    .video-snap-actions {
        inset-inline-end: 10px;
        bottom: 80px;
        gap: 16px;
    }

    .video-snap-action svg,
    .video-snap-action i {
        width: 26px;
        height: 26px;
    }

    .video-comments-panel {
        height: 70%;
    }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .video-snap-author {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .video-snap-actions {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }

    .video-comments-panel {
        padding-bottom: env(safe-area-inset-bottom);
    }
}