/* css/style.css - VideoTube Stijlen */

:root {
    --bg: #0f0f0f;
    --bg2: #181818;
    --bg3: #212121;
    --bg4: #272727;
    --border: #272727;
    --text: #f1f1f1;
    --text2: #aaa;
    --text3: #717171;
    --accent: #ff0000;
    --accent-hover: #cc0000;
    --blue: #3ea6ff;
    --radius: 8px;
    --sidebar-w: 240px;
    --header-h: 56px;
    --font: 'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; }

/* === HEADER === */
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg);
    display: flex; align-items: center;
    gap: 16px; padding: 0 16px;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.menu-toggle {
    background: none; display: flex; flex-direction: column; gap: 5px; padding: 8px;
    border-radius: 50%; transition: background .15s;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.menu-toggle:hover { background: var(--bg3); }
.logo svg { height: 20px; color: var(--text); }
.header-center { flex: 1; max-width: 640px; }
.search-form { display: flex; border: 1px solid var(--bg4); border-radius: 40px; overflow: hidden; }
.search-input {
    flex: 1; background: var(--bg2); border: none; outline: none;
    padding: 8px 16px; color: var(--text); font-family: inherit; font-size: 14px;
}
.search-btn {
    background: var(--bg3); border-left: 1px solid var(--bg4);
    padding: 0 20px; color: var(--text2); display: flex; align-items: center;
    transition: background .15s;
}
.search-btn:hover { background: var(--bg4); }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 20px;
    font-size: 14px; font-weight: 600; transition: all .15s;
    font-family: inherit; border: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-login { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn-login:hover { background: rgba(62,166,255,.1); }
.btn-register { background: var(--blue); color: #000; }
.btn-register:hover { opacity: .9; }
.btn-upload { background: var(--bg3); color: var(--text); font-size: 13px; }
.btn-upload:hover { background: var(--bg4); }
.btn-subscribe { background: white; color: black; }
.btn-subscribe:hover { background: #ddd; }
.btn-subscribed { background: var(--bg3); color: var(--text2); }
.btn-subscribed:hover { background: var(--bg4); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg3); }
.btn-full { width: 100%; justify-content: center; border-radius: var(--radius); }

/* === NOTIFICATIONS === */
.notif-btn {
    position: relative; background: none; color: var(--text2);
    padding: 8px; border-radius: 50%; transition: background .15s;
    display: flex; align-items: center;
}
.notif-btn:hover { background: var(--bg3); }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--accent); color: white;
    font-size: 10px; font-weight: 700; border-radius: 10px;
    padding: 1px 4px; min-width: 16px; text-align: center;
}

/* === USER MENU === */
.user-menu { position: relative; }
.user-avatar-btn { background: none; padding: 0; border-radius: 50%; overflow: hidden; }
.avatar-img, .avatar-placeholder {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover; display: flex; align-items: center; justify-content: center;
}
.avatar-placeholder { background: var(--accent); color: white; font-weight: 700; font-size: 14px; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5); display: none; z-index: 200;
}
.dropdown-menu.open { display: block; }
.dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; }
.dropdown-header span { color: var(--text2); font-size: 12px; }
.dropdown-menu a {
    display: block; padding: 10px 16px; color: var(--text);
    font-size: 13px; transition: background .1s;
}
.dropdown-menu a:hover { background: var(--bg3); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); }
.logout-link { color: var(--text2) !important; }

/* === LAYOUT === */
.layout-wrapper {
    display: flex; margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
}
.sidebar {
    width: var(--sidebar-w); position: fixed;
    top: var(--header-h); left: 0; bottom: 0;
    overflow-y: auto; padding: 12px 0;
    background: var(--bg);
    transition: transform .2s;
}
.nav-list { list-style: none; }
.nav-item {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 24px; border-radius: 10px;
    color: var(--text); font-size: 14px; transition: background .1s;
}
.nav-item:hover { background: var(--bg3); }
.nav-item.active { background: var(--bg3); font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-divider { border: none; border-top: 1px solid var(--border); margin: 12px 24px; }
.nav-section-title { padding: 8px 24px; font-size: 12px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.main-content {
    flex: 1; margin-left: var(--sidebar-w);
    padding: 24px; min-width: 0;
}

/* === CATEGORY TABS === */
.category-tabs {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 16px; margin-bottom: 16px;
    -ms-overflow-style: none; scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    white-space: nowrap; padding: 6px 14px;
    background: var(--bg3); border-radius: 8px;
    font-size: 13px; font-weight: 500; color: var(--text);
    border: none; cursor: pointer; transition: all .15s;
}
.tab-btn:hover { background: var(--bg4); }
.tab-btn.active { background: var(--text); color: var(--bg); }

/* === VIDEO GRID === */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.video-card { cursor: pointer; }
.video-thumbnail-link { display: block; }
.video-thumbnail {
    position: relative; border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 16/9;
    background: var(--bg3);
}
.video-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.video-card:hover .video-thumbnail img { transform: scale(1.02); }
.thumbnail-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; background: var(--bg3);
}
.thumbnail-placeholder svg { width: 40px; height: 40px; color: var(--text3); }
.video-duration {
    position: absolute; bottom: 6px; right: 6px;
    background: rgba(0,0,0,.85); color: white;
    font-size: 12px; font-weight: 600; padding: 2px 6px;
    border-radius: 4px;
}
.video-info { display: flex; gap: 10px; padding: 10px 0; }
.channel-avatar-link { flex-shrink: 0; }
.channel-avatar-small {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover;
}
.channel-avatar-small.placeholder {
    background: var(--accent); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.video-meta { flex: 1; min-width: 0; }
.video-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 14px; font-weight: 500;
    line-height: 1.4; color: var(--text); margin-bottom: 4px;
}
.video-title:hover { color: var(--blue); }
.channel-name { font-size: 13px; color: var(--text2); display: block; margin-bottom: 2px; }
.channel-name:hover { color: var(--text); }
.video-stats { font-size: 12px; color: var(--text3); }

/* === WATCH PAGE === */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr 402px;
    gap: 24px;
    max-width: 1500px;
}
.video-player-wrapper { border-radius: var(--radius); overflow: hidden; background: #000; }
.video-player { width: 100%; aspect-ratio: 16/9; display: block; }
.video-details { margin-top: 12px; }
.video-title-large { font-size: 20px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.video-actions-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 8px;
}
.video-stats-row { font-size: 13px; color: var(--text2); display: flex; gap: 6px; }
.video-actions { display: flex; gap: 4px; }
.action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; background: var(--bg3);
    border-radius: 20px; font-size: 14px; font-weight: 500; color: var(--text);
    transition: background .15s;
}
.action-btn:hover { background: var(--bg4); }
.action-btn.active { background: var(--bg4); color: white; }
.action-btn svg { width: 18px; height: 18px; }
.channel-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0; border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.channel-link { display: flex; align-items: center; gap: 12px; flex: 1; }
.channel-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.channel-avatar.placeholder {
    width: 40px; height: 40px; background: var(--accent);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; border-radius: 50%;
}
.channel-link strong { display: block; }
.channel-link small { color: var(--text2); font-size: 12px; }
.video-description {
    padding: 12px 0; font-size: 14px; color: var(--text2); line-height: 1.6;
    max-height: 100px; overflow: hidden; cursor: pointer;
    transition: max-height .3s;
}
.video-description.expanded { max-height: none; }
.watch-sidebar { }
.watch-sidebar h3 { font-size: 16px; margin-bottom: 12px; }
.watch-sidebar .video-card { display: flex; gap: 10px; margin-bottom: 12px; }
.watch-sidebar .video-thumbnail { width: 168px; flex-shrink: 0; height: 94px; border-radius: 6px; }
.watch-sidebar .video-info { padding: 0; }

/* === COMMENTS === */
.comments-section { margin-top: 24px; }
.comments-section h3 { font-size: 16px; margin-bottom: 16px; }
.comment-form { display: flex; gap: 10px; margin-bottom: 20px; }
.comment-input-wrapper { flex: 1; }
.comment-input-wrapper textarea {
    width: 100%; background: transparent; border: none;
    border-bottom: 1px solid var(--border); outline: none;
    color: var(--text); font-family: inherit; font-size: 14px;
    padding: 4px 0; resize: none; transition: border-color .15s;
}
.comment-input-wrapper textarea:focus { border-color: var(--text); }
.comment-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.comment { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-header strong { font-size: 13px; }
.comment-time { font-size: 12px; color: var(--text3); }
.comment p { font-size: 14px; color: var(--text2); }

/* === AUTH === */
.auth-container {
    max-width: 420px; margin: 40px auto; padding: 0 16px;
}
.auth-card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 12px; padding: 32px;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo-svg { height: 24px; color: var(--text); }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.auth-tab {
    flex: 1; text-align: center; padding: 10px;
    color: var(--text2); font-weight: 500;
    border-bottom: 2px solid transparent; transition: all .15s;
}
.auth-tab.active { color: var(--text); border-bottom-color: white; }
.auth-tab:hover { color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* === FORMS === */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text2); }
.form-group input, .form-group textarea, .form-group select {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 14px;
    color: var(--text); font-family: inherit; font-size: 14px;
    outline: none; transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--blue);
}
.form-group small { font-size: 12px; color: var(--text3); }
.required { color: var(--accent); }
.select-input { appearance: none; cursor: pointer; }
.radio-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px; border-radius: var(--radius); cursor: pointer;
    border: 1px solid var(--border); margin-bottom: 6px; transition: border-color .15s;
}
.radio-option:hover { border-color: var(--text3); }
.radio-option input { margin-top: 3px; }
.radio-option strong { display: block; font-size: 13px; }
.radio-option small { color: var(--text3); font-size: 12px; }

/* === UPLOAD === */
.upload-container { max-width: 1000px; }
.upload-container h1 { font-size: 22px; margin-bottom: 24px; }
.upload-grid { display: grid; grid-template-columns: 1fr 340px; gap: 32px; }
.file-drop-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 32px; text-align: center; cursor: pointer;
    transition: border-color .15s; position: relative;
}
.file-drop-zone:hover, .file-drop-zone.drag-over { border-color: var(--blue); }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-zone-content svg { width: 48px; height: 48px; color: var(--text3); margin: 0 auto 12px; }
.drop-zone-content p { color: var(--text2); margin-bottom: 4px; }
.drop-zone-content small { color: var(--text3); font-size: 12px; }
.link { color: var(--blue); }
.file-selected { padding: 8px; background: var(--bg3); border-radius: 4px; font-size: 13px; }
.thumbnail-upload {
    border: 2px dashed var(--border); border-radius: var(--radius);
    aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s;
}
.thumbnail-upload:hover { border-color: var(--blue); }
.thumb-placeholder { text-align: center; color: var(--text3); }
.thumb-placeholder svg { width: 32px; height: 32px; margin: 0 auto 8px; }
.thumb-placeholder p { font-size: 12px; }
#thumbPreview img { width: 100%; height: 100%; object-fit: cover; }

/* === CHANNEL PAGE === */
.channel-banner { height: 200px; overflow: hidden; }
.channel-banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-placeholder { height: 100%; background: linear-gradient(135deg, var(--bg3), var(--bg4)); }
.channel-header { background: var(--bg); padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.channel-header-inner {
    display: flex; align-items: flex-end; gap: 20px;
    flex-wrap: wrap;
}
.channel-avatar-large {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--bg);
}
.channel-avatar-large.placeholder {
    width: 80px; height: 80px; background: var(--accent);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; border-radius: 50%;
}
.channel-meta { flex: 1; }
.channel-meta h1 { font-size: 24px; margin-bottom: 4px; }
.channel-meta p { font-size: 13px; color: var(--text2); }
.channel-bio { margin-top: 8px; color: var(--text2); font-size: 14px; }
.channel-actions { display: flex; gap: 8px; }

/* === SEARCH PAGE === */
.search-page { max-width: 1000px; }
.search-header { margin-bottom: 16px; }
.search-header h1 { font-size: 20px; margin-bottom: 4px; }
.search-header p { color: var(--text2); font-size: 13px; }
.search-header em { font-style: normal; color: var(--text); }
.search-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.search-filters span { color: var(--text2); font-size: 13px; }
.filter-btn {
    padding: 6px 12px; border-radius: 8px;
    background: var(--bg3); font-size: 13px; color: var(--text2); transition: all .15s;
}
.filter-btn:hover { background: var(--bg4); color: var(--text); }
.filter-btn.active { background: var(--text); color: var(--bg); }

/* === EMPTY STATE === */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 20px; text-align: center; gap: 16px;
}
.empty-state svg { width: 64px; height: 64px; color: var(--text3); }
.empty-state p { color: var(--text2); font-size: 16px; }

/* === ALERTS === */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 14px; margin-bottom: 16px;
}
.alert-error { background: rgba(255,0,0,.1); color: #ff6b6b; border: 1px solid rgba(255,0,0,.2); }
.alert-success { background: rgba(0,200,100,.1); color: #4caf50; border: 1px solid rgba(0,200,100,.2); }

/* === PAGINATION === */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.page-btn {
    padding: 8px 14px; background: var(--bg3); border-radius: var(--radius);
    color: var(--text); font-size: 14px; transition: background .15s;
}
.page-btn:hover { background: var(--bg4); }
.page-btn.active { background: var(--text); color: var(--bg); }

/* === FOOTER === */
.site-footer {
    background: var(--bg2); border-top: 1px solid var(--border);
    margin-left: var(--sidebar-w); padding: 20px 24px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner p { font-size: 13px; color: var(--text3); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 13px; color: var(--text3); transition: color .15s; }
.footer-links a:hover { color: var(--text); }

/* === VOTE DISPLAY === */
.vote-display {
    display: flex; align-items: center; gap: 4px;
    font-size: 14px; color: var(--text2); padding: 8px 0;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .watch-layout { grid-template-columns: 1fr; }
    .watch-sidebar { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
    .watch-sidebar .video-card { flex-direction: column; }
    .watch-sidebar .video-thumbnail { width: 100%; height: auto; }
}
@media (max-width: 900px) {
    .upload-grid { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .main-content { margin-left: 0; }
    .site-footer { margin-left: 0; }
}
@media (max-width: 600px) {
    .main-content { padding: 16px; }
    .video-grid { grid-template-columns: 1fr; }
    .header-center { display: none; }
    .channel-header-inner { flex-direction: column; align-items: flex-start; }
}
