/* 
 * Shorts / Reels CSS
 */
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden; /* Disable normal scroll */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bh-shorts-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
}

.bh-shorts-feed {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.bh-shorts-feed::-webkit-scrollbar {
    display: none;
}

.bh-short-item {
    position: relative;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    color: #fff;
}

.bh-short-video-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bh-short-video-wrap iframe,
.bh-short-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Prevent iframe grabbing scroll */
}

.bh-short-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.bh-short-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: -1;
}

.bh-short-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px;
    padding-bottom: 70px; /* Room for mobile nav */
    pointer-events: auto;
}

.bh-short-info {
    flex: 1;
    padding-right: 20px;
}

.bh-short-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}

.bh-short-desc {
    font-size: 14px;
    margin: 0 0 12px;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bh-short-music {
    display: flex;
    align-items: center;
    font-size: 13px;
    gap: 8px;
}

.bh-short-music svg {
    animation: spin 4s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.bh-short-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.bh-short-btn {
    background: none;
    border: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.bh-short-btn svg {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    transition: transform 0.2s;
}

.bh-short-btn:active svg {
    transform: scale(0.9);
}

.bh-short-btn-label {
    font-size: 12px;
    font-weight: 600;
}

.bh-short-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    pointer-events: auto;
}

.bh-short-tabs {
    display: flex;
    gap: 20px;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.7);
}

.bh-short-tab.active {
    color: #fff;
    border-bottom: 2px solid #fff;
    padding-bottom: 4px;
}

.bh-shorts-desktop-bg {
    display: none;
}

/* Desktop override to look like YouTube Shorts */
@media (min-width: 768px) {
    .bh-shorts-desktop-bg {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 0;
        background-size: cover;
        background-position: center;
        filter: blur(40px) brightness(0.3);
        transform: scale(1.1);
    }
    
    .bh-short-item {
        background: transparent;
    }
    
    .bh-short-video-wrap {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vh * (9/16)); /* Fixed 9:16 aspect ratio in center */
        max-width: 100%;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    }
    
    .bh-short-ui {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vh * (9/16));
        border-radius: 16px;
        overflow: hidden;
    }
    
    .bh-short-actions {
        position: absolute;
        right: -80px;
        bottom: 30px;
        pointer-events: auto;
    }
    
    .bh-short-btn {
        background: rgba(255,255,255,0.1);
        padding: 12px;
        border-radius: 50%;
        margin-bottom: 15px;
    }
    .bh-short-btn-label {
        position: absolute;
        bottom: -20px;
    }
}

.bh-short-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: none;
}
.bh-short-loader.active {
    display: block;
}
.bh-short-loader svg {
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    fill: #fff;
}

/* Mobile Bottom Nav Override */
@media (max-width: 767px) {
    .bh-shorts-body .bh-mobile-nav {
        display: flex !important;
        position: fixed; bottom: 0; left: 0; right: 0;
        background: #000;
        border-top: 1px solid #333;
        z-index: 9999;
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    }
    .bh-shorts-body .bh-mn-item {
        flex: 1; display: flex; flex-direction: column;
        align-items: center; gap: 3px; padding: 4px 0;
        font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.6);
        transition: color 0.2s; text-decoration: none;
    }
    .bh-shorts-body .bh-mn-item.active, .bh-shorts-body .bh-mn-item:hover { color: #fff; }
    .bh-shorts-body .bh-mn-item svg { stroke: currentColor; }
    
    .bh-shorts-feed {
        height: calc(100vh - 54px - env(safe-area-inset-bottom));
    }
    .bh-short-item {
        height: calc(100vh - 54px - env(safe-area-inset-bottom));
    }
}
