* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

body {
    background-color: #0f0f0f;
    color: #fff;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #1f1f1f;
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-icon {
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 50%;
}

.menu-icon:hover {
    background-color: #303030;
}

.menu-icon .line {
    width: 20px;
    height: 2px;
    background-color: #fff;
    margin: 2px 0;
    transition: 0.3s;
}

.menu-icon.active .line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-icon.active .line:nth-child(2) {
    opacity: 0;
}

.menu-icon.active .line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo .tube {
    color: #ff0000;
}

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

.search-bar input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid #303030;
    background-color: #121212;
    color: #fff;
    border-radius: 20px 0 0 20px;
}

.search-bar input:focus {
    outline: none;
    border-color: #1c62b9;
}

.search-btn, .voice-search-btn {
    width: 64px;
    height: 40px;
    background-color: #303030;
    border: 1px solid #303030;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn {
    border-radius: 0 20px 20px 0;
}

.voice-search-btn {
    border-radius: 50%;
    width: 40px;
    margin-left: 8px;
    background-color: #181818;
    border: none;
}

.nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-search-btn {
    display: none;
}

.upload-btn, .notifications-btn, .signin-btn {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.upload-btn:hover, .notifications-btn:hover, .signin-btn:hover {
    background-color: #303030;
}

.signin-btn {
    background-color: transparent;
    border: 1px solid #3ea6ff;
    border-radius: 18px;
    padding: 8px 16px;
    color: #3ea6ff;
}

.signin-btn:hover {
    background-color: rgba(62, 166, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ff0000;
    color: #fff;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 10px;
}

.mobile-search {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #1f1f1f;
    padding: 8px;
    z-index: 200;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-search-back {
    background: none;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
}

.mobile-search input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    font-size: 16px;
    border: none;
    background-color: #121212;
    color: #fff;
    border-radius: 20px;
}

.mobile-voice-search {
    background: none;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
}

.container {
    display: flex;
    margin-top: 56px;
    height: calc(100vh - 56px);
}

.sidebar {
    width: 240px;
    background-color: #1f1f1f;
    padding: 12px 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid #303030;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    padding: 8px 24px;
    font-size: 14px;
    color: #aaa;
}

.subscription-text-short {
    display: none;
}

.sidebar-item {
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 24px;
    color: #fff;
    transition: 0.2s;
}

.sidebar-item:hover {
    background-color: #303030;
}

.sidebar-item.active {
    background-color: #303030;
}

.channel-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.content {
    margin-left: 240px;
    padding: 24px;
    flex: 1;
    transition: margin-left 0.3s ease;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.video-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.video-item:hover {
    transform: scale(1.05);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #181818;
    border-radius: 12px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.video-info {
    padding: 12px 0;
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
}

.channel-thumbnail {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

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

.video-details {
    flex: 1;
}

.video-title {
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 14px;
    color: #aaa;
}

.video-stats {
    font-size: 14px;
    color: #aaa;
    display: flex;
    gap: 8px;
}

@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 960px) {
    .sidebar {
        width: 72px;
    }
    
    .sidebar-item span {
        display: none;
    }
    
    .content {
        margin-left: 72px;
    }

    .subscription-text {
        display: none;
    }

    .subscription-text-short {
        display: inline;
    }
}

@media (max-width: 768px) {
    .search-bar {
        display: none;
    }
    
    .mobile-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: #fff;
        padding: 8px;
        cursor: pointer;
    }
    
    .mobile-search.active {
        display: block;
    }
    
    .signin-text {
        display: none;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-item span {
        display: inline;
    }
    
    .content {
        margin-left: 0;
    }
    
    .navbar {
        padding: 0 8px;
    }
}