/* Mobile / narrow layouts */
@media (max-width: 720px) {

    /* center the top navbar and main content column */
    .navbar,
    .mainbody,
    .videos,
    .video-grid {
        max-width: 60rem;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    /* Navbar / masthead adjustments */
    .navbar {
        background: #fff;
        display: flex;
        gap: 1rem;
    }

    /* compact navbar sections */
    .navbar .logo {
        width: 5rem;
        margin-left: -0.5rem;
        display: flex;
        align-items: center;
    }

    .searchbar,
    .search,
    .search input,
    .searchbar img,
    .navigation-icons i {
        display: none;
    }

    .navigation-icons {
        display: flex;
        align-items: center;
        gap: 0.2rem;
        margin-right: 0;
    }

    /* tags / chips row horizontally scrollable */
    .tags {
        width: 100%;
        top: -1rem;
        left: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 0 0.5rem 0;
        margin-top: 0;
    }

    .tags ul {
        width: 90%;
        display: flex;
        gap: 8px;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .tags li {
        white-space: nowrap;
    }

    .tags .arrow {
        top: 0.8rem;
        left: 91%;
    }

    /* hide the left categories sidebar on mobile to match screenshot */
    .categories {
        display: none;
    }

    /* make videos area single column */
    .video-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 2rem;
        padding: 0;
    }

    .videos {
        left: 0;
    }

    /* Video item card styles using your `.video`, `.thumbnail`, `.details` */
    .video {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 10px;
        background: #fff;
        border-radius: 8px;

        box-sizing: border-box;
    }

    .thumbnail img,
    .thumbnail iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .details {
        flex: 1 1 auto;
        min-width: 0;
    }

    .profile img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }

    .video-title {
        font-size: 14px;
        line-height: 1.2;
        color: #111;
        margin: 0 0 6px 0;
    }

    .more {
        align-self: flex-start;
    }

    /* Shorts*/
    .short-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 12px 0;
    }

    .short-videos {
        width: 90vw;
        margin-left: -1.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        gap: 2.8rem;
    }

    .short-video-container {
        flex: 0 0 120px;
        width: 120px;
    }

    .short-video-details {
        margin-left: 2rem;
    }

    .short-video-details span {
        overflow-x: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        width: 30%;
    }

    /* ad buttons in each card (if present) */
    .ad-buttons {
        display: flex;
        gap: 8px;
        margin-top: 8px;
    }

    .ad-buttons .watch,
    .ad-buttons .visit {
        padding: 8px 10px;
        font-size: 14px;
    }

    /* reduce side paddings site-wide */
    header,
    main,
    .mainbody {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* touch targets */
    button,
    a {
        touch-action: manipulation;
    }

    /*Skeleton responsive: match video grid at same breakpoints (unchanged layout) */
    .skeleton-grid {
        flex-direction: column;
        width: 100%;
        margin-top: 2rem;
        padding: 0;
    }

    .skeleton-card {
        width: 100%;
    }

    .skeleton-thumb {
        height: 15vh;
    }
}

/*Tablet Screen*/
@media ((min-width: 721px) and (max-width: 1024px)) {
    body {
        width: 100vw;
    }

    /*Navigation bar*/
    .navbar {
        width: 98%;
        padding: 0.5rem 0.5rem;
        margin: 0;
    }

    .navbar .logo {
        width: 5rem;
        margin-left: 0.5rem;
    }

    .searchbar {
        width: 45%;
        margin-left: 6rem;
    }

    .search {
        width: 100%;
    }

    .navigation-icons {
        margin-right: 1rem;
        gap: 1rem
    }

    .tags {
        left: 0%;
        width: 100vw;
    }

    /*SideBar*/
    .categories {
        height: 80%;
        width: 10%;
        margin-top: 1rem;
    }

    .category-section {
        border: none;
    }

    .sub span,
    .You p,
    .sub p,
    .Youtube-Products,
    .settings,
    .cagories-footer,
    .You span,
    .explore {
        display: none;
    }

    .category {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem;
        margin-top: 1rem;
        padding: 0.5rem 0;
    }

    .hidden {
        display: block;
    }

    /*Videos Sections*/
     .video-grid {
        margin-top: 3rem;
     }
    .videos {
        left: 10%;
        top: 7%;
    }

    .video {
        width: 40vw;
        height: 50vh;
    }

    .third,
    .ninth {
        display: none;
    }

    .thumbnail iframe,
    .thumbnail img {
        height: 25vh;
    }

    /*Short videos*/
    .short-header {
        display: flex;
        align-items: center;
        gap: 0.2rem;
        margin: 0.5rem 0;
    }

    .short-video {
        padding: 0;
        margin: 0;

    }

    .short-video video {
        width: 100%;
    }

    .short-videos {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        gap: 3rem;
    }

    .short-video-details {
        margin-left: 2rem;
    }

    .short-video-details span {
        overflow-x: hidden;
        text-overflow: ellipsis;
        white-space: wrap;
        width: 80%;
    }

    /*Skeleton responsive: match video grid at same breakpoints (unchanged layout) */
    .skeleton-card {
        width: 42vw;
    }

    .skeleton-thumb {
        height: 15vh;
    }
}