.video-page {
    padding: 25px 0;
}

.video-player {
    background: #000;
    border-radius: 18px;
    overflow: hidden;
}

.video-player video {
    width: 100%;
    display: block;
    border-radius: 18px;
}

.video-page h3 {
    font-size: 28px;
    font-weight: 700;
    line-height: 38px;
    margin-top: 20px;
}

.video-page .btn-light {
    background: #f2f2f2;
    border: none;
    transition: .3s;
}

.video-page .btn-light:hover {
    background: #dcdcdc;
}

.video-page .btn-danger {
    border-radius: 30px;
    padding: 10px 24px;
}

.comments-section input {
    background: transparent;
}

.comments-section input:focus {
    box-shadow: none;
    border-color: #dc3545;
}

.comments-section .card {
    border-radius: 16px;
}

.up-next-card {
    transition: .25s;
    overflow: hidden;
}

.up-next-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .12) !important;
}

.up-next-card img {
    height: 100px;
    width: 100%;
    object-fit: cover;
}

.up-next-card h6 {
    font-size: 14px;
    line-height: 20px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.up-next-card .card-body {
    padding: 10px;
}

@media(max-width:991px) {

    .video-page h3 {
        font-size: 22px;
        line-height: 30px;
    }

    .video-page .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .video-page .btn-danger {
        margin-top: 15px;
    }

}

@media(max-width:768px) {

    .video-player {
        border-radius: 12px;
    }

    .video-player video {
        border-radius: 12px;
    }

    .up-next-card img {
        height: 90px;
    }

}

/* ==========================================================
   YOUTUBE SHORTS DESKTOP LAYOUT OVERRIDES & STYLES
   ========================================================== */

.shorts-layout-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 106px);
    /* 70px navbar + 36px padding */
    position: relative;
    overflow: hidden;
}

.shorts-feed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.shorts-feed-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.short-wrapper-outer {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100%;
    min-height: calc(100vh - 106px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    padding: 10px 0;
}

.short-wrapper-inner {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    position: relative;
    height: 100%;
    max-height: 720px;
    /* Adjust aspect ratio dynamically */
    aspect-ratio: 9/16;
}

.short-player-card {
    position: relative;
    width: 390px;
    height: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.short-player-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* Sound and play control overlays */
.sound-toggle-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 25;
    transition: background 0.2s, transform 0.1s;
}

.sound-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

.video-overlay-play-pause {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    pointer-events: none;
    z-index: 24;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-overlay-play-pause.flash {
    animation: flashPlayPause 0.7s forwards;
}

@keyframes flashPlayPause {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Info overlay inside video */
.short-info-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px 16px 20px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    z-index: 20;
    pointer-events: none;
}

.short-info-overlay * {
    pointer-events: auto;
}

.creator-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.creator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.creator-username {
    font-weight: 500;
    font-size: 14px;
    margin-left: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-btn {
    font-size: 12px;
    font-weight: 600;
    border: none;
    padding: 6px 14px;
    border-radius: 18px;
    margin-left: 12px;
    cursor: pointer;
    background: #fff;
    color: #0f0f0f;
    transition: all 0.2s ease;
}

.follow-btn:hover {
    background: #e6e6e6;
}

.follow-btn.following {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.follow-btn.following:hover {
    background: rgba(255, 255, 255, 0.15);
}

.short-title-text {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    margin-bottom: 6px;
    display: -webkit-box;
    --webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.short-desc-text {
    font-size: 12px;
    color: #ccc;
    display: -webkit-box;
    --webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    opacity: 0.85;
}

/* Actions sidebar on the right of the video */
.short-actions-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #f1f1f1;
    color: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.dark .action-btn {
    background: #272727;
    color: #fff;
}

.action-btn:hover {
    transform: scale(1.05);
    background: #e5e5e5;
}

body.dark .action-btn:hover {
    background: #3f3f3f;
}

.action-btn.active {
    color: #ff0033 !important;
}

.action-label {
    font-size: 12px;
    color: #606060;
    font-weight: 500;
    margin-top: 6px;
    text-align: center;
}

body.dark .action-label {
    color: #aaa;
}

/* Seek Bar / Timeline */
.short-progress-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 22;
    transition: height 0.1s;
}

.short-player-card:hover .short-progress-container {
    height: 5px;
}

.short-progress-bar {
    height: 100%;
    width: 0%;
    background: #ff0033;
    transition: width 0.1s linear;
}

/* Navigation Buttons stack on side */
.short-nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.nav-arrow-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #606060;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark .nav-arrow-btn {
    background: #272727;
    border-color: #3f3f3f;
    color: #ccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.nav-arrow-btn:hover {
    background: #f8f8f8;
    color: #0f0f0f;
    transform: translateY(-2px);
}

body.dark .nav-arrow-btn:hover {
    background: #3f3f3f;
    color: #fff;
}

.nav-arrow-btn.up-arrow:hover {
    transform: translateY(-3px);
}

.nav-arrow-btn.down-arrow:hover {
    transform: translateY(3px);
}

/* Comments Drawer Panel */
.comments-drawer {
    width: 380px;
    height: 100%;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ececec;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(410px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

body.dark .comments-drawer {
    background: #0f0f0f;
    border-color: #272727;
    color: #fff;
}

.comments-drawer.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    position: relative;
    /* Takes up space next to feed on desktop when open! */
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

body.dark .comments-header {
    border-bottom-color: #272727;
}

.comments-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
}

.close-comments-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #606060;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

body.dark .close-comments-btn {
    color: #aaa;
}

.close-comments-btn:hover {
    background: #f1f1f1;
}

body.dark .close-comments-btn:hover {
    background: #272727;
}

.comments-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
}

.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-size: 12px;
    font-weight: 600;
    color: #0f0f0f;
    margin-bottom: 2px;
}

body.dark .comment-author {
    color: #fff;
}

.comment-text {
    font-size: 13px;
    color: #222;
    line-height: 18px;
}

body.dark .comment-text {
    color: #ddd;
}

.comment-date {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.comments-input-area {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

body.dark .comments-input-area {
    border-top-color: #272727;
    background: #141414;
}

.comment-form {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.comment-form input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    outline: none;
    background: #fff;
    color: #222;
}

body.dark .comment-form input {
    background: #272727;
    border-color: #3f3f3f;
    color: #fff;
}

.comment-form input:focus {
    border-color: #ff0033;
}

.comment-submit-btn {
    background: #ff0033;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-submit-btn:hover {
    background: #cc0029;
}

/* Custom Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Custom Share Modal overlay */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.share-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.share-modal-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark .share-modal-card {
    background: #1f1f1f;
    color: #fff;
}

.share-modal-overlay.open .share-modal-card {
    transform: scale(1);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.share-modal-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 18px;
}

.share-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

.share-social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.social-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.social-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.social-share-btn:hover .social-icon-wrapper {
    transform: scale(1.1);
}

.social-icon-wrapper.whatsapp {
    background: #25d366;
}

.social-icon-wrapper.facebook {
    background: #1877f2;
}

.social-icon-wrapper.twitter {
    background: #1da1f2;
}

.social-icon-wrapper.email {
    background: #ea4335;
}

.social-share-btn span {
    font-size: 12px;
    font-weight: 500;
    color: #606060;
}

body.dark .social-share-btn span {
    color: #ccc;
}

.share-copy-container {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 24px;
    overflow: hidden;
    background: #f9f9f9;
}

body.dark .share-copy-container {
    background: #272727;
    border-color: #3f3f3f;
}

.share-copy-container input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 13px;
    color: inherit;
    outline: none;
}

.share-copy-btn {
    background: #ff0033;
    color: #fff;
    border: none;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.share-copy-btn:hover {
    background: #cc0029;
}

/* Dark mode adjustments for master layouts if needed */
body.dark {
    background: #0f0f0f;
    color: #fff;
}

/* Responsiveness overrides */
@media (max-width: 991px) {
    .shorts-layout-wrapper {
        height: calc(100vh - 70px);
        /* Fill available space */
        gap: 10px;
    }

    .short-wrapper-inner {
        gap: 10px;
    }

    .short-player-card {
        width: 320px;
        height: calc(100vh - 120px);
    }

    .comments-drawer {
        position: fixed;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 60vh;
        z-index: 1100;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .comments-drawer.open {
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .shorts-layout-wrapper {
        height: calc(100vh - 70px);
        padding: 0;
    }

    .short-wrapper-outer {
        padding: 0;
    }

    .short-wrapper-inner {
        width: 100%;
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
        gap: 0;
    }

    .short-player-card {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }

    .short-actions-sidebar {
        position: absolute;
        right: 12px;
        bottom: 80px;
        z-index: 25;
        gap: 12px;
    }

    .action-btn {
        background: rgba(0, 0, 0, 0.4);
        color: #fff;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    body.dark .action-btn {
        background: rgba(0, 0, 0, 0.4);
    }

    .action-label {
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    }

    body.dark .action-label {
        color: #fff;
    }

    .short-nav-buttons {
        display: none;
        /* Hide arrow buttons on mobile, swipe is enough */
    }
}

/* YouTube Shorts UI layout overrides for Home page list */
.shorts-row .short-card {
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.shorts-row .short-card::before {
    display: none !important;
}

.shorts-row .short-thumb {
    width: 100%;
    height: 390px;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.shorts-row .short-thumb img {
    width: 100%;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    transition: transform 0.35s ease;
}

.shorts-row .short-card:hover .short-thumb img {
    transform: scale(1.05);
}

.shorts-row .short-info-under {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    padding: 0 4px;
}

.shorts-row .short-title-under {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    max-height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

body.dark .shorts-row .short-title-under {
    color: #fff !important;
}
body:not(.dark) .shorts-row .short-title-under {
    color: #0f0f0f !important;
}

.shorts-row .short-meta-under {
    font-size: 12px;
    color: #606060;
}

body.dark .shorts-row .short-meta-under {
    color: #aaa;
}

/* Video Card Heights Alignment & Title Clamping (Global) */
.video-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-card .video-info {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
}

.video-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    height: 45px !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    text-overflow: ellipsis !important;
    margin-bottom: 5px !important;
}

body.dark .video-title {
    color: #fff !important;
}

body:not(.dark) .video-title {
    color: #111 !important;
}

/* YouTube 3-column Video Grid layout responsive overrides */
.video-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    margin-top: 25px !important;
}

@media(min-width: 600px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media(min-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.video-grid .video-card .thumbnail {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 12px !important;
}

.video-grid .video-card .thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}