* {
    font-family: 'Roboto', 'Vazirmatn', Arial, sans-serif;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0f0f0f;
    color: #f1f1f1;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
}

ul {
    list-style: none;
}

/* ===== HEADER ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #0f0f0f;
    height: 56px;
    direction: ltr;
}

.main_nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    gap: 16px;
}

.main_nav.active_nav {
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(12px);
}

.nav_left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 169px;
}

.nav_left .logo {
    height: 36px;
    width: auto;
    display: block;
    margin-left: 20px;
}

.nav_center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
    gap: 8px;
}

.ytSearchboxComponentInputContainer {
    display: flex;
    align-items: stretch;
    flex: 1;
    max-width: 640px;
    height: 40px;
    direction: ltr;
    position: relative;
}

.ytSearchboxComponentInputBox {
    flex: 1;
    display: flex;
}

.ytSearchboxComponentSearchForm {
    display: flex;
    flex: 1;
    margin: 0;
}

.ytSearchboxComponentInput {
    flex: 1;
    height: 40px;
    padding: 0 4px 0 16px;
    font-size: 16px;
    color: #f1f1f1;
    background: #121212;
    border: 1px solid #303030;
    border-radius: 40px 0 0 40px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    text-align: right;
    direction: rtl;
}

.ytSearchboxComponentInput:focus {
    border-color: #1c62b9;
}

.ytSearchboxComponentInput::placeholder {
    color: #888;
}

.ytSearchboxComponentSearchButton {
    width: 64px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border: 1px solid #303030;
    border-left: none;
    border-radius: 0 40px 40px 0;
    color: #f1f1f1;
    transition: background .15s;
    flex-shrink: 0;
}

.ytSearchboxComponentSearchButton:hover {
    background: #303030;
}

/* ===== Search suggestions dropdown ===== */
.search-suggestions {
    display: none;
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    background: #212121;
    border: 1px solid #303030;
    border-radius: 12px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.ss-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: #f1f1f1;
    font-size: 14px;
    cursor: pointer;
    direction: rtl;
    text-align: right;
}
.ss-item:hover {
    background: #303030;
}
.ss-item svg {
    flex-shrink: 0;
    color: #888;
}
.ss-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ytIconWrapperHost,
.ytSpecIconShapeHost {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ytIconWrapperHost svg,
.ytSpecIconShapeHost svg {
    width: 24px;
    height: 24px;
}

.voice-search-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #181818;
    color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}

.voice-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.voice-search-btn.voice-listening {
    background: #ff4444;
    color: #fff;
    animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 12px rgba(255, 68, 68, 0); }
}

.nav_right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 169px;
    justify-content: flex-end;
}

.nav_right .create,
.nav_right .notifications {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #f1f1f1;
    transition: background .15s;
}

.nav_right .create:hover,
.nav_right .notifications:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav_right .profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: none;
    background: none;
    padding: 0;
    margin-left: 8px;
}

.nav_right .profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile search trigger button (hidden on desktop) */
.mobile-search-btn {
    display: none;
}

/* ===== MAIN LAYOUT ===== */
main {
    display: flex;
    padding-top: 56px;
    min-height: 100vh;
    direction: ltr;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    background: #0f0f0f;
    user-select: none;
    direction: rtl;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.sidebar:hover {
    scrollbar-color: #717171 transparent;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: #717171;
}

.sidebar_links li a {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    color: #f1f1f1;
    font-size: 14px;
    font-weight: 400;
    transition: background .15s;
}

.sidebar_links li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar_links li a svg,
.mobile-bottom-nav a svg,
.nav_right button svg,
.nav_center button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar_links .shorts-link.clicked,
.mobile-bottom-nav .shorts-link.clicked {
    color: #888;
}

.sidebar_links .donate-link {
    color: #ffd700;
    animation: donate-glow 2s ease-in-out infinite;
}

@keyframes donate-glow {
    0%, 100% { opacity: 1; text-shadow: 0 0 4px rgba(255, 215, 0, 0.4); }
    50% { opacity: 0.7; text-shadow: 0 0 12px rgba(255, 215, 0, 0.8); }
}


.coming-soon {
    display: block;
    font-size: 10px;
    color: #717171;
    font-weight: 400;
}

.sidebar_links .sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
    list-style: none;
}

.subscriptions {
    margin-top: 12px;
}

.subscriptions h2 {
    color: #f1f1f1;
    font-size: 16px;
    font-weight: 500;
    padding: 6px 12px;
}

.subscriptions ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    color: #f1f1f1;
    font-size: 14px;
    transition: background .15s;
}

.subscriptions ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.subscriptions ul li a div {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.subscriptions ul li a div p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
    overflow: hidden;
}
.sub-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sub-empty {
    font-size: 13px;
    color: #888;
    padding: 8px 12px;
    line-height: 1.5;
    list-style: none;
}

/* ===== History ===== */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  padding: 8px 0;
}
.history-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #f1f1f1;
}
.history-clear {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aaa;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.history-clear:hover {
  background: rgba(255,255,255,0.1);
  color: #f1f1f1;
}
.history-grid {
  display: contents;
}

/* ===== Mobile subscriptions grid ===== */
.subs-mobile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
}
.subs-mobile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: #1a1a1a;
  border-radius: 12px;
  color: #f1f1f1;
  text-decoration: none;
  text-align: center;
  font-size: 13px;
}
.subs-mobile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #303030;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 600;
  font-size: 18px;
  color: #fff;
}
.subs-mobile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== CONTENT GRID ===== */
.content {
    flex: 1;
    min-width: 0;
    padding: 24px 40px 48px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px 40px;
    align-content: start;
    direction: rtl;
}

/* ===== VIDEO CARDS ===== */
.video_card {
    color: #f1f1f1;
    animation: fadeUp .3s ease both;
}

.video_card a {
    display: block;
    color: inherit;
}

.thumb-wrap {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #222;
}
.thumb-wrap .skel-thumb {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;
}
.thumb-wrap img {
    width: 100%;
    display: block;
    border-radius: 14px;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform .4s ease;
    position: relative;
    z-index: 2;
}

.thumb-video {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    background: #000;
}

.thumb-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 4;
    height: 3px;
    background: #ff0000;
    width: 0;
    transition: none;
    pointer-events: none;
}

.channel_infos {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    align-items: flex-start;
}

.channel_profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #717171;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.channel_profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video_titles {
    flex: 1;
    min-width: 0;
}

.video_titles h1 {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #f1f1f1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.video_titles p,
.video_titles span {
    font-size: 12px;
    line-height: 18px;
    color: #aaa;
    margin-top: 4px;
    display: block;
}

/* ===== SEARCH RESULTS ===== */
.results-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.results-bar .stat {
    font-size: 14px;
    color: #aaa;
}

.results-bar .badge {
    font-size: 12px;
    background: #ff0000;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
}

.search-hint {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #717171;
}

.search-hint svg {
    width: 64px;
    height: 64px;
    opacity: .3;
    margin-bottom: 16px;
}

.search-hint h2 {
    font-size: 20px;
    font-weight: 400;
    color: #aaa;
    margin-bottom: 8px;
}

.search-hint p {
    font-size: 14px;
    color: #717171;
}

.error-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.error-box p {
    color: #ff4444;
    font-size: 14px;
}

.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 18px;
    background: #272727;
    border: none;
    color: #f1f1f1;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s;
}

.retry-btn:hover {
    background: #3f3f3f;
}

/* Skeleton */
.skel-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px 40px;
    width: 100%;
}

.skel-card {
    background: transparent;
}

.skel-thumb {
    aspect-ratio: 16/9;
    border-radius: 12px;
    background: linear-gradient(90deg, #212121 25%, #303030 50%, #212121 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skel-row {
    display: flex;
    gap: 12px;
    padding: 12px 0 0;
}

.skel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(90deg, #212121 25%, #303030 50%, #212121 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    flex-shrink: 0;
}

.skel-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.skel-line {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, #212121 25%, #303030 50%, #212121 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skel-line:nth-child(2) {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pagination */
.pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background .15s;
}

.pagination a {
    background: transparent;
    color: #f1f1f1;
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pagination .current {
    background: #f1f1f1;
    color: #0f0f0f;
    font-weight: 500;
}

.pagination .disabled {
    color: #717171;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 56px;
        z-index: 95;
        height: calc(100vh - 56px);
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

}

/* ===== Mobile bottom navigation bar (YouTube-style) ===== */
.mobile-bottom-nav {
    display: none;
}

/* Hide search/profile icon on desktop; only show on mobile */
@media (min-width: 769px) {
    .nav_right .profile {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav_center {
        flex: 1;
    }

    .voice-search-btn {
        display: none;
    }

    .nav_right .create {
        display: none;
    }

    .ytSearchboxComponentInputContainer {
        max-width: none;
    }

    .content {
        padding: 16px 0 90px;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px 8px;
    }

    /* Hide the wide sidebar drawer on phones; use bottom nav instead */
    .sidebar {
        display: none;
    }

    main {
        padding-top: 48px;
    }

    /* YouTube-style bottom navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 66px;
        background: #0f0f0f;
        border-top: 1px solid #303030;
        z-index: 100;
        justify-content: space-around;
        align-items: center;
        direction: ltr;
    }

    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        height: 100%;
        color: #f1f1f1;
        font-size: 11px;
        line-height: 1.2;
    }

    .mobile-bottom-nav a svg {
        width: 24px;
        height: 24px;
    }

    .mobile-bottom-nav .mobile-donate {
        color: #ffd700;
        position: relative;
    }

    .mobile-bottom-nav .mobile-donate svg {
        width: 32px;
        height: 32px;
        filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
        animation: mobile-donate-bounce 2s ease-in-out infinite;
    }

    .mobile-bottom-nav .mobile-donate::after {
        content: "";
        position: absolute;
        top: -6px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 215, 0, 0.15);
        animation: mobile-donate-pulse 2s ease-in-out infinite;
    }

    @keyframes mobile-donate-bounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-3px); }
    }

    @keyframes mobile-donate-pulse {
        0%, 100% { transform: scale(1); opacity: 0.6; }
        50% { transform: scale(1.2); opacity: 1; }
    }


}

.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #272727;
    color: #f1f1f1;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    white-space: nowrap;
}
.toast-msg.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 576px) {
    header {
        height: 48px;
    }

    .main_nav {
        height: 48px;
        padding: 0 8px;
    }

    .nav_left {
        min-width: auto;
        gap: 4px;
    }

    .nav_right {
        min-width: auto;
        gap: 4px;
    }

    .nav_right .notifications {
        display: none;
    }

    /* On phones the search box is collapsed into a button that expands an overlay */
    .ytSearchboxComponentInputContainer,
    .voice-search-btn {
        display: none;
    }

    .nav_center {
        flex: 0 0 auto;
    }

    .mobile-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: none;
        background: none;
        color: #f1f1f1;
    }

    .mobile-search-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .content {
        grid-template-columns: 1fr;
        padding: 0 0 90px;
        gap: 20px;
    }

    .video_card .thumb-wrap {
        border-radius: 0;
    }

    .video_card .channel_infos {
        padding: 8px 12px 0;
    }

    .nav_left .logo {
        height: 28px;
    }

    /* Full-screen mobile search overlay */
    .mobile-search-bar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 48px;
        background: #0f0f0f;
        z-index: 110;
        align-items: center;
        gap: 4px;
        padding: 0 8px;
        direction: ltr;
    }

    .mobile-search-bar--open {
        display: flex;
    }

    .mobile-search-bar .ms-back {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: none;
        background: none;
        color: #f1f1f1;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-search-bar .ms-back:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-search-bar input {
        flex: 1;
        height: 36px;
        background: #121212;
        border: 1px solid #303030;
        border-radius: 18px;
        padding: 0 16px;
        color: #f1f1f1;
        font-size: 16px;
        outline: none;
        direction: rtl;
        text-align: right;
    }

    .mobile-search-bar input:focus {
        border-color: #1c62b9;
    }

    .mobile-search-bar .ms-submit {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: none;
        background: none;
        color: #f1f1f1;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-search-bar .ms-submit:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ===== SEARCH RESULTS – Dark Theme ===== */
.sr-container {
    background: #0f0f0f;
    min-height: 100vh;
    direction: rtl;
    padding: 0 !important;
    display: block !important;
    width: 100%;
}

/* ----- Filter Chips ----- */
.sr-chips {
    position: sticky;
    top: 56px;
    z-index: 49;
    background: #0f0f0f;
    padding: 10px 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid #303030;
    margin-top: -56px;
}
.sr-chips::-webkit-scrollbar { display: none; }
.sr-chips-inner {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    margin: 0 auto;
    width: 100%;
    max-width: 1280px;
}
.sr-chip {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: #272727;
    color: #f1f1f1;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
    user-select: none;
}
.sr-chip:hover { background: #3f3f3f; }
.sr-chip.active {
    background: #f1f1f1;
    color: #0f0f0f;
}

/* ----- Search Stats ----- */
.sr-stats {
    padding: 20px 24px 4px;
    font-size: 14px;
    color: #aaa;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}
.sr-stats strong { color: #f1f1f1; }

/* ----- Channel Result Card ----- */
.sr-channel {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    max-width: 1280px;
    margin: 0 auto;
    border-radius: 16px;
    transition: background 0.2s;
}
.sr-channel:hover { background: rgba(255,255,255,0.05); }
.sr-channel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #303030;
    position: relative;
}
.sr-channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sr-channel-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    background: #e74c3c;
}
.sr-channel-body { flex: 1; min-width: 0; }
.sr-channel-name {
    font-size: 18px;
    font-weight: 600;
    color: #f1f1f1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sr-channel-name .sr-verified {
    width: 16px;
    height: 16px;
    fill: #aaa;
    flex-shrink: 0;
}
.sr-channel-handle {
    font-size: 14px;
    color: #aaa;
    margin-top: 2px;
}
.sr-channel-meta {
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sr-channel-meta .dot { color: #555; }
.sr-channel-desc {
    font-size: 14px;
    color: #888;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.sr-subscribe {
    flex-shrink: 0;
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    background: #f1f1f1;
    color: #0f0f0f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
}
.sr-subscribe:hover { opacity: 0.85; transform: scale(1.02); }
.sr-subscribe:active { transform: scale(0.97); }

/* ----- Video Result Card (Horizontal) ----- */
.sr-video {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    max-width: 1280px;
    margin: 0 auto;
    border-radius: 16px;
    transition: background 0.2s;
    position: relative;
}
.sr-video:hover { background: rgba(255,255,255,0.05); }
.sr-video-link {
    display: flex;
    gap: 24px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.sr-video-thumb {
    position: relative;
    flex-shrink: 0;
    width: 360px;
    border-radius: 16px;
    overflow: hidden;
    background: #222;
    aspect-ratio: 16/9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: box-shadow 0.2s;
}
.sr-video:hover .sr-video-thumb {
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.sr-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.sr-video:hover .sr-video-thumb img {
    transform: scale(1.05);
}
.sr-duration {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.8);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.4;
    direction: ltr;
    letter-spacing: 0.3px;
}
.sr-video-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}
.sr-video-title {
    font-size: 20px;
    font-weight: 700;
    color: #f1f1f1;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.sr-video-channel {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.sr-video-channel-name {
    font-size: 14px;
    color: #aaa;
    line-height: 1.4;
}
.sr-video-channel .sr-verified {
    width: 14px;
    height: 14px;
    fill: #aaa;
    flex-shrink: 0;
}
.sr-video-meta {
    font-size: 14px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
    line-height: 1.4;
}
.sr-video-meta .dot { color: #555; }
.sr-video-desc {
    font-size: 14px;
    color: #888;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.sr-menu {
    position: absolute;
    top: 16px;
    left: 24px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    transition: background 0.2s;
    flex-shrink: 0;
}
.sr-menu:hover { background: rgba(255,255,255,0.1); }
.sr-menu svg {
    width: 20px;
    height: 20px;
}

/* ----- Shorts Section ----- */
.sr-shorts-section {
    max-width: 1280px;
    margin: 24px auto 8px;
    padding: 0 24px;
}
.sr-shorts-heading {
    font-size: 20px;
    font-weight: 700;
    color: #f1f1f1;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sr-shorts-heading svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.sr-shorts-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: #303030 transparent;
    scroll-behavior: smooth;
}
.sr-shorts-track::-webkit-scrollbar { height: 4px; }
.sr-shorts-track::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }
.sr-shorts-item {
    flex-shrink: 0;
    width: 160px;
    text-decoration: none;
    color: inherit;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.2s;
}
.sr-shorts-item:hover { transform: scale(1.03); }
.sr-shorts-thumb {
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 9/16;
    background: #222;
    position: relative;
}
.sr-shorts-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sr-shorts-label {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}
.sr-shorts-title {
    font-size: 14px;
    font-weight: 500;
    color: #f1f1f1;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.sr-shorts-views {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* ----- Verified Badge (reusable) ----- */
.sr-verified {
    width: 16px;
    height: 16px;
    fill: #aaa;
    flex-shrink: 0;
}

/* ----- No Results ----- */
.sr-none {
    text-align: center;
    padding: 80px 24px;
    max-width: 1280px;
    margin: 0 auto;
}
.sr-none svg {
    width: 64px;
    height: 64px;
    color: #555;
    margin-bottom: 16px;
}
.sr-none h2 {
    font-size: 20px;
    font-weight: 400;
    color: #f1f1f1;
    margin-bottom: 8px;
}
.sr-none p {
    font-size: 14px;
    color: #717171;
}

/* ----- Pagination ----- */
.sr-pages {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 32px 24px 48px;
    max-width: 1280px;
    margin: 0 auto;
}
.sr-pages a,
.sr-pages span {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
    text-decoration: none;
}
.sr-pages a {
    background: transparent;
    color: #f1f1f1;
}
.sr-pages a:hover {
    background: rgba(255,255,255,0.1);
}
.sr-pages .current {
    background: #f1f1f1;
    color: #0f0f0f;
    font-weight: 500;
}
.sr-pages .disabled {
    color: #555;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sr-video-thumb { width: 280px; }
}
@media (max-width: 768px) {
    .sr-video { flex-direction: column; padding: 12px 16px; gap: 12px; }
    .sr-video-link { flex-direction: column; gap: 12px; }
    .sr-video-thumb { width: 100%; }
    .sr-video-title { font-size: 16px; }
    .sr-channel { flex-wrap: wrap; gap: 16px; padding: 12px 16px; }
    .sr-channel-avatar { width: 64px; height: 64px; }
    .sr-channel-name { font-size: 16px; }
    .sr-subscribe { width: 100%; text-align: center; padding: 10px 16px; }
    .sr-chips { padding: 8px 0; top: 48px; }
    .sr-chips-inner { padding: 0 16px; }
    .sr-stats { padding: 16px 16px 4px; }
    .sr-menu { top: 12px; left: 16px; }
    .sr-shorts-item { width: 140px; }
}
@media (max-width: 576px) {
    .sr-video { padding: 10px 0; border-radius: 0; }
    .sr-video-thumb { border-radius: 0; }
    .sr-channel { padding: 10px 0; border-radius: 0; }
    .sr-video-title { font-size: 15px; }
    .sr-shorts-item { width: 120px; }
    .sr-shorts-thumb { border-radius: 16px; }
}

/* ===== Channel Page ===== */
.channel-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 48px;
    width: 100%;
    direction: rtl;
}
.channel-banner-wrap {
    width: 100%;
    aspect-ratio: 6 / 1;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    margin-bottom: 24px;
    margin-top: 24px;
}
.channel-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.channel-banner-wrap--empty {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.channel-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.channel-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #303030;
}
.channel-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.channel-header-avatar--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    background: #e74c3c;
}
.channel-header-info {
    min-width: 0;
    flex: 1;
}
.channel-header-info h1 {
    font-size: 24px;
    font-weight: 700;
    color: #f1f1f1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-header-meta {
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.channel-header-meta .dot {
    margin: 0 2px;
}
.channel-desc {
    font-size: 13px;
    color: #aaa;
    margin-top: 10px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.channel-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}
@media (max-width: 768px) {
    .channel-page {
        padding: 0 12px 80px;
    }
    .channel-banner-wrap {
        border-radius: 0;
        aspect-ratio: 3 / 1;
        margin-top: 0;
    }
    .channel-header { gap: 16px; margin-bottom: 24px; }
    .channel-header-avatar { width: 64px; height: 64px; }
    .channel-header-avatar--fallback { font-size: 26px; }
    .channel-header-info h1 { font-size: 20px; }
}
@media (max-width: 576px) {
    .channel-page {
        padding: 0 0 80px;
    }
    .channel-banner-wrap {
        border-radius: 0;
        aspect-ratio: 3 / 1;
    }
    .channel-header { padding: 0 12px; }
    .channel-videos {
        gap: 12px;
        padding: 0 12px;
    }
}

/* ===== NUDGE BOX ===== */
.nudge-box {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: #717171;
}
.nudge-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #272727;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: #717171;
}
.nudge-icon svg {
    width: 40px;
    height: 40px;
}
.nudge-title {
    font-size: 22px;
    font-weight: 400;
    color: #f1f1f1;
    margin-bottom: 12px;
}
.nudge-subtitle {
    font-size: 14px;
    color: #717171;
    max-width: 400px;
    line-height: 1.5;
}

/* ===== SUBSCRIBE BUTTON ===== */
.subscribe {
    background: #f1f1f1;
    color: #0f0f0f;
    border: none;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s;
}
.subscribe:hover {
    background: #d9d9d9;
}

.channel-header-info .subscribe {
    margin-top: 16px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
}

/* ----- Donate Modal ----- */
.donate-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: donate-fade-in 0.3s;
}

.donate-modal-overlay.show {
    display: flex;
}

.donate-modal {
    background: #222;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: donate-scale-in 0.3s;
}

.donate-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    background: none;
    border: none;
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}

.donate-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.donate-modal-icon svg {
    width: 100px;
    height: 100px;
    margin-bottom: 16px;
}

.donate-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0 0 12px;
}

.donate-modal-text {
    font-size: 14px;
    color: #aaa;
    line-height: 1.6;
    margin: 0 0 24px;
}

.donate-modal-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff1a1a, #cc0000);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 24px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
    transition: all .25s;
}

.donate-modal-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

.donate-modal-skip {
    display: block;
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    margin: 16px auto 0;
    cursor: pointer;
    text-decoration: underline;
}

.donate-modal-skip:hover {
    color: #f1f1f1;
}

@keyframes donate-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes donate-scale-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}




