* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #212121;
    --bg-hover: #3a3a3a;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --border-color: #3a3a3a;
    --accent-red: #ff0000;
    --accent-blue: #065fd4;
}

body {
    font-family: "Roboto", "Arial", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 2000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-btn span {
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.header-center {
    flex: 1;
    max-width: 640px;
    margin: 0 40px;
}

.search-container {
    display: flex;
    height: 40px;
}

.search-input {
    flex: 1;
    background-color: #121212;
    border: 1px solid var(--border-color);
    border-right: none;
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    border-radius: 40px 0 0 40px;
}

.search-input:focus {
    border-color: var(--accent-blue);
}

.search-btn {
    width: 64px;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-left: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    border-radius: 0 40px 40px 0;
}

.search-btn:hover {
    background-color: #3f3f3f;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: 56px;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-primary);
    height: calc(100vh - 56px);
    overflow-y: auto;
    position: fixed;
    padding: 12px 0;
    transition: transform 0.3s;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--bg-hover);
    border-radius: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: var(--bg-hover);
    font-weight: 500;
}

.category-icon {
    font-size: 20px;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 12px 0;
}

.sidebar-section {
    padding: 8px 0;
}

.sidebar-title {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content */
.content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

/* Chips */
.chips-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.chips-container::-webkit-scrollbar {
    height: 0;
}

.chip {
    padding: 8px 16px;
    background-color: var(--bg-hover);
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.chip:hover {
    background-color: #4a4a4a;
}

.chip.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px 16px;
}

.video-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
}

.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 4px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.video-card:hover .thumbnail-overlay {
    opacity: 1;
}

.play-overlay-btn {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
}

.video-details {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.channel-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.video-info {
    flex: 1;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-author,
.video-stats {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.more-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px;
    height: fit-content;
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
}

.video-modal-content {
    max-width: 1280px;
    margin: 80px auto 40px;
    padding: 0 24px;
}

.modal-close {
    position: fixed;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 40px;
    cursor: pointer;
    z-index: 3001;
}

.player-container {
    width: 100%;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
}

#mainPlayer {
    width: 100%;
    display: block;
    max-height: 720px;
}

.player-info {
    background-color: var(--bg-primary);
    padding: 20px 0;
}

#playerTitle {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
}

.player-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

#playerViews {
    color: var(--text-secondary);
    font-size: 14px;
}

.player-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--bg-hover);
    border: none;
    border-radius: 18px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #4a4a4a;
}

.channel-info-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.channel-info-player .channel-avatar img {
    width: 48px;
    height: 48px;
}

.channel-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.channel-subs {
    font-size: 12px;
    color: var(--text-secondary);
}

.subscribe-btn {
    margin-left: auto;
    padding: 10px 16px;
    background-color: var(--accent-red);
    border: none;
    border-radius: 18px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscribe-btn:hover {
    background-color: #cc0000;
}

.video-description {
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.video-description p {
    margin-bottom: 12px;
}

.video-description strong {
    color: var(--text-primary);
}

.video-description ul {
    margin-left: 20px;
    margin-top: 8px;
}

.video-description li {
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-240px);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-center {
        display: none;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .chips-container {
        gap: 8px;
    }

    .chip {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .player-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}