/*
Theme Name: CEO Video Pro
Description: Professional YouTube-style Video Theme with Responsive Single Video Pages, Comments, and Like buttons.
Version: 2.0.0
Author: CEO Video
*/

:root {
    --yt-bg: #f9f9f9;
    --yt-white: #ffffff;
    --yt-text-primary: #0f0f0f;
    --yt-text-secondary: #606060;
    --yt-border: #e5e5e5;
    --yt-hover: #f2f2f2;
    --yt-red: #ff0000;
    --yt-btn-bg: #f2f2f2;
    --yt-btn-hover: #e5e5e5;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--yt-bg);
    color: var(--yt-text-primary);
    font-family: "Roboto", Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- YouTube Header --- */
header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--yt-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-icon, .header-icon {
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}
.menu-icon:hover, .header-icon:hover { background: var(--yt-hover); }

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--yt-text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    font-family: "YouTube Sans", "Roboto", sans-serif;
}
.logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 22px;
    background-color: var(--yt-red);
    border-radius: 6px;
    position: relative;
}
.play-triangle {
    color: #ffffff;
    font-size: 10px;
    margin-left: 2px;
}

/* Search */
.search-form {
    display: flex;
    align-items: center;
    flex: 0 1 600px;
}
.search-form input[type="search"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--yt-border);
    border-radius: 40px 0 0 40px;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    background: transparent;
}
.search-form input[type="search"]:focus { border-color: #1c62b9; }
.search-btn {
    height: 40px;
    padding: 0 24px;
    background: #f8f8f8;
    border: 1px solid var(--yt-border);
    border-left: none;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
    font-size: 16px;
}
.search-btn:hover { background: #f0f0f0; }

/* --- Sidebar --- */
aside.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 240px;
    height: calc(100vh - 56px);
    background: var(--yt-white);
    overflow-y: auto;
    padding: 12px;
    z-index: 999;
}
aside.sidebar a {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 12px;
    color: var(--yt-text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}
aside.sidebar a:hover, aside.sidebar a.active { background-color: var(--yt-hover); }
aside.sidebar hr { border-top: 1px solid var(--yt-border); border-bottom: none; margin: 12px 0; }

/* --- Main Layout --- */
main.site-content {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px;
}
@media (max-width: 1200px) {
    aside.sidebar { width: 72px; padding: 6px; }
    aside.sidebar span { display: none; }
    aside.sidebar a { flex-direction: column; gap: 4px; font-size: 10px; padding: 14px 0; text-align: center; }
    main.site-content { margin-left: 72px; }
}
@media (max-width: 768px) {
    aside.sidebar { display: none; }
    main.site-content { margin-left: 0; padding: 12px; margin-top: 56px; }
    .search-form { display: none; }
}

/* --- Homepage Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px 16px;
}
.post-item { text-decoration: none; color: inherit; display: block; }
.post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    position: relative;
    margin-bottom: 12px;
}
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.post-title { font-size: 16px; font-weight: 600; margin: 0 0 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-author, .post-views-date { font-size: 14px; color: var(--yt-text-secondary); margin: 0; }

/* ========================================================
   SINGLE VIDEO PAGE (WATCH PAGE)
   ======================================================== */
.watch-layout {
    display: flex;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
}
.primary-col { flex: 1; min-width: 0; }
.secondary-col { width: 400px; flex-shrink: 0; }

/* Responsive Video Embed (16:9) */
.responsive-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    margin-bottom: 16px;
}
.responsive-video iframe,
.responsive-video object,
.responsive-video embed,
.responsive-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video Info */
.video-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px 0;
}
.video-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

/* Channel & Subscribe */
.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.channel-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #ccc; overflow: hidden;
}
.channel-avatar img { width: 100%; height: 100%; }
.channel-details { display: flex; flex-direction: column; margin-right: 12px; }
.channel-name { font-weight: 600; font-size: 16px; }
.channel-subs { font-size: 12px; color: var(--yt-text-secondary); }
.subscribe-btn {
    background: var(--yt-text-primary); color: #fff; border: none;
    padding: 10px 16px; border-radius: 20px; font-weight: 600; cursor: pointer;
}
.subscribe-btn:hover { opacity: 0.9; }

/* Action Buttons (Like, Dislike, Share) */
.action-buttons {
    display: flex;
    gap: 8px;
}
.action-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--yt-btn-bg); border: none; padding: 8px 16px;
    border-radius: 18px; font-weight: 500; cursor: pointer; font-size: 14px;
}
.action-btn:hover { background: var(--yt-btn-hover); }
.btn-group {
    display: flex; background: var(--yt-btn-bg); border-radius: 18px;
}
.btn-group .action-btn { background: transparent; border-radius: 0; }
.btn-group .action-btn:first-child { border-radius: 18px 0 0 18px; }
.btn-group .action-btn:last-child { border-radius: 0 18px 18px 0; border-left: 1px solid #ccc; }
.btn-group .action-btn:hover { background: var(--yt-btn-hover); }

/* Description Box */
.video-description-box {
    background: var(--yt-btn-bg);
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}
.desc-meta { font-weight: 600; margin-bottom: 8px; }

/* Comments Section */
.comments-header { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.comment-form { display: flex; gap: 16px; margin-bottom: 32px; }
.comment-form .channel-avatar { flex-shrink: 0; }
.comment-input-wrapper { flex: 1; display: flex; flex-direction: column; }
.comment-input-wrapper input {
    border: none; border-bottom: 1px solid var(--yt-text-secondary);
    background: transparent; outline: none; padding: 4px 0; font-size: 14px; margin-bottom: 8px;
}
.comment-input-wrapper input:focus { border-bottom: 2px solid var(--yt-text-primary); }
.comment-actions { display: flex; justify-content: flex-end; gap: 8px; }
.cancel-btn, .submit-btn {
    border: none; padding: 8px 16px; border-radius: 18px; cursor: pointer; font-weight: 500; font-size: 14px;
}
.cancel-btn { background: transparent; }
.cancel-btn:hover { background: var(--yt-btn-hover); }
.submit-btn { background: #065fd4; color: #fff; }

/* Comment List */
.comment-item { display: flex; gap: 16px; margin-bottom: 24px; }
.comment-body { flex: 1; }
.comment-author { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.comment-date { font-weight: 400; color: var(--yt-text-secondary); font-size: 12px; }
.comment-text { font-size: 14px; margin-bottom: 8px; }
.comment-footer { display: flex; align-items: center; gap: 12px; }
.comment-action { background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 4px; color: var(--yt-text-secondary); padding: 4px; border-radius: 50%; }
.comment-action:hover { background: var(--yt-btn-hover); }
.reply-btn { background: none; border: none; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 16px; padding: 6px 12px; }
.reply-btn:hover { background: var(--yt-btn-hover); }

/* Related Videos (Sidebar of Single Page) */
.related-video-item { display: flex; gap: 8px; margin-bottom: 12px; text-decoration: none; color: inherit; }
.related-thumb { width: 168px; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; flex-shrink: 0; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info { display: flex; flex-direction: column; }
.related-title { font-size: 14px; font-weight: 600; margin: 0 0 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-author, .related-meta { font-size: 12px; color: var(--yt-text-secondary); }

/* Mobile Single Page Adjustments */
@media (max-width: 1000px) {
    .watch-layout { flex-direction: column; }
    .secondary-col { width: 100%; }
    .responsive-video { border-radius: 0; margin-left: -12px; margin-right: -12px; width: calc(100% + 24px); } /* Full bleed on mobile */
}
@media (max-width: 600px) {
    .video-toolbar { flex-direction: column; align-items: flex-start; }
    .action-buttons { width: 100%; overflow-x: auto; padding-bottom: 8px; }
}
