* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; background: #0f0f0f; color: #fff; }

/* Header */
header {
    background: #181818;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #303030;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: bold; text-decoration: none; color: #fff; }
.logo-icon { width: 32px; height: 22px; background: #ff0000; border-radius: 6px; position: relative; }
.logo-icon::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.search-bar { flex: 1; max-width: 600px; margin: 0 40px; display: flex; }
.search-bar input { flex: 1; padding: 8px 15px; background: #121212; border: 1px solid #303030; border-radius: 20px 0 0 20px; color: #fff; font-size: 14px; }
.search-bar button { padding: 8px 20px; background: #303030; border: 1px solid #303030; border-left: none; border-radius: 0 20px 20px 0; color: #fff; cursor: pointer; }
.user-actions { display: flex; gap: 15px; align-items: center; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #3ea6ff; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* Layout */
.layout { display: flex; }
.sidebar { width: 240px; background: #0f0f0f; padding: 12px 0; min-height: calc(100vh - 60px); border-right: 1px solid #303030; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.sidebar a { display: block; padding: 10px 24px; color: #ddd; text-decoration: none; font-size: 14px; }
.sidebar a:hover { background: #272727; }
.sidebar a.active { background: #272727; }
.sidebar hr { border: none; border-top: 1px solid #303030; margin: 10px 0; }

.main { flex: 1; padding: 20px 24px; }
.categories { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 5px; }
.category { padding: 6px 15px; background: #272727; border-radius: 15px; font-size: 13px; white-space: nowrap; cursor: pointer; color: #fff; text-decoration: none; }
.category.active { background: #fff; color: #000; }

/* Video grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.video-card { cursor: pointer; text-decoration: none; color: #fff; display: block; }
.thumbnail { width: 100%; aspect-ratio: 16/9; background: #1e3c72; border-radius: 8px; position: relative; overflow: hidden; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail.live::before { content: 'LIVE'; position: absolute; top: 8px; left: 8px; background: #ff0000; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; z-index: 2; }
.thumbnail .duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); padding: 2px 6px; border-radius: 4px; font-size: 12px; z-index: 2; }

.video-info { display: flex; gap: 12px; margin-top: 12px; }
.channel-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; }
.video-title { font-size: 15px; font-weight: 500; line-height: 1.3; margin-bottom: 5px; }
.video-meta { font-size: 13px; color: #aaa; }

/* Watch page */
.watch-layout { display: flex; gap: 24px; padding: 20px 24px; }
.watch-main { flex: 1; max-width: 1100px; }
.player { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; display: flex; align-items: center; justify-content: center; position: relative; }
.player::after { content: '▶'; font-size: 80px; color: rgba(255,255,255,0.7); }
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 15px 20px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); display: flex; align-items: center; gap: 15px; }
.progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.3); border-radius: 2px; position: relative; }
.progress-fill { width: 30%; height: 100%; background: #ff0000; border-radius: 2px; }

.watch-title { font-size: 20px; font-weight: 500; margin: 16px 0 12px; }
.watch-meta { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid #303030; }
.channel-info { display: flex; align-items: center; gap: 12px; }
.subscribe-btn { background: #fff; color: #000; padding: 8px 18px; border-radius: 20px; font-weight: 500; border: none; cursor: pointer; }

.comments { margin-top: 24px; }
.comment { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.comment-body { flex: 1; }
.comment-author { font-weight: 500; margin-bottom: 4px; font-size: 13px; }
.comment-text { font-size: 14px; color: #ddd; }

/* Footer */
footer { background: #181818; padding: 20px; text-align: center; color: #888; font-size: 12px; border-top: 1px solid #303030; margin-top: 40px; }
