@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
    --yt-bg: #0f0f0f;
    --yt-elevated: #272727;
    --yt-hover: #3f3f3f;
    --yt-search-bg: #121212;
    --yt-border: rgba(255, 255, 255, 0.1);
    --yt-text: #f1f1f1;
    --yt-text-secondary: #aaa;
    --yt-accent: #3ea6ff;
    --yt-red: #ff0033;
    --header-h: 56px;
}

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--yt-bg);
    color: var(--yt-text);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 5px;
}

.sidebar:hover::-webkit-scrollbar-thumb,
.video-container:hover::-webkit-scrollbar-thumb {
    background: #717171;
}

::-webkit-scrollbar-thumb:hover {
    background: #909090;
}

h1 {
    font-size: 1.25rem;
    color: var(--yt-text);
    font-weight: 700;
    letter-spacing: -1px;
}

h4 {
    text-transform: none;
    margin: 8px 12px;
    padding-left: 12px;
    font-size: .875rem;
    color: var(--yt-text);
    font-weight: 500;
}

i {
    font-size: 1.5rem;
    color: var(--yt-text);
}

p,
a {
    font-size: 0.875rem;
}

hr {
    border: none;
    border-top: 1px solid var(--yt-border);
    margin: 8px 12px;
}


/* header */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    background-color: var(--yt-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 169px;
}

.logo-container .ri-menu-line {
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .15s ease;
}

.logo-container .ri-menu-line:hover {
    background-color: var(--yt-elevated);
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.logo-img {
    position: relative;
    height: 32px;
    width: 32px;
    margin-right: 6px;
}

#logo-txt {
    letter-spacing: -1.5px;
    font-size: 1.35rem;
    font-weight: 700;
}

.search-container {
    display: flex;
    align-items: center;
    flex: 0 1 640px;
    margin: 0 40px;
}

.search-container form {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-container input {
    height: 40px;
    width: 100%;
    background-color: var(--yt-search-bg);
    border: 1px solid var(--yt-border);
    border-radius: 40px 0 0 40px;
    padding: 0 16px 0 20px;
    color: var(--yt-text);
    font-size: 1rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.search-container input:focus {
    border-color: #1c62b9;
    box-shadow: inset 0 0 0 1px #1c62b9;
    padding-left: 52px;
}

.search-container .search {
    min-width: 64px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--yt-border);
    border-left: none;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
    transition: background-color .15s ease;
}

.search-container .search:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.search-container .mic {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    border: none;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--yt-elevated);
    cursor: pointer;
    transition: background-color .15s ease;
}

.search-container .mic:hover {
    background-color: var(--yt-hover);
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 225px;
    justify-content: flex-end;
}

.profile-container i {
    margin: 0;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .15s ease;
}

.profile-container i:hover {
    background-color: var(--yt-elevated);
}

.profile-box {
    position: relative;
    height: 32px;
    width: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 8px;
    cursor: pointer;
    border: 1px solid var(--yt-border);
}

img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
}


/* layout */

.body-container {
    display: flex;
    position: fixed;
    height: calc(100vh - var(--header-h));
    top: var(--header-h);
    width: 100%;
}


/* sidebar */

.sidebar {
    padding: 12px 0;
    width: 240px;
    background-color: var(--yt-bg);
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--yt-text);
    flex-shrink: 0;
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: pointer;
    height: 40px;
    border-radius: 10px;
    color: var(--yt-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color .12s ease;
}

.sidebar-item:hover {
    background-color: var(--yt-elevated);
}

.sidebar-item i {
    margin-right: 24px;
    font-size: 1.5rem;
    color: var(--yt-text);
}


/* main content */

.content {
    width: calc(100vw - 240px);
    display: flex;
    flex-direction: column;
    background-color: var(--yt-bg);
}

.chips-wrapper {
    overflow-x: auto;
    background-color: var(--yt-bg);
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--yt-border);
    flex-shrink: 0;
}

.chips-wrapper::-webkit-scrollbar {
    height: 0;
}

.chip {
    background-color: var(--yt-elevated);
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    color: var(--yt-text);
    transition: background-color .12s ease;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.chip p {
    font-size: 14px;
    line-height: 1;
}

.chip:hover {
    background-color: var(--yt-hover);
}

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

.chip.active-chip:hover {
    background-color: #fff;
}


/* video grid */

.video-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-gap: 40px 16px;
    padding: 24px;
    background-color: var(--yt-bg);
    overflow-y: auto;
    height: calc(100vh - var(--header-h) - 65px);
    align-content: start;
    align-items: start;
    position: relative;
    min-height: 300px;
}

.video-content-cover {
    position: relative;
    transition: none;
}

.video-content {
    position: relative;
    width: 100%;
    transition: none;
}

.video-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    transition: border-radius .15s ease;
}

.video-box img,
.video-box video {
    border-radius: 12px;
    transition: border-radius .15s ease;
}

.video-content:hover .video-box,
.video-content:hover .video-box img,
.video-content:hover .video-box video {
    border-radius: 0;
}

.video-details {
    display: flex;
    color: var(--yt-text);
    padding: 12px 0 0;
    gap: 12px;
}

.channel-logo {
    position: relative;
    min-width: 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--yt-elevated);
}

.detail {
    flex: 1;
    min-width: 0;
}

.title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--yt-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    margin-bottom: 4px;
}

.channel-name {
    font-size: 0.8125rem;
    color: var(--yt-text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

.channel-name:hover {
    color: var(--yt-text);
}

.views-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--yt-text-secondary);
    line-height: 1.3;
}

.views-upload .views::after {
    content: " \00b7";
    margin: 0 2px;
}

/* download / copy / embed action row inside details — modern YT keeps these subtle */
.detail .download-btn,
.detail .copy-link-btn,
.detail .copy-embed-btn {
    color: var(--yt-text) !important;
    background: var(--yt-elevated) !important;
    border-radius: 16px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    transition: background-color .12s ease;
}

.detail .download-btn:hover,
.detail .copy-link-btn:hover,
.detail .copy-embed-btn:hover {
    background: var(--yt-hover) !important;
}

.btn {
    padding: 6px 0;
    color: var(--yt-text-secondary);
    text-transform: uppercase;
    width: 100%;
    background-color: var(--yt-elevated);
    text-align: center;
    margin: 6px 0;
    font-size: .65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    transition: background-color .12s ease;
}

.btn:hover {
    background-color: var(--yt-hover);
    color: var(--yt-text);
}

.btn i {
    font-size: .75rem;
    margin-right: 6px;
    color: inherit;
}

.hidden-content {
    display: none;
}

.directory-path {
    font-size: 12px;
    color: var(--yt-text-secondary);
    margin-top: 2px;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* responsive */

@media (max-width: 1320px) {
    .video-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 72px;
        padding: 8px 0;
    }
    .sidebar .sidebar-items {
        padding: 0 4px;
    }
    .sidebar-item {
        flex-direction: column;
        height: 74px;
        padding: 16px 0 14px;
        font-size: 10px;
        gap: 6px;
        text-align: center;
    }
    .sidebar-item i {
        margin-right: 0;
        font-size: 1.4rem;
    }
    .sidebar hr,
    .sidebar h4,
    .sidebar .more {
        display: none;
    }
    .sidebar [id^="stat-"] {
        display: none;
    }
    .content {
        width: calc(100vw - 72px);
    }
    .logo-container {
        min-width: auto;
    }
}

@media (max-width: 1050px) {
    .video-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .video-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 16px;
        grid-gap: 24px 12px;
    }
    .search-container {
        margin: 0 16px;
    }
}

@media (max-width: 600px) {
    .video-container {
        grid-template-columns: minmax(0, 1fr);
        grid-gap: 24px;
        padding: 0;
    }
    .video-box,
    .video-box img,
    .video-box video {
        border-radius: 0 !important;
    }
    .video-details {
        padding: 12px 12px 0;
    }
    .ri-grid-fill {
        display: none;
    }
    .header {
        padding: 0 8px;
    }
    .profile-container {
        min-width: auto;
        gap: 4px;
    }
}


/* select / dropdown */

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--yt-elevated);
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22white%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3e%3cpolyline points=%226 9 12 15 18 9%22%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    color: var(--yt-text);
    border: none;
    border-radius: 8px;
    padding: 0 36px 0 12px;
    height: 32px;
    align-self: center;
    outline: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color .12s ease;
}

.custom-select:hover {
    background-color: var(--yt-hover);
}


/* modal */

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-overlay.media-modal {
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.95);
}

.modal-dialog {
    background-color: #212121;
    color: var(--yt-text);
    width: 500px;
    max-width: 90%;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-dialog.sm {
    width: 400px;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: var(--yt-text-secondary);
    transition: background-color .12s ease;
}

.modal-close-btn:hover {
    background-color: var(--yt-elevated);
    color: var(--yt-text);
}

.media-close-btn {
    position: absolute;
    top: 16px;
    right: 24px;
    color: #f1f1f1;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color .12s ease;
}

.media-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin-top: 0;
    border-bottom: 1px solid var(--yt-border);
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
}

.btn-primary {
    background: var(--yt-accent);
    color: #0f0f0f;
    border: none;
    border-radius: 18px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: filter .12s ease;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--yt-red);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: filter .12s ease;
}

.btn-danger:hover {
    filter: brightness(1.1);
}
