:root {
    --bg-color: #0f0f0f;
    --surface-color: #212121;
    --surface-hover: #353535;
    --text-main: #ffffff;
    --text-muted: #aaa;
    --accent: #ff0033;
    --border: #303030;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Roboto, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.navbar {
    height: 56px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

.brand-logo {
    background-color: var(--accent);
    color: #fff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.8rem;
}

.search-box input {
    background-color: #121212;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    width: 400px;
    outline: none;
    font-size: 0.95rem;
}

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

.open-source-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.open-source-text a {
    color: var(--text-main);
    text-decoration: underline;
}

.app-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 56px);
    overflow: hidden;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.player-section {
    flex: 2.5;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
}

.player-wrapper {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-wrapper video,
.plyr {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-meta {
    margin-top: 16px;
}

#videoTitle {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #555;
}

.channel-text {
    display: flex;
    flex-direction: column;
}

.channel-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.upload-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.description-container {
    background-color: var(--surface-color);
    padding: 16px;
    border-radius: 12px;
}

.description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ddd;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.description.collapsed {
    max-height: 75px;
    position: relative;
}

.description.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: linear-gradient(transparent, var(--surface-color));
}

.desc-toggle-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    font-size: 0.85rem;
}

.desc-toggle-btn:hover {
    color: var(--text-muted);
}

.sidebar {
    flex: 1;
    background-color: var(--surface-color);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 350px;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

#videoCount {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.playlist {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.video-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.video-card:hover {
    background-color: var(--surface-hover);
}

.video-card.active {
    background-color: var(--surface-hover);
    border-left: 3px solid var(--accent);
}

.card-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    background: #111;
    flex-shrink: 0;
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100%;
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        overflow-y: auto;
    }
    body {
        overflow: auto;
    }
    .sidebar {
        height: auto;
        border-left: none;
        min-width: 100%;
    }
}