* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0f0f0f;
    color: #ffffff;
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #212121;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid #303030;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 169px;
}

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

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 728px;
    margin: 0 40px;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 640px;
}

.search-input {
    flex: 1;
    height: 40px;
    background-color: #121212;
    border: 1px solid #303030;
    border-right: none;
    padding: 0 16px;
    font-size: 16px;
    color: #ffffff;
    outline: none;
}

.search-input::placeholder {
    color: #aaaaaa;
}

.search-input:focus {
    border-color: #065fd4;
}

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

.search-btn:hover {
    background-color: #404040;
}

.header-right {
    display: flex;
    align-items: center;
    min-width: 169px;
    justify-content: flex-end;
}

.user-menu {
    color: #ffffff;
    cursor: pointer;
    padding: 8px 16px;
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

.primary-content {
    flex: 1 1 0;
    min-width: 0;
    padding: 20px 20px 0px 6vw;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    box-sizing: border-box;
}

.secondary-content {
    width: 426px;
    padding: 24px 6vw 24px 0;
    flex-shrink: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Video Player */
.video-player-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

.main-video-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background-color: #000000;
    overflow: hidden;
}

.main-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #aaaaaa;
    font-size: 18px;
    text-align: center;
}

/* Video Details */
.video-details {
    margin-bottom: 24px;
}

.video-title {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    color: #ffffff;
}

.video-meta {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.video-views {
    font-size: 14px;
    color: #aaaaaa;
}

.video-description-container {
    background-color: #272727;
    padding: 12px;
    margin-top: 12px;
}

.video-description {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
}

/* Related Videos */
.related-videos {
    width: 100%;
}

.related-header {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 16px;
    padding-left: 8px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-item {
    display: flex;
    cursor: pointer;
    padding: 8px;
    transition: background-color 0.2s;
}

.video-item:hover {
    background-color: #272727;
}

.video-item.active {
    background-color: #3f3f3f;
}

.video-thumbnail {
    width: 168px;
    height: 94px;
    background-color: #272727;
    flex-shrink: 0;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
    font-size: 12px;
    overflow: hidden;
    position: relative;
}

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

.video-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.video-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-item-meta {
    font-size: 12px;
    color: #aaaaaa;
    line-height: 1.2;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #aaaaaa;
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #ff4444;
}

/* Scrollbar */
.video-list {
    padding-right: 8px;
}

.video-list::-webkit-scrollbar {
    width: 8px;
}

.video-list::-webkit-scrollbar-track {
    background: transparent;
}

.video-list::-webkit-scrollbar-thumb {
    background: #606060;
    border-radius: 4px;
}

.video-list::-webkit-scrollbar-thumb:hover {
    background: #808080;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .primary-content {
        position: relative;
        top: 0;
        max-width: 100%;
        padding: 16px;
        max-height: none;
        flex:0;
    }

    .secondary-content {
        width: 100%;
        padding: 0 16px 16px;
        height: auto;
        position: relative;
        top: 0;
    }

    .video-list {
        max-height: none;
    }

    .header-center {
        margin: 0 16px;
        max-width: 100%;
    }

    .search-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 12px;
    }

    .header-left {
        min-width: auto;
    }

    .logo-image {
        height: 32px;
    }

    .header-center {
        margin: 0 8px;
        max-width: calc(100% - 100px);
    }

    .search-container {
        max-width: 100%;
    }

    .search-input {
        font-size: 14px;
        padding: 0 12px;
    }

    .header-right {
        min-width: auto;
    }

    .main-container {
        margin-top: 56px;
    }

    .primary-content {
        padding: 12px;
    }

    .video-player-wrapper {
        margin-bottom: 12px;
    }

    .video-title {
        font-size: 18px;
    }

    .secondary-content {
        padding: 0 12px 12px;
    }

    .related-header {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .video-item {
        flex-direction: row;
        padding: 8px;
    }

    .video-thumbnail {
        width: 120px;
        height: 68px;
        margin-right: 8px;
    }

    .video-item-title {
        font-size: 13px;
    }

    .video-list {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 48px;
        padding: 0 8px;
    }

    .logo-image {
        height: 28px;
    }

    .header-center {
        margin: 0 4px;
        max-width: calc(100% - 80px);
    }

    .search-input {
        font-size: 12px;
        padding: 0 8px;
        height: 36px;
    }

    .search-btn {
        width: 48px;
        height: 36px;
    }

    .main-container {
        margin-top: 48px;
    }

    .primary-content {
        padding: 8px;
    }

    .video-title {
        font-size: 16px;
    }

    .secondary-content {
        padding: 0 8px 8px;
    }

    .video-thumbnail {
        width: 100px;
        height: 56px;
    }

    .video-item-title {
        font-size: 12px;
    }
}

@media (min-width: 1920px) {
    .secondary-content {
        width: 25vw;
    }
    
    .video-thumbnail {
        width: 8.75vw;
        height: 4.9vw;
    }
    
    .video-title, .related-header  {
        font-size: 1.04vw;
    }
    
    .video-item-title, .loading, .video-placeholder {
        font-size: 0.73vw;
    }
}
