/* Portfolio Filter Tabs */
.portfolio-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-filter-tabs.in-view {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 24px;
    border-radius: 50px;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.portfolio-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.portfolio-tab.active {
    background: rgba(235, 89, 57, 0.15);
    color: #eb5939;
    border-color: rgba(235, 89, 57, 0.4);
    box-shadow: 0 0 15px rgba(235, 89, 57, 0.2);
}

/* Override parent overflow only for the video bento section */
.video,
.videoPlayer {
    overflow: visible !important;
}

/* Bento Layout - Unlimited Scroll Design */
.video_bento_grid {
    display: flex;
    gap: 15px;
    padding: 0 15px;
    width: 100%;
    max-width: 1728px;
    margin: 0 auto;
    position: relative;
    align-items: flex-start;
    /* Ensures main stage can stick without stretching */

    /* Scroll Animation */
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.video_bento_grid.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Main Stage */
.bento_main_stage {
    flex: 1.5;
    /* Takes up 60% of the width */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    aspect-ratio: 16/9;
    z-index: 20;
}

.bento_main_stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar — Endless Scroll */
.bento_sidebar {
    flex: 1;
    /* Takes up 40% of the width */
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 videos per row */
    gap: 10px;
    padding-bottom: 50px;
}

/* Base item styling for unlimited items */
.bento_item {
    aspect-ratio: 16/9;
    /* All items are standard rectangles */
    grid-column: span 1;
}

/* Optional: Make the first item feature wide if you want, or just leave as standard */
.bento_sidebar .bento_item.pos-1 {
    grid-column: 1 / 3;
    /* First one spans full width */
    aspect-ratio: 21/9;
    /* Cinematic wide crop for the featured thumbnail */
}

/* Player Overlay */
.bento_player_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.bento_main_stage.is-playing .bento_player_overlay {
    opacity: 0;
    background: transparent;
}

.bento_main_stage.is-playing:hover .bento_player_overlay {
    opacity: 1;
}

/* Play Button */
.bento_play_center_btn {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.bento_play_center_btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.bento_play_center_btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* Controls Bar */
.bento_controls_bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.bento_main_stage:hover .bento_controls_bar {
    opacity: 1;
    transform: translateY(0);
}

.bento_progress_container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-bottom: 12px;
    cursor: pointer;
    overflow: hidden;
}

.bento_progress_bar {
    width: 0%;
    height: 100%;
    background: #eb5939;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.bento_controls_bottom {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.bento_mute_btn,
.bento_fullscreen_btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.bento_mute_btn:hover,
.bento_fullscreen_btn:hover {
    opacity: 1;
}

.bento_mute_btn svg,
.bento_fullscreen_btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Bento Items */
.bento_item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #111;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.8s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s, box-shadow 0.4s;
}

.video_bento_grid.in-view .bento_sidebar .bento_item {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger */
.video_bento_grid.in-view .bento_sidebar .bento_item.pos-1 {
    transition-delay: 0.1s;
}

.video_bento_grid.in-view .bento_sidebar .bento_item.pos-2 {
    transition-delay: 0.2s;
}

.video_bento_grid.in-view .bento_sidebar .bento_item.pos-3 {
    transition-delay: 0.3s;
}

.video_bento_grid.in-view .bento_sidebar .bento_item.pos-4 {
    transition-delay: 0.4s;
}

.video_bento_grid.in-view .bento_sidebar .bento_item.pos-5 {
    transition-delay: 0.5s;
}

.bento_item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}

.bento_item:hover video {
    transform: scale(1.06);
}

/* Content Overlay */
.bento_content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    z-index: 2;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

.bento_item:hover .bento_content,
.bento_item.is-active .bento_content {
    opacity: 1;
    transform: translateY(0);
}

.bento_category {
    display: inline-block;
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 5px 10px;
    border-radius: 4px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bento_title {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

/* Active State */
.bento_item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: #eb5939;
    transition: width 0.4s ease;
    z-index: 3;
}

.bento_item.is-active::after {
    width: 100%;
}

.bento_item.is-active {
    border-color: rgba(235, 89, 57, 0.6);
    opacity: 1;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(235, 89, 57, 0.15);
}

.bento_item.is-active video {
    opacity: 0.5;
}

.bento_item:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

/* ===== VIDEO INFO BAR ===== */
.video_info_bar {
    max-width: 1728px;
    margin: 14px auto 0;
    padding: 0 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.video_info_bar.in-view {
    opacity: 1;
    transform: translateY(0);
}

.video_info_bar_inner {
    display: flex;
    align-items: stretch;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(12, 12, 12, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

/* Project Title Area — with red left accent */
.video_info_project {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 28px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid #eb5939;
    min-width: 230px;
    background: rgba(235, 89, 57, 0.04);
}

.video_info_project_indicator {
    width: 10px;
    height: 10px;
    background: #eb5939;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(235, 89, 57, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px rgba(235, 89, 57, 0.5);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.85);
        box-shadow: 0 0 16px rgba(235, 89, 57, 0.8);
    }
}

.video_info_project_name {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s;
}

.video_info_project_type {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 10px;
    color: #eb5939;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 3px;
    font-weight: 500;
    transition: opacity 0.3s;
}

/* Stats Grid */
.video_info_stats {
    display: flex;
    flex: 1;
    align-items: center;
}

.video_info_stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 18px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s, box-shadow 0.3s;
    position: relative;
}

.video_info_stat:last-child {
    border-right: none;
}

.video_info_stat:hover {
    background: rgba(235, 89, 57, 0.04);
}

.video_info_stat_label {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 6px;
    font-weight: 500;
}

.video_info_stat_value {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Animate stat value changes */
.video_info_stat_value.is-changing {
    opacity: 0;
    transform: translateY(5px);
}

/* ===== Responsive ===== */
@media (max-width: 1199px) {
    .video_info_stats {
        flex-wrap: wrap;
    }

    .video_info_stat {
        min-width: 33.33%;
    }
}

@media (max-width: 991px) {
    .video_bento_grid {
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        gap: 15px;
    }

    .bento_main_stage {
        flex: none;
        width: 100%;
        position: relative;
        /* Remove sticky on mobile */
        top: 0;
        aspect-ratio: 16/9;
    }

    .bento_sidebar {
        flex: none;
        width: 100%;
        grid-template-columns: 1fr 1fr;
        padding-bottom: 0px;
    }

    /* Keep first item wide on tablet */
    .bento_sidebar .bento_item.pos-1 {
        grid-column: 1 / 3;
        aspect-ratio: 16/9;
    }

    .bento_item {
        aspect-ratio: 16/9;
    }

    .bento_content {
        opacity: 1;
        transform: translateY(0);
        padding: 10px;
    }

    .bento_title {
        font-size: 12px;
    }

    .bento_category {
        font-size: 8px;
        padding: 2px 5px;
    }

    .video_info_bar_inner {
        flex-direction: column;
    }

    .video_info_project {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        min-width: auto;
    }

    .video_info_stats {
        flex-wrap: wrap;
    }

    .video_info_stat {
        min-width: 33.33%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }
}

@media (max-width: 575px) {
    .bento_sidebar {
        grid-template-columns: 1fr;
    }

    .bento_sidebar .bento_item.pos-1 {
        grid-column: 1;
    }

    .video_info_stat {
        min-width: 50%;
    }

    .video_info_project {
        padding: 14px 18px;
    }
}