/* YouTube Clone Stylings for SamiraTube */

:root {
    --yt-bg: #0f0f0f;
    --yt-sidebar-bg: #0f0f0f;
    --yt-card-bg: transparent;
    --yt-hover: #272727;
    --yt-text: #f1f1f1;
    --yt-text-gray: #aaaaaa;
    --yt-red: #ff0000;
}

body.theme-morning {
    --yt-bg: #f0f7ff;
    --yt-sidebar-bg: #ffffff;
    --yt-hover: #e3efff;
    --yt-text: #0a192f;
    --yt-text-gray: #4a5568;
}

body.theme-afternoon {
    --yt-bg: #fff9e6;
    --yt-sidebar-bg: #fffcf0;
    --yt-hover: #ffecb3;
    --yt-text: #5d4037;
    --yt-text-gray: #795548;
}

.yt-container {
    display: flex;
    background: var(--yt-bg);
    color: var(--yt-text);
    min-height: calc(100vh - 70px);
    margin-top: 70px;
}

/* Sidebar */
.yt-sidebar {
    width: 240px;
    height: calc(100vh - 70px);
    position: fixed;
    right: 0;
    top: 70px;
    background: var(--yt-sidebar-bg);
    padding: 12px;
    overflow-y: auto;
    border-left: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease;
    z-index: 1001;
}

@media (max-width: 991px) {
    .yt-sidebar {
        transform: translateX(100%); /* Hidden off-screen by default on mobile */
    }
    .yt-sidebar.active {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
}

.yt-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    gap: 20px;
    margin-bottom: 4px;
}

.yt-nav-item:hover, .yt-nav-item.active {
    background: var(--yt-hover);
}

.yt-nav-item span.icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Main Content Area */
.yt-content {
    margin-right: 0; /* Default no margin for mobile */
    flex: 1;
    padding: 16px;
    width: 100%;
}

@media (min-width: 992px) {
    .yt-content {
        margin-right: 240px;
        padding: 24px;
    }
}

/* Tags/Chips */
.yt-chips-container {
    display: flex;
    gap: 12px;
    padding: 12px 0 24px;
    overflow-x: auto;
    white-space: nowrap;
    position: sticky;
    top: 70px;
    background: var(--yt-bg);
    z-index: 800;
}

.yt-chip {
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.yt-chip:hover, .yt-chip.active {
    background: white;
    color: black;
}

/* Video Grid */
.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    row-gap: 40px;
}

.yt-video-card {
    cursor: pointer;
}

.yt-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #222;
}

.yt-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yt-video-card:hover .yt-thumb {
    transform: scale(1.05);
}

.yt-duration {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.yt-video-meta {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.yt-channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    overflow: hidden;
}

.yt-video-info h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--yt-text);
}

.yt-video-details {
    font-size: 0.85rem;
    color: var(--yt-text-gray);
}

/* Search Bar in Header */
.yt-search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    display: flex;
}

.yt-search-input {
    flex: 1;
    background: var(--yt-bg);
    border: 1px solid var(--yt-hover);
    padding: 8px 16px;
    border-radius: 40px 0 0 40px;
    color: var(--yt-text);
    font-size: 1rem;
}

.yt-search-btn {
    background: var(--yt-hover);
    border: 1px solid var(--yt-hover);
    border-right: none;
    padding: 0 20px;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
    color: var(--yt-text);
}

/* Channel Header Styling */
.yt-channel-header {
    width: 100%;
    background: var(--yt-bg);
    margin-bottom: 24px;
}

.yt-banner {
    width: 100%;
    aspect-ratio: 6 / 1;
    background: #222;
    overflow: hidden;
    border-radius: 12px;
}

.yt-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-channel-info-bar {
    padding: 24px 0 0;
    display: flex;
    gap: 24px;
    align-items: center;
}

.yt-profile-lg {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.yt-profile-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-info-text h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.yt-verified {
    color: #aaa;
    font-size: 1.2rem;
}

.yt-sub-count {
    color: var(--yt-text-gray);
    font-size: 1rem;
    margin-bottom: 15px;
}

.yt-action-btns {
    display: flex;
    gap: 12px;
}

.yt-btn-subs {
    background: var(--yt-text);
    color: var(--yt-bg);
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

/* Tabs */
.yt-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-top: 15px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none; /* Firefox */
}
.yt-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.yt-tab {
    padding: 12px 0;
    cursor: pointer;
    color: var(--yt-text-gray);
    font-weight: 600;
    position: relative;
    font-size: 1rem;
    white-space: nowrap;
}

.yt-tab.active {
    color: var(--yt-text);
}

.yt-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--yt-text);
}

/* View Switcher Visibility */
#channelView, #watchView {
    display: none;
}

#channelView.active {
    display: block;
}

#watchView.active {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
}

.yt-video-player-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: black;
}

.yt-video-player-wrap iframe {
    width: 100%;
    height: 100%;
}

.yt-watch-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.yt-watch-card {
    display: flex;
    gap: 12px;
    cursor: pointer;
}

.yt-watch-thumb {
    width: 168px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.yt-watch-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-watch-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-watch-info .details {
    font-size: 0.8rem;
    color: var(--yt-text-gray);
    margin-top: 4px;
}

@media (max-width: 1200px) {
    #watchView.active {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .yt-channel-info-bar {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .yt-profile-lg {
        width: 100px;
        height: 100px;
    }
    .yt-info-text h1 {
        font-size: 1.8rem;
        justify-content: center;
    }
    .yt-action-btns {
        justify-content: center;
    }
    .yt-banner {
        aspect-ratio: 16 / 9; /* More visible banner on mobile */
    }
}

/* =====================================================
   Enhanced YouTube Video Library & Theater Experience
   ===================================================== */

/* Hero Search & Top Section */
.yt-hub-hero {
    background: linear-gradient(180deg, rgba(255,0,0,0.08) 0%, rgba(15,15,15,0) 100%);
    padding: 30px 0 10px;
    margin-bottom: 20px;
}

.yt-search-hero {
    max-width: 650px;
    margin: 20px auto 0;
    position: relative;
}

.yt-search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 40px;
    padding: 4px 6px 4px 20px;
    transition: all 0.3s ease;
}

.yt-search-box:focus-within {
    border-color: #ff0000;
    background: rgba(0,0,0,0.6);
    box-shadow: 0 0 20px rgba(255,0,0,0.25);
}

.yt-search-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--yt-text);
    font-size: 1rem;
    font-family: inherit;
    padding: 10px 0;
}

.yt-search-input-field::placeholder {
    color: var(--yt-text-gray);
    opacity: 0.8;
}

.yt-search-icon-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--yt-text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}

.yt-search-icon-btn:hover {
    background: #ff0000;
    color: #fff;
}

.yt-search-clear {
    background: none;
    border: none;
    color: var(--yt-text-gray);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
    display: none;
}

.yt-search-clear:hover {
    color: #fff;
}

/* Category Chips Bar */
.yt-chips-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 70px;
    z-index: 100;
    background: var(--yt-bg);
}
.yt-chips-bar::-webkit-scrollbar {
    display: none;
}

.yt-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    color: var(--yt-text);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.yt-chip-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.yt-chip-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 4px 12px rgba(255,255,255,0.2);
}

.yt-chip-count {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(0,0,0,0.2);
    padding: 2px 6px;
    border-radius: 10px;
}

.yt-chip-btn.active .yt-chip-count {
    background: rgba(0,0,0,0.15);
}

/* Video Card Enhancements */
.yt-video-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.yt-video-card:hover {
    transform: translateY(-5px);
}

.yt-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #181818;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.yt-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yt-play-btn-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #ff0000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 0 25px rgba(255,0,0,0.6);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.yt-video-card:hover .yt-play-overlay {
    opacity: 1;
}

.yt-video-card:hover .yt-play-btn-circle {
    transform: scale(1);
}

.yt-badge-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    color: #ffd700;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,215,0,0.3);
}

.yt-badge-tag.official {
    color: #4da6ff;
    border-color: rgba(77,166,255,0.4);
}

.yt-badge-tag.shorts {
    color: #ff4d4d;
    border-color: rgba(255,77,77,0.4);
}

/* Keep top navigation bar always visible in YouTube mode */
body.yt-mode .header {
    z-index: 10005 !important;
    background: rgba(15, 15, 20, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

/* Enhanced YouTube Watch / Theater View (Positioned right below top navbar) */
.yt-theater-overlay {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9990;
    display: none;
    overflow-y: auto;
    padding: 20px 24px 60px;
}

@media (max-width: 768px) {
    .yt-theater-overlay {
        top: 68px;
        padding: 15px 12px 60px;
    }
}

.yt-theater-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.yt-theater-container {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    gap: 28px;
    direction: rtl;
    align-items: start;
}

/* RTL Layout: Up Next playlist on the RIGHT, Video Player on the LEFT */
@media (min-width: 1101px) {
    .yt-theater-container {
        grid-template-columns: 380px 1fr;
    }
    .yt-theater-upnext {
        order: 1; /* Appears on the RIGHT in RTL */
    }
    .yt-theater-main {
        order: 2; /* Appears on the LEFT in RTL */
    }
}

@media (max-width: 1100px) {
    .yt-theater-container {
        grid-template-columns: 1fr;
    }
    .yt-theater-main {
        order: 1; /* Main video player on top on mobile/tablet */
    }
    .yt-theater-upnext {
        order: 2; /* Up Next playlist below player on mobile */
    }
}

.yt-theater-player-box {
    position: relative !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 50px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}

.yt-theater-player-box > iframe,
.yt-theater-player-box > #ytPlayerMount,
.yt-theater-player-box > #ytPlayerMount iframe {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    border: none !important;
}

.yt-theater-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 16px 0 12px;
    line-height: 1.4;
}

.yt-theater-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.yt-theater-channel {
    display: flex;
    align-items: center;
    gap: 12px;
}

.yt-theater-channel img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
}

.yt-theater-channel-name {
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yt-theater-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.yt-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.yt-act-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    color: #fff;
}

.yt-act-btn.close {
    background: rgba(255,0,0,0.15);
    border-color: rgba(255,0,0,0.3);
    color: #ff6666;
}

.yt-act-btn.close:hover {
    background: #ff0000;
    color: #fff;
}

.yt-desc-card {
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: 16px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.yt-desc-card:hover {
    background: rgba(255,255,255,0.08);
}

.yt-desc-header {
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    gap: 15px;
}

/* Theater Sidebar (Up Next) */
.yt-theater-upnext {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.yt-upnext-head {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.yt-upnext-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 75vh;
    overflow-y: auto;
    padding-left: 6px;
}

.yt-upnext-list::-webkit-scrollbar {
    width: 6px;
}
.yt-upnext-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.yt-next-card {
    display: flex;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    transition: all 0.2s;
    background: transparent;
}

.yt-next-card:hover {
    background: rgba(255,255,255,0.08);
}

.yt-next-card.active {
    background: rgba(255,215,0,0.1);
    border: 1px solid rgba(255,215,0,0.3);
}

.yt-next-thumb {
    width: 140px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
    position: relative;
}

.yt-next-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-next-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.yt-next-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.yt-next-meta {
    font-size: 0.75rem;
    color: var(--yt-text-gray);
}

/* Toast Message */
.yt-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.yt-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =====================================================
   YouTube Comments System
   ===================================================== */
.yt-comments-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yt-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.yt-comments-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.yt-comments-count {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.yt-comments-sort-badge {
    font-size: 0.85rem;
    color: var(--yt-text-gray);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Comment Form */
.yt-comment-form-wrap {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.yt-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b2cbf, #9d4edd);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.35);
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.yt-comment-form {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.yt-comment-form:focus-within {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 0, 0, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.yt-form-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.yt-input-name {
    width: 100%;
    max-width: 260px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 0;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.yt-input-name:focus {
    border-bottom: 2px solid #ff0000;
}

.yt-input-comment {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 0;
    font-size: 0.95rem;
    outline: none;
    resize: none;
    min-height: 38px;
    max-height: 180px;
    line-height: 1.6;
    transition: border-color 0.2s;
    font-family: inherit;
}

.yt-input-comment:focus {
    border-bottom: 2px solid #ff0000;
}

.yt-input-comment::placeholder,
.yt-input-name::placeholder {
    color: #888;
}

.yt-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.yt-btn-cancel {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.yt-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.yt-btn-submit {
    background: #ff0000;
    color: #fff;
    border: none;
    padding: 8px 22px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.yt-btn-submit:hover:not(:disabled) {
    background: #cc0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

.yt-btn-submit:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #717171;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.yt-comment-alert {
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.92rem;
    margin-top: 14px;
    display: none;
    animation: fadeIn 0.3s ease;
    line-height: 1.5;
}

.yt-comment-alert.success {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.yt-comment-alert.error {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Comments List */
.yt-comments-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.yt-comment-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

.yt-comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.yt-comment-content {
    flex: 1;
}

.yt-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.yt-comment-author {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

.yt-comment-badge-admin {
    background: #ff0000;
    color: #fff;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.yt-comment-time {
    font-size: 0.78rem;
    color: var(--yt-text-gray);
}

.yt-comment-text {
    font-size: 0.92rem;
    color: #e2e2e2;
    line-height: 1.6;
    margin: 4px 0 8px 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.yt-comment-footer {
    display: flex;
    align-items: center;
    gap: 16px;
}

.yt-comment-like-btn {
    background: transparent;
    border: none;
    color: var(--yt-text-gray);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 14px;
    transition: all 0.2s;
}

.yt-comment-like-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.yt-comment-like-btn.liked {
    color: #ff4d4d;
    font-weight: 700;
}

.yt-comment-like-btn.liked span.like-icon {
    transform: scale(1.15);
}

.yt-comments-empty {
    text-align: center;
    padding: 45px 20px;
    color: var(--yt-text-gray);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.yt-comment-pending-badge {
    display: inline-block;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-right: 6px;
}

/* =====================================================
   YouTube Autoplay Toggle & Countdown Overlay
   ===================================================== */
.yt-autoplay-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.yt-autoplay-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.yt-autoplay-toggle-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #aaa;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.yt-autoplay-toggle.active .yt-autoplay-toggle-text {
    color: #fff;
}

.yt-toggle-pill {
    width: 38px;
    height: 20px;
    background: #444;
    border-radius: 20px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.yt-autoplay-toggle.active .yt-toggle-pill {
    background: #ff0000;
}

.yt-toggle-knob {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), right 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.yt-autoplay-toggle.active .yt-toggle-knob {
    right: 2px;
}

.yt-toggle-knob span {
    font-size: 8px;
    color: #222;
    line-height: 1;
    font-weight: bold;
}

/* Autoplay Next Video Overlay */
.yt-autoplay-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.88) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box !important;
    padding: 20px !important;
}

.yt-autoplay-overlay.active {
    display: flex !important;
}

.yt-autoplay-card {
    background: #1c1c1c !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 16px !important;
    padding: 18px 22px !important;
    max-width: 380px !important;
    width: 90% !important;
    height: auto !important;
    box-sizing: border-box !important;
    text-align: center !important;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.95) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    margin: auto !important;
}

.yt-autoplay-head {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    height: auto !important;
}

.yt-autoplay-head-title {
    color: #ccc !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

.yt-countdown-circle-wrap {
    position: relative !important;
    width: 52px !important;
    height: 52px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.yt-countdown-circle-svg {
    transform: rotate(-90deg) !important;
    width: 52px !important;
    height: 52px !important;
}

.yt-countdown-circle-bg {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.12) !important;
    stroke-width: 4 !important;
}

.yt-countdown-circle-progress {
    fill: none !important;
    stroke: #ff0000 !important;
    stroke-width: 4 !important;
    stroke-linecap: round !important;
    stroke-dasharray: 151 !important;
    stroke-dashoffset: 0 !important;
    transition: stroke-dashoffset 1s linear !important;
}

.yt-countdown-num {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    line-height: 1 !important;
}

.yt-autoplay-preview {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    height: auto !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    text-align: right !important;
}

.yt-autoplay-preview-thumb {
    width: 80px !important;
    height: 48px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    background: #2a2a2a !important;
}

.yt-autoplay-preview-info {
    flex: 1 !important;
    overflow: hidden !important;
    text-align: right !important;
}

.yt-autoplay-preview-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.yt-autoplay-preview-sub {
    font-size: 0.76rem !important;
    color: #aaa !important;
    margin-top: 3px !important;
}

.yt-autoplay-btns {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
    height: auto !important;
    justify-content: center !important;
    margin-top: 4px !important;
}

.yt-autoplay-btns .yt-act-btn {
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 16px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.yt-autoplay-btns .yt-act-btn.play-now {
    background: #ff0000 !important;
    color: #fff !important;
    border: 1px solid #ff0000 !important;
}

.yt-autoplay-btns .yt-act-btn.play-now:hover {
    background: #cc0000 !important;
}

.yt-autoplay-btns .yt-act-btn.close {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.yt-autoplay-btns .yt-act-btn.close:hover {
    background: rgba(255, 255, 255, 0.18) !important;
}



