/* =========================================================
   XXX LOCAL VIDEOS
   FRESH PROFESSIONAL RESPONSIVE CSS
   SEARCH-FIRST MOBILE LAYOUT
   ========================================================= */
/* =========================================================
   1. RESET
========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background: #f4f6f9;
    color: #1f2937;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    overflow-x: hidden;
}
img,
video {
    max-width: 100%;
}
button,
input,
textarea,
select {
    font-family: inherit;
}
button,
a,
.video-thumb {
    -webkit-tap-highlight-color: transparent;
}
/* =========================================================
   2. HEADER
========================================================= */
.header {
    position: relative;
    z-index: 1000;
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 15px;
    background: #111827;
    border-bottom: 1px solid #273449;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.10);
}
/* =========================================================
   3. MENU BUTTON
========================================================= */
.menu-btn {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: #1f2937;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}
.menu-btn:hover {
    background: #374151;
}
.menu-btn:active {
    transform: scale(0.96);
}
/* =========================================================
   4. LOGO
========================================================= */
.logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-right: auto;
    font-size: 20px;
    line-height: 1;
    font-weight: 800;
}
.logo-red {
    color: #ef4444;
}
.logo-white {
    margin-left: 5px;
    color: #ffffff;
}
/* =========================================================
   5. HEADER RIGHT
========================================================= */
.header-right {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}
/* =========================================================
   6. SEARCH BOX
   DESKTOP
========================================================= */
.search-box {
    flex: 0 1 320px;
    width: 320px;
    height: 42px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    box-shadow:
        0 1px 4px rgba(15, 23, 42, 0.08);
}
.search-box input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding:
        0 13px;
    border: 0;
    outline: 0;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    caret-color: #2563eb;
}
.search-box input::placeholder {
    color: #94a3b8;
    opacity: 1;
}
.search-box input:focus {
    color: #111827;
}
.search-box:focus-within {
    border-color: #60a5fa;
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}
/* =========================================================
   7. SEARCH BUTTON
========================================================= */
.search-box button {
    flex: 0 0 46px;
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-left: 1px solid #e2e8f0;
    background: #f1f5f9;
    color: #1e293b;
    font-size: 16px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}
.search-box button:hover {
    background: #e2e8f0;
    color: #2563eb;
}
.search-box button:active {
    background: #dbeafe;
    color: #1d4ed8;
}
/* =========================================================
   8. HEADER BUTTONS
========================================================= */
.upload-btn,
.login-btn,
.signup-btn {
    flex: 0 0 auto;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding:
        0 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}
.upload-btn {
    background: #2563eb;
    color: #ffffff;
}
.upload-btn:hover {
    background: #1d4ed8;
}
.login-btn {
    background: #374151;
    color: #ffffff;
}
.login-btn:hover {
    background: #4b5563;
}
.signup-btn {
    background: #ef4444;
    color: #ffffff;
}
.signup-btn:hover {
    background: #dc2626;
}
.upload-btn:active,
.login-btn:active,
.signup-btn:active {
    transform: scale(0.97);
}
/* =========================================================
   9. SIDEBAR OVERLAY
========================================================= */
#overlay {
    position: fixed;
    inset: 0;
    z-index: 1998;
    background:
        rgba(15, 23, 42, 0.58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}
#overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* =========================================================
   10. SIDEBAR
========================================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 280px;
    max-width: 86vw;
    height: 100vh;
    padding: 20px 13px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        linear-gradient(
            180deg,
            #111827 0%,
            #172033 55%,
            #0f172a 100%
        );
    color: #ffffff;
    box-shadow:
        8px 0 28px rgba(0, 0, 0, 0.28);
    transform: translateX(-105%);
    visibility: hidden;
    transition:
        transform 0.25s ease,
        visibility 0.25s ease;
}
.sidebar.active {
    transform: translateX(0);
    visibility: visible;
}
.sidebar h3 {
    margin:
        4px
        10px
        16px;
    padding-bottom: 11px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.10);
}
.sidebar a {
    width: 100%;
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    padding:
        9px
        12px;
    border:
        1px solid
        transparent;
    border-radius: 9px;
    color: #dbe4f0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}
.sidebar a i {
    flex: 0 0 23px;
    width: 23px;
    text-align: center;
    color: #93c5fd;
    font-size: 16px;
}
.sidebar a:hover {
    background:
        rgba(59, 130, 246, 0.15);
    border-color:
        rgba(147, 197, 253, 0.15);
    color: #ffffff;
    transform: translateX(2px);
}
/* =========================================================
   11. MAIN CONTAINER
========================================================= */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding:
        18px
        18px
        45px;
}
/* =========================================================
   12. HERO
========================================================= */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 115px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
    padding:
        20px
        21px;
    overflow: hidden;
    border:
        1px solid
        #dbe3ef;
    border-radius: 13px;
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8fafc 55%,
            #eef5ff 100%
        );
    box-shadow:
        0 5px 18px rgba(15, 23, 42, 0.07);
}
.hero-section::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background:
        linear-gradient(
            180deg,
            #ef4444,
            #2563eb
        );
}
.hero-badge {
    flex: 0 0 auto;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.hero-section h1 {
    position: relative;
    margin: 0;
    color: #111827;
    font-size:
        clamp(
            20px,
            2.4vw,
            30px
        );
    line-height: 1.15;
}
.hero-section p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}
.hero-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
}
.hero-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding:
        0 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}
.hero-btn-primary {
    background: #111827;
    color: #ffffff;
}
.hero-btn-secondary {
    background: #ef4444;
    color: #ffffff;
}
/* =========================================================
   13. SEARCH RESULT MESSAGE
========================================================= */
.search-result-message {
    width: 100%;
    margin:
        10px 0;
    padding:
        10px
        13px;
    border:
        1px solid
        #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    font-size: 14px;
}
.search-result-message strong {
    color: #111827;
}
/* =========================================================
   14. SECTION TITLE
========================================================= */
.section-title {
    margin:
        20px
        0
        12px;
    padding-left: 11px;
    color: #111827;
    font-size:
        clamp(
            21px,
            2.5vw,
            30px
        );
    line-height: 1.2;
    border-left:
        4px
        solid
        #2563eb;
}
/* =========================================================
   15. VIDEO GRID
========================================================= */
.video-grid {
    width: 100%;
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap:
        22px
        17px;
}
/* =========================================================
   16. VIDEO CARD
========================================================= */
.video-card {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
/* =========================================================
   17. VIDEO THUMB
========================================================= */
.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #e5e7eb;
    cursor: pointer;
    isolation: isolate;
    box-shadow:
        0 3px 10px
        rgba(15, 23, 42, 0.10);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}
.video-thumb:hover {
    transform: translateY(-2px);
    box-shadow:
        0 7px 18px
        rgba(15, 23, 42, 0.16);
}
.video-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #e5e7eb;
    transition:
        transform 0.25s ease;
}
.video-thumb:hover img {
    transform: scale(1.025);
}
/* =========================================================
   18. VIDEO DURATION
========================================================= */
.video-duration {
    position: absolute !important;
    right: 7px !important;
    bottom: 7px !important;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 21px;
    padding:
        0 6px;
    border-radius: 4px;
    background:
        rgba(0, 0, 0, 0.82);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
/* =========================================================
   19. PLAY OVERLAY
========================================================= */
.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        rgba(15, 23, 42, 0.14);
    opacity: 0;
    transition:
        opacity 0.2s ease;
}
.video-thumb:hover .play-overlay,
.video-thumb:focus .play-overlay {
    opacity: 1;
}
.play-overlay i {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background:
        rgba(17, 24, 39, 0.82);
    color: #ffffff;
    font-size: 17px;
}
/* =========================================================
   20. VIDEO INFO
========================================================= */
.video-info {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding:
        7px
        1px
        0;
    overflow: hidden;
}
.video-info h3 {
    width: 100%;
    margin: 0;
    padding: 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-meta {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
}
.video-meta span {
    flex: 0 0 auto;
    white-space: nowrap;
}
/* =========================================================
   21. RELATED VIDEOS
========================================================= */
.related-videos {
    width: 100%;
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap:
        20px
        16px;
    margin:
        18px
        0
        25px;
}
.related-videos > * {
    min-width: 0;
    width: 100%;
    overflow: hidden;
}
.related-videos img {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
/* =========================================================
   22. PLAYER
========================================================= */
.player-box {
    width: 100%;
    margin:
        0 auto
        12px;
    overflow: hidden;
    border-radius: 9px;
    background: #ffffff;
    box-shadow:
        0 5px 18px
        rgba(15, 23, 42, 0.08);
}
.player-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #000000;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
    overflow: hidden;
}
#mainVideo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    background: #000000;
    object-fit: contain;
}
/* =========================================================
   23. PLAYER INFO
========================================================= */
.video-info-box {
    width: 100%;
    margin: 0;
    padding:
        10px
        15px
        6px;
    background: #ffffff;
}
.video-info-box h2 {
    margin:
        0
        0
        4px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}
/* =========================================================
   24. VIDEO STATS
========================================================= */
.video-stats {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}
.stat-item {
    flex: 0 0 auto;
}
/* =========================================================
   25. VIDEO ACTIONS
========================================================= */
.video-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding:
        5px
        15px
        7px;
    background: #ffffff;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.video-actions::-webkit-scrollbar {
    display: none;
}
.action-btn {
    flex: 0 0 auto;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding:
        0 12px;
    border:
        1px solid
        #dbe1e8;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}
/* =========================================================
   26. COMMENTS
========================================================= */
.comment-section {
    width: 100%;
    padding:
        2px
        15px
        10px;
    background: #ffffff;
}
#commentBtn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding:
        0 12px;
    border:
        1px solid
        #dbe1e8;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
#commentsBox {
    width: 100%;
    margin-top: 10px;
}
#commentText {
    width: 100%;
    min-height: 80px;
    display: block;
    padding: 10px;
    resize: vertical;
    border:
        1px solid
        #dbe1e8;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
}
#commentText:focus {
    border-color: #60a5fa;
}
#sendComment {
    min-height: 34px;
    margin-top: 7px;
    padding:
        0 13px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
#allComments {
    width: 100%;
    margin-top: 12px;
}
#allComments .single-comment {
    width: 100%;
    margin-bottom: 8px;
    padding:
        9px
        10px;
    border:
        1px solid
        #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
}
/* =========================================================
   PLAYER COMPACT DESKTOP POLISH
========================================================= */
@media (min-width: 901px) {
    .player-box {
        max-width: 100%;
    }
    .player-wrapper {
        max-height: 68vh;
    }
    #mainVideo {
        max-height: 68vh;
    }
}

/* =========================================================
   27. TABLET
========================================================= */
@media (max-width: 1100px) {
    .header {
        padding:
            9px
            10px;
    }
    .logo {
        font-size: 18px;
    }
    .search-box {
        width: 250px;
    }
    .video-grid,
    .related-videos {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
        gap:
            18px
            12px;
    }
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}
/* =========================================================
   28. MOBILE SEARCH LAYOUT
   IMPORTANT:
   SEARCH HEADER کے اندر چھوٹا نہیں رہے گا۔
   پہلے ROW میں صرف MENU + LOGO + BUTTONS
   دوسرے ROW میں مکمل SEARCH BOX
========================================================= */
@media (max-width: 900px) {
    .header {
        min-height: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        padding:
            7px
            9px
            9px;
    }
    /*
       header-right کے اندر موجود elements
       header کے flex layout میں شامل ہو جائیں گے۔
    */
    .header-right {
        display: contents;
    }
    .menu-btn {
        order: 1;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }
    .logo {
        order: 2;
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 0;
        font-size: 17px;
    }
    .upload-btn {
        order: 3;
    }
    .login-btn {
        order: 4;
    }
    .signup-btn {
        order: 5;
    }
    /* ==============================================
       SEARCH — SECOND ROW
    ============================================== */
    .search-box {
        order: 10;
        flex: 1 0 100%;
        width: 100%;
        max-width: none;
        height: 48px;
        margin-top: 4px;
        border-radius: 9px;
        border:
            1px solid
            #cbd5e1;
        background: #ffffff;
        box-shadow:
            0 2px 7px
            rgba(15, 23, 42, 0.12);
    }
    .search-box input {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        height: 48px;
        padding:
            0 13px;
        font-size: 16px;
        font-weight: 500;
        color: #111827;
    }
    .search-box input::placeholder {
        font-size: 15px;
        color: #94a3b8;
    }
    .search-box button {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        border-left:
            1px solid
            #e2e8f0;
        background: #f1f5f9;
        font-size: 17px;
    }
    .search-box button:hover {
        background: #e2e8f0;
    }
    .search-box button:active {
        background: #dbeafe;
    }
    /* ==============================================
       HEADER BUTTONS
    ============================================== */
    .upload-btn,
    .login-btn,
    .signup-btn {
        height: 36px;
        padding:
            0 8px;
        font-size: 11px;
    }
    /* ==============================================
       MAIN
    ============================================== */
    .container {
        padding:
            12px
            10px
            35px;
    }
    .video-grid,
    .related-videos {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        gap:
            15px
            9px;
    }
}
@media (max-width: 620px) {
    .player-box {
        margin-bottom: 10px;
        border-radius: 8px;
    }
    .player-wrapper,
    #mainVideo {
        max-height: none;
    }
    .video-info-box {
        padding: 9px 11px 5px;
    }
    .video-info-box h2 {
        font-size: 16px;
    }
    .video-actions {
        padding: 4px 11px 6px;
    }
    .comment-section {
        padding: 2px 11px 9px;
    }
}

/* =========================================================
   29. SMALL MOBILE
========================================================= */
@media (max-width: 620px) {
    .header {
        padding:
            6px
            7px
            9px;
        gap: 5px;
    }
    .menu-btn {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        font-size: 19px;
    }
    .logo {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 15px;
    }
    .logo-white {
        margin-left: 4px;
    }
    /* ==============================================
       HEADER ICON BUTTONS
    ============================================== */
    .upload-btn,
    .login-btn,
    .signup-btn {
        flex: 0 0 35px;
        width: 35px;
        height: 35px;
        padding: 0;
        font-size: 0;
        border-radius: 8px;
    }
    .upload-btn i,
    .login-btn i,
    .signup-btn i {
        display: none;
    }
    .upload-btn::after {
        content: "\f093";
        font-family:
            "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 13px;
    }
    .login-btn::after {
        content: "\f2bd";
        font-family:
            "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 13px;
    }
    .signup-btn::after {
        content: "\f234";
        font-family:
            "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 13px;
    }
    /* ==============================================
       SEARCH — FULL MOBILE WIDTH
    ============================================== */
    .search-box {
        flex-basis: 100%;
        width: 100%;
        max-width: none;
        height: 50px;
        margin-top: 5px;
        border-radius: 10px;
    }
    .search-box input {
        width: 100%;
        height: 50px;
        padding:
            0 14px;
        font-size: 16px;
        font-weight: 500;
        line-height: 50px;
        color: #111827;
        -webkit-appearance: none;
        appearance: none;
    }
    .search-box input::placeholder {
        font-size: 15px;
        color: #94a3b8;
    }
    .search-box button {
        flex: 0 0 50px;
        width: 50px;
        height: 50px;
        font-size: 17px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    /* ==============================================
       HERO
    ============================================== */
    .hero-section {
        min-height: 82px;
        display: block;
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 9px;
    }
    .hero-badge {
        display: block;
        width: 100%;
        margin-bottom: 5px;
        font-size: 10px;
    }
    .hero-section h1 {
        width: 100%;
        margin-bottom: 4px;
        font-size: 18px;
        line-height: 1.2;
    }
    .hero-section p {
        width: 100%;
        margin-bottom: 8px;
        font-size: 11px;
    }
    .hero-actions {
        width: 100%;
        margin: 0;
        gap: 6px;
    }
    .hero-btn {
        min-height: 32px;
        padding:
            0 9px;
        font-size: 10px;
    }
    /* ==============================================
       SECTION
    ============================================== */
    .section-title {
        margin:
            13px
            0
            9px;
        padding-left: 8px;
        font-size: 21px;
    }
    /* ==============================================
       VIDEOS
    ============================================== */
    .video-grid,
    .related-videos {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        gap:
            14px
            8px;
    }
    .video-thumb {
        width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 6px;
    }
    .video-duration {
        right: 4px !important;
        bottom: 4px !important;
        min-width: 34px;
        height: 18px;
        padding:
            0 4px;
        font-size: 9px;
    }
    .play-overlay i {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    .video-info {
        padding:
            5px
            1px
            0;
    }
    .video-info h3 {
        font-size: 12px;
        line-height: 1.2;
    }
    .video-meta {
        gap: 5px;
        margin-top: 3px;
        font-size: 9px;
    }
    /* ==============================================
       PLAYER
    ============================================== */
    .player-box {
        width:
            calc(100% + 20px);
        margin-left: -10px;
        margin-right: -10px;
        margin-bottom: 16px;
        border-radius: 0;
    }
    #mainVideo {
        width: 100%;
        max-height: 65vh;
    }
    .video-info-box {
        padding:
            9px
            10px
            6px;
    }
    .video-info-box h2 {
        font-size: 16px;
    }
    .video-stats {
        gap: 7px;
        font-size: 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .video-actions {
        padding:
            6px
            10px
            8px;
        gap: 6px;
    }
    .action-btn {
        min-height: 33px;
        padding:
            0 10px;
        font-size: 11px;
    }
    /* ==============================================
       COMMENTS
    ============================================== */
    .comment-section {
        padding:
            4px
            10px
            12px;
    }
    #commentBtn {
        min-height: 33px;
        padding:
            0 10px;
        font-size: 11px;
    }
    #commentText {
        min-height: 75px;
        padding: 9px;
        font-size: 12px;
    }
    #sendComment {
        min-height: 33px;
        padding:
            0 11px;
        font-size: 11px;
    }
    /* ==============================================
       MOBILE SIDEBAR
    ============================================== */
    .sidebar {
        width: 180px;
        max-width: 72vw;
        padding:
            12px
            9px;
    }
    .sidebar h3 {
        margin:
            3px
            8px
            9px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }
    .sidebar a {
        min-height: 38px;
        gap: 9px;
        margin-bottom: 2px;
        padding:
            7px
            9px;
        border-radius: 7px;
        font-size: 12px;
    }
    .sidebar a i {
        flex: 0 0 19px;
        width: 19px;
        font-size: 14px;
    }
}
/* =========================================================
   30. VERY SMALL PHONES
========================================================= */
@media (max-width: 390px) {
    .logo {
        font-size: 13px;
    }
    .menu-btn {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }
    .upload-btn,
    .login-btn,
    .signup-btn {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }
    /* SEARCH STILL LARGE */
    
    .search-box {
        height: 48px;
        width: 100%;
        max-width: none;
    }
    .search-box input {
        height: 48px;
        padding:
            0 12px;
        font-size: 16px;
    }
    .search-box input::placeholder {
        font-size: 14px;
    }
    .search-box button {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    .video-info h3 {
        font-size: 11px;
    }
    .video-meta {
        gap: 4px;
        font-size: 8px;
    }
    .video-duration {
        font-size: 8px;
    }
    .video-info-box h2 {
        font-size: 15px;
    }
    .video-stats {
        gap: 6px;
        font-size: 9px;
    }
    .action-btn {
        min-height: 32px;
        padding:
            0 8px;
        font-size: 10px;
    }
    .sidebar {
        width: 160px;
        max-width: 70vw;
    }
    .sidebar h3 {
        margin:
            2px
            7px
            7px;
        font-size: 10px;
    }
    .sidebar a {
        min-height: 35px;
        gap: 8px;
        padding:
            6px
            8px;
        font-size: 11px;
    }
    .sidebar a i {
        flex-basis: 18px;
        width: 18px;
        font-size: 13px;
    }
}
/* =========================================================
   31. TOUCH DEVICES
========================================================= */
@media (hover: none) {
    .video-thumb .play-overlay {
        opacity: 0;
    }
    .video-thumb:hover {
        transform: none;
        box-shadow:
            0 3px 10px
            rgba(15, 23, 42, 0.10);
    }
    .video-thumb:hover img {
        transform: none;
    }
    .action-btn:hover {
        background: #ffffff;
    }
}
/* =========================================================
   32. ACCESSIBILITY
========================================================= */
button:focus-visible,
a:focus-visible,
.video-thumb:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline:
        2px
        solid
        #60a5fa;
    outline-offset: 2px;
}
/* =========================================================
   33. PRINT
========================================================= */
@media print {
    .header,
    .sidebar,
    #overlay,
    .video-actions,
    .comment-section {
        display: none !important;
    }
    body,
    .container,
    .player-box,
    .video-info-box {
        background: #ffffff !important;
        color: #000000 !important;
    }
    #mainVideo {
        max-height: none;
    }
}
/* =========================================================
   END
========================================================= */


/* =========================================================
   FINAL SEARCH + HEADER SPACING FIX
   باقی تمام CSS کو تبدیل نہیں کرتا
========================================================= */

/* Header کے نیچے غیرضروری خالی جگہ کم */
.container {
    padding-top: 8px;
}

/* Hero اور اگلے Section کے درمیان فاصلہ کم */
.hero-section {
    margin-bottom: 10px;
}

/* =========================================================
   DESKTOP SEARCH
========================================================= */

.search-box {
    flex: 0 0 300px;

    width: 300px;
    height: 42px;

    display: flex;
    align-items: center;

    overflow: hidden;

    border: 1px solid #cbd5e1;
    border-radius: 10px;

    background: #ffffff;

    transition:
        width 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.search-box:focus-within {
    border-color: #60a5fa;

    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.15);
}

.search-box input {
    flex: 1 1 auto;

    width: 100%;
    min-width: 0;
    height: 100%;

    padding: 0 12px;

    border: 0;
    outline: 0;

    background: #ffffff;
    color: #111827;

    font-size: 15px;
    font-weight: 500;

    opacity: 1;
}

.search-box input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.search-box button {
    flex: 0 0 44px;

    width: 44px;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;

    background: #2563eb;
    color: #ffffff;

    font-size: 16px;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.15s ease;
}

.search-box button:hover {
    background: #1d4ed8;
}

.search-box button:active {
    transform: scale(0.94);
}


/* =========================================================
   MOBILE SEARCH BUTTON
   شروع میں صرف Search بٹن نظر آئے گا
========================================================= */

@media (max-width: 620px) {

    .container {
        padding-top: 6px;
    }

    .hero-section {
        margin-bottom: 8px;
    }

    .search-box {
        position: relative;

        flex: 0 0 40px;

        width: 40px;
        max-width: 40px;

        height: 38px;

        border: 0;
        border-radius: 9px;

        background: #2563eb;

        box-shadow:
            0 2px 7px rgba(37, 99, 235, 0.20);

        transition:
            width 0.25s ease,
            max-width 0.25s ease,
            background 0.2s ease,
            box-shadow 0.2s ease;
    }

    /*
       جب search کھلے
    */
    .search-box.search-open {
        flex: 1 1 auto;

        width: 100%;
        max-width: 100%;

        background: #ffffff;

        border: 1px solid #60a5fa;

        box-shadow:
            0 0 0 3px rgba(96, 165, 250, 0.14);
    }

    .search-box input {
        width: 0;
        min-width: 0;

        padding: 0;

        font-size: 15px;

        opacity: 0;

        transition:
            opacity 0.15s ease,
            padding 0.2s ease;
    }

    /*
       کھلنے کے بعد input مکمل نظر آئے
    */
    .search-box.search-open input {
        width: 100%;
        min-width: 0;

        padding:
            0
            11px;

        opacity: 1;

        color: #111827;
    }

    .search-box button {
        flex: 0 0 40px;

        width: 40px;
        height: 38px;

        border-radius: 8px;

        background: #2563eb;

        color: #ffffff;

        font-size: 15px;

        z-index: 2;
    }

    .search-box.search-open button {
        background: #2563eb;
    }

    .search-box button:hover {
        background: #1d4ed8;
    }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 390px) {

    .container {
        padding-top: 5px;
    }

    .hero-section {
        margin-bottom: 7px;
    }

    .search-box {
        flex-basis: 38px;

        width: 38px;
        max-width: 38px;

        height: 36px;
    }

    .search-box.search-open {
        width: 100%;
        max-width: 100%;
    }

    .search-box button {
        flex-basis: 38px;

        width: 38px;
        height: 36px;
    }

    .search-box.search-open input {
        font-size: 14px;
    }
}




/* =========================================================
   XXX LOCAL HEADER → WELCOME HEADER
   GAP COMPLETELY REDUCED
========================================================= */

/* اوپر والے Header کی نیچے والی جگہ */
.header {
    margin-bottom: 0 !important;
    padding-bottom: 6px !important;
}

/* Main container کا اوپر والا gap ختم */
.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Welcome والا Hero بالکل اوپر لے آئیں */
.hero-section {
    margin-top: -30px !important;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .header {
        margin-bottom: 0 !important;
        padding-bottom: 5px !important;
    }

    .container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .hero-section {
        margin-top: -30px !important;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 620px) {

    .header {
        margin-bottom: 0 !important;
        padding-bottom: 4px !important;
    }

    .container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .hero-section {
        margin-top: -35px !important;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 390px) {

    .header {
        padding-bottom: 3px !important;
    }

    .container {
        padding-top: 0 !important;
    }

    .hero-section {
        margin-top: -40px !important;
    }
}


/* =========================================================
   HERO IMAGE
========================================================= */

.hero-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-image {
    display: block;
    width: auto;
    max-width: min(100%, 500px);
    height: auto;
    max-height: 180px;
    object-fit: contain;
    margin: 0 auto;
}


/* =========================================================
   MOBILE HERO IMAGE
========================================================= */

@media (max-width: 620px) {

    .hero-image-wrapper {
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .hero-image {
        width: auto;
        max-width: 100%;
        max-height: 140px;
        height: auto;
        object-fit: contain;
    }

}
/* =========================================================
   FINAL VIDEO PLAYER POLISH
   Desktop: fixed 16:9 stage prevents excess vertical space.
========================================================= */
@media (min-width:901px){
    .player-box{margin-top:0;margin-bottom:10px}
    .player-wrapper{width:100%;aspect-ratio:16/9;height:auto;max-height:none;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
    #mainVideo{width:100%;height:100%;max-height:none;aspect-ratio:16/9;object-fit:contain;display:block}
    .video-info-box{padding:8px 15px 4px}
    .video-info-box h2{margin-bottom:3px}
    .video-actions{padding:4px 15px 5px}
    .comment-section{padding:1px 15px 8px}
}
@media (max-width:900px){
    .player-wrapper{min-height:0}
}


/* =========================================================
   HOME ABOUT / CREATOR BENEFITS
========================================================= */
