/* Dedicated Shorts Reel CSS Styling สไตล์เฉพาะสำหรับหน้า YouTube Shorts Reel */

.shorts-feed-container {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000000;
    box-sizing: border-box;
}

.shorts-reel-item {
    scroll-snap-align: center;
    scroll-snap-stop: always;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px 0;
    box-sizing: border-box;
}
@media (min-width: 769px) {
    body.shorts-page-body .app-container {
        display: flex;
        flex-direction: row;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
        background: #000000;
    }

    body.shorts-page-body .main-header {
        position: static !important;
        width: 240px !important;
        min-width: 240px !important;
        height: 100vh !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 24px 16px !important;
        background: #000000 !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-bottom: none !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        gap: 32px !important;
        margin: 0 !important;
    }

    body.shorts-page-body .header-logo-search {
        flex: none !important;
        width: 100% !important;
    }

    body.shorts-page-body .logo-text {
        font-size: 22px !important;
    }

    body.shorts-page-body .main-nav {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 !important;
    }

    body.shorts-page-body .main-nav .nav-link {
        display: flex !important;
        align-items: center !important;
        gap: 16px !important;
        padding: 12px 16px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        transition: background 0.2s ease, color 0.2s ease !important;
    }

    body.shorts-page-body .main-nav .nav-link::after {
        display: none !important;
    }

    body.shorts-page-body .main-nav .nav-icon {
        display: inline-block !important;
        font-size: 20px !important;
        width: 24px !important;
        text-align: center !important;
    }

    body.shorts-page-body .main-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        color: #ffffff !important;
    }

    body.shorts-page-body .main-nav .nav-link.active {
        background: rgba(0, 242, 254, 0.12) !important;
        color: var(--primary-cyan) !important;
    }

    body.shorts-page-body .main-nav .nav-link.active .nav-icon {
        color: var(--primary-cyan) !important;
    }

    body.shorts-page-body .header-actions {
        margin-top: auto !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    body.shorts-page-body .header-actions .nav-icon-btn {
        width: 100% !important;
        border-radius: 12px !important;
        height: 44px !important;
        justify-content: flex-start !important;
        padding: 0 16px !important;
        gap: 12px !important;
        font-size: 15px !important;
        font-family: var(--font-heading) !important;
        font-weight: 700 !important;
    }

    body.shorts-page-body .header-actions .nav-icon-btn::after {
        content: attr(title);
    }

    body.shorts-page-body .header-actions .notification-wrapper {
        width: 100% !important;
    }

    .shorts-feed-container {
        flex: 1;
        width: calc(100vw - 240px);
        height: 100vh;
    }

    .shorts-reel-item {
        height: 100vh;
        min-height: 100vh;
        padding: 20px 0;
    }
}

.shorts-player-frame {
    position: relative;
    height: 100%;
    max-height: calc(100vh - 40px);
    aspect-ratio: 9 / 16;
    background: #000000;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: aspect-ratio 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.shorts-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
    transition: transform 0.15s ease;
    padding: 0;
}

.shorts-back-btn:hover {
    transform: scale(1.15);
}

.shorts-back-btn:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {
    body.shorts-page-body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }
    body.shorts-page-body .main-header {
        display: none !important;
    }
    .shorts-feed-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }
    .shorts-reel-item {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
    }
    .shorts-player-frame {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0;
        aspect-ratio: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .shorts-media-element {
        object-fit: contain !important;
        max-height: 100% !important;
        max-width: 100% !important;
    }
    .shorts-action-bar {
        bottom: calc(50px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .shorts-bottom-info {
        bottom: calc(45px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

.shorts-media-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.shorts-gradient-overlay {
    display: none !important;
}

.shorts-bottom-info {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 75px;
    z-index: 5;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.shorts-creator-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shorts-creator-row img,
.shorts-creator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #ffffff;
}

.shorts-creator-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
}

.shorts-subscribe-btn {
    background: #ff0000;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.shorts-subscribe-btn:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.shorts-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    line-height: 1.3;
}

.shorts-description {
    font-family: var(--font-primary);
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shorts-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Floating Action Bar (Right side - Minimalist TikTok/Shorts style) */
.shorts-action-bar {
    position: absolute;
    bottom: 24px;
    right: 14px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.shorts-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.shorts-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 26px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, color 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    padding: 0;
    box-shadow: none;
}

.shorts-action-btn:hover {
    background: transparent;
    transform: scale(1.15);
}

.shorts-action-btn:active {
    transform: scale(0.88);
}

.shorts-action-btn.liked {
    background: transparent !important;
    color: #ff2b55 !important;
}

.shorts-action-count {
    font-family: var(--font-primary), sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.2px;
}

/* Slide-up Comments Drawer */
.shorts-comments-drawer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100vw, 450px);
    height: 60vh;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
    animation: slideUpFade 0.3s ease;
}

.shorts-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 12px;
}

.shorts-drawer-header h3 {
    margin: 0;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    color: #111111;
}

.shorts-drawer-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666666;
    cursor: pointer;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 40px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Infinite Scroll Sentinel Spinner */
.shorts-loading-sentinel {
    scroll-snap-align: center;
    width: 100%;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    color: var(--primary-cyan);
}

.shorts-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: var(--primary-cyan);
    border-radius: 50%;
    animation: shortsSpin 0.8s linear infinite;
}

@keyframes shortsSpin {
    to {
        transform: rotate(360deg);
    }
}
