/* MyTube — YouTube-style layout for the #mytube tab */

/* neo.css caps every .tab-content at max-width: 1240px (centered) — MyTube wants
   real YouTube's full-bleed layout instead, same override pattern #settings uses. */
#mytube.tab-content {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    background: #0f0f0f;
}

.yt-shell {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    color: #f1f1f1;
    font-family: Roboto, Arial, Inter, sans-serif;
}

/* Top bar */
.yt-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    background: #0f0f0f;
    border-bottom: 1px solid #272727;
}

.yt-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
    cursor: pointer;
    white-space: nowrap;
}

.yt-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 18px;
    background: #ff0000;
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
}

.yt-searchwrap {
    flex: 1;
    max-width: 600px;
    display: flex;
}

.yt-search-input {
    flex: 1;
    background: #121212;
    border: 1px solid #303030;
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding: 8px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.yt-search-input:focus {
    border-color: #1c62b9;
}

.yt-search-btn {
    background: #222222;
    border: 1px solid #303030;
    border-radius: 0 20px 20px 0;
    padding: 0 18px;
    cursor: pointer;
    color: #f1f1f1;
}

.yt-search-btn:hover {
    background: #2d2d2d;
}

/* Category chips */
.yt-chips {
    display: flex;
    gap: 10px;
    padding: 14px 24px;
    overflow-x: auto;
}

.yt-chips.hidden { display: none; }

.yt-chip {
    flex-shrink: 0;
    background: #272727;
    border: none;
    color: #f1f1f1;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.yt-chip:hover { background: #3f3f3f; }

.yt-chip.active {
    background: #f1f1f1;
    color: #0f0f0f;
}

/* Grid */
.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px 16px;
    padding: 8px 24px 24px;
}

.yt-card {
    cursor: pointer;
}

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

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

.yt-card-info {
    padding-top: 10px;
}

.yt-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-card-channel {
    font-size: 13px;
    color: #aaaaaa;
    margin-top: 4px;
    display: inline-block;
    cursor: pointer;
}

.yt-card-channel:hover {
    color: #fff;
    text-decoration: underline;
}

.yt-card-meta {
    font-size: 13px;
    color: #aaaaaa;
}

.yt-grid-foot {
    display: flex;
    justify-content: center;
    padding-bottom: 32px;
}

.yt-loadmore {
    background: #272727;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.yt-loadmore.hidden,
.yt-watch.hidden,
.yt-browse.hidden,
.yt-shorts-view.hidden,
.yt-channel-view.hidden {
    display: none !important;
}

.yt-loadmore:hover { background: #3f3f3f; }

.yt-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaaaaa;
    padding: 60px 20px;
    font-size: 14px;
}

/* Body: sidebar + main content */
.yt-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.yt-sidebar {
    flex-shrink: 0;
    width: 88px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 6px;
    border-right: 1px solid #272727;
}

.yt-side-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #f1f1f1;
    padding: 12px 4px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
}

.yt-side-btn:hover { background: #272727; }

.yt-side-btn.active {
    background: #272727;
    font-weight: 700;
}

.yt-side-icon {
    font-size: 20px;
}

.yt-side-disabled {
    opacity: 0.4;
}

.yt-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* Shorts row on Home */
.yt-shorts-row-wrap {
    padding: 14px 24px 4px;
}

.yt-shorts-row-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.yt-shorts-row-icon {
    color: #ff0000;
    font-size: 18px;
}

.yt-shorts-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.yt-short-thumb {
    flex-shrink: 0;
    width: 150px;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #272727;
}

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

.yt-short-thumb-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dedicated Shorts view */
.yt-shorts-view {
    padding: 20px 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.yt-shorts-back {
    align-self: flex-start;
}

.yt-shorts-stage {
    position: relative;
    width: min(100%, 380px);
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

.yt-short-player, .yt-short-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.yt-short-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    pointer-events: none;
}

.yt-short-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.yt-short-channel {
    pointer-events: auto;
    background: #272727;
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.yt-shorts-nav {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.yt-shorts-navbtn {
    background: #272727;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
}

.yt-shorts-navbtn:hover { background: #3f3f3f; }

/* Watch view */
.yt-watch {
    padding: 20px 24px 40px;
}

.yt-back {
    background: #272727;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.yt-back:hover { background: #3f3f3f; }

.yt-watch-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

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

.yt-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.yt-watch-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 16px 0 8px;
}

.yt-watch-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #272727;
}

.yt-watch-channel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
}

.yt-watch-channel:hover .yt-watch-channel-name {
    text-decoration: underline;
}

.yt-watch-channel-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.yt-watch-stats {
    display: block;
    font-size: 13px;
    color: #aaaaaa;
    margin-top: 2px;
}

.yt-watch-desc {
    margin-top: 14px;
    background: #272727;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #e0e0e0;
    white-space: pre-wrap;
    max-height: 220px;
    overflow-y: auto;
}

.yt-watch-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yt-watch-side-label {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

/* Comments */
.yt-comments {
    margin-top: 24px;
}

.yt-comments-head {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.yt-comments-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.yt-comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #272727;
    object-fit: cover;
}

.yt-comment-body { min-width: 0; flex: 1; }

.yt-comment-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.yt-comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.yt-comment-time {
    font-size: 12px;
    color: #aaaaaa;
}

.yt-comment-text {
    font-size: 14px;
    color: #e0e0e0;
    line-height: 1.5;
    margin-top: 2px;
    white-space: pre-wrap;
}

.yt-comment-likes {
    font-size: 12px;
    color: #aaaaaa;
    margin-top: 6px;
}

/* Channel view */
.yt-channel-view {
    padding: 0 0 40px;
}

.yt-channel-view .yt-back {
    margin: 16px 0 0 24px;
}

.yt-channel-banner {
    width: 100%;
    aspect-ratio: 6 / 1;
    background: linear-gradient(135deg, #272727, #181818);
    background-size: cover;
    background-position: center;
}

.yt-channel-head {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px 24px;
}

.yt-channel-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #272727;
}

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

.yt-channel-head-info h2 {
    font-size: 22px;
    color: #fff;
    margin: 0 0 6px;
}

.yt-channel-meta {
    font-size: 13px;
    color: #aaaaaa;
    margin-bottom: 8px;
}

.yt-channel-desc {
    font-size: 13px;
    color: #e0e0e0;
    line-height: 1.5;
    max-width: 640px;
}

.yt-upnext-item {
    display: flex;
    gap: 8px;
    cursor: pointer;
}

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

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

.yt-upnext-info { min-width: 0; }

.yt-upnext-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-upnext-channel {
    font-size: 12px;
    color: #aaaaaa;
    margin-top: 4px;
}

/* Shorts preview tile on ChatBase's own Home tab (neo-home bento grid) */
.neo-shorts .yt-shorts-row {
    padding: 0;
}

.neo-shorts .yt-short-thumb {
    width: 108px;
}

.neo-shorts .yt-empty {
    padding: 16px 0;
    text-align: left;
}

/* Responsive */
@media (max-width: 900px) {
    .yt-watch-grid {
        grid-template-columns: 1fr;
    }
    .yt-topbar {
        gap: 12px;
        padding: 10px 14px;
    }
    .yt-sidebar {
        width: 60px;
        padding: 10px 2px;
    }
    .yt-side-btn span:not(.yt-side-icon) {
        display: none;
    }
    .yt-grid {
        padding: 8px 14px 24px;
    }
    .yt-chips {
        padding: 12px 14px;
    }
    .yt-watch {
        padding: 16px 14px 32px;
    }
    .yt-shorts-row-wrap {
        padding: 12px 14px 4px;
    }
    .yt-channel-head {
        padding: 16px 14px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
