/*
Theme Name: YouTube Style Theme
Theme URI: https://example.com
Author: Custom Theme
Author URI: https://example.com
Description: A YouTube-inspired WordPress theme with custom video post functionality
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: youtube-theme
Tags: video, youtube, custom-design
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", "Arial", sans-serif;
    background-color: #0f0f0f;
    color: #fff;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 2000;
    border-bottom: 1px solid #272727;
}

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

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.menu-toggle:hover {
    background-color: #272727;
}

.menu-icon {
    width: 24px;
    height: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-color: #ff0000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.logo-text {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
}

.search-form {
    display: flex;
    align-items: center;
}

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

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

.search-button {
    height: 40px;
    padding: 0 20px;
    background-color: #222222;
    border: 1px solid #303030;
    border-left: none;
    border-radius: 0 40px 40px 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background-color: #2a2a2a;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-search {
    width: 40px;
    height: 40px;
    background-color: #222222;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-search:hover {
    background-color: #2a2a2a;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 240px;
    height: calc(100vh - 56px);
    background-color: #0f0f0f;
    overflow-y: auto;
    padding: 12px 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-240px);
}

.sidebar-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #272727;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 500;
    padding: 8px 24px;
    color: #fff;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: #fff;
    font-size: 14px;
    transition: background-color 0.2s;
}

.sidebar-menu a:hover {
    background-color: #272727;
}

.sidebar-menu a.active {
    background-color: #272727;
}

/* Main Content Area */
.site-content {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px;
    transition: margin-left 0.3s ease;
}

.site-content.expanded {
    margin-left: 0;
}

/* Tags Bar for Home */
.tags-bar {
    position: sticky;
    top: 56px;
    background-color: #0f0f0f;
    padding: 12px 0;
    margin: -24px -24px 24px -24px;
    padding-left: 24px;
    padding-right: 24px;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 100;
    border-bottom: 1px solid #272727;
}

.tags-bar::-webkit-scrollbar {
    height: 0;
}

.tag-button {
    display: inline-block;
    padding: 8px 12px;
    margin-right: 12px;
    background-color: #272727;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag-button:hover {
    background-color: #3f3f3f;
}

.tag-button.active {
    background-color: #f1f1f1;
    color: #0f0f0f;
}

/* Video Grid for Home */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.video-card {
    cursor: pointer;
    transition: transform 0.2s;
}

.video-card:hover {
    transform: scale(1.02);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background-color: #272727;
    border-radius: 12px;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-info {
    padding: 12px 0;
}

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

.video-meta {
    font-size: 12px;
    color: #aaa;
}

/* Single Post Video Player */
.single-video-container {
    max-width: 1750px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
}

.video-main {
    flex: 1;
    min-width: 0;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

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

/* Ensure aiyap_video shortcode content fills container */
.video-player > div,
.video-player > p {
    width: 100%;
    height: 100%;
}

.video-player .aiyap-video-container,
.video-player .video-container {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Video Header */
.video-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.video-title-single {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #fff;
}

.video-meta-line {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #aaa;
}

.views-count {
    font-weight: 500;
}

.post-date {
    font-weight: 400;
}

/* Video Actions Wrapper */
.video-actions-wrapper {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ffffff1a;
    margin-bottom: 16px;
}

/* Video Actions Buttons */
.video-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #ffffff0d;
    border: none;
    border-radius: 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-button:hover {
    background-color: #ffffff1a;
}

.action-button.active {
    background-color: #3ea6ff;
    color: #fff;
}

.action-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.like-count {
    min-width: 20px;
    text-align: center;
}

/* Video Description with Read More */
.video-description {
    padding: 16px 20px;
    background-color: #ffffff0d;
    border-radius: 12px;
    margin-bottom: 20px;
}

.description-text {
    font-size: 14px;
    line-height: 1.7;
    color: #f1f1f1;
    margin-bottom: 8px;
}

.full-description {
    display: none;
}

.full-description.active {
    display: inline;
}

.short-description.hidden {
    display: none;
}

.read-more-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
}

.read-more-btn:hover {
    color: #fff;
}

.read-more-btn svg {
    transition: transform 0.3s;
}

.read-more-btn.expanded svg {
    transform: rotate(180deg);
}

/* Navigation Buttons at Bottom */
.video-navigation-bottom {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #ffffff1a;
}

.nav-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #ffffff0d;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-button:hover:not(:disabled) {
    background-color: #ffffff1a;
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-button svg {
    flex-shrink: 0;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    cursor: pointer;
    user-select: none;
}

.comments-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

.comments-title span {
    font-size: 20px;
}

.comments-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.comments-toggle-btn:hover {
    background-color: #ffffff1a;
}

.comments-toggle-btn svg {
    transition: transform 0.3s;
}

.comments-list {
    display: none;
    padding-top: 12px;
}

.comments-list.active {
    display: block;
}

/* Comment Item */
.comment {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    color: #fff;
}

/* Random avatar colors */
.comment:nth-child(1) .comment-avatar { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.comment:nth-child(2) .comment-avatar { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.comment:nth-child(3) .comment-avatar { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.comment:nth-child(4) .comment-avatar { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.comment:nth-child(5) .comment-avatar { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.comment:nth-child(6) .comment-avatar { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.comment:nth-child(7) .comment-avatar { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.comment:nth-child(8) .comment-avatar { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.comment:nth-child(9) .comment-avatar { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.comment:nth-child(10) .comment-avatar { background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%); }

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.comment-date {
    font-size: 12px;
    color: #aaa;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: #f1f1f1;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.comment-action {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 18px;
    transition: all 0.2s;
}

.comment-action:hover {
    background-color: #ffffff0d;
    color: #fff;
}

.comment-action svg {
    width: 18px;
    height: 18px;
}

/* Comment Form */
.comment-respond {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #ffffff1a;
}

.comment-reply-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #fff;
}

.comment-form-comment textarea {
    width: 100%;
    min-height: 80px;
    background-color: #121212;
    border: 1px solid #303030;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: #3ea6ff;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    background-color: #121212;
    border: 1px solid #303030;
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
}

.comment-form input:focus {
    outline: none;
    border-color: #3ea6ff;
}

.form-submit {
    margin-top: 12px;
}

.form-submit .submit {
    background-color: #3ea6ff;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.form-submit .submit:hover {
    background-color: #3a95e8;
}

/* Related Videos Sidebar */
.related-videos {
    width: 400px;
    flex-shrink: 0;
}

.related-videos-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ffffff1a;
}

.related-videos-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #fff;
}

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

.related-video-item {
    display: block;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

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

.related-video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #181818;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.related-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-video-item:hover .related-video-thumbnail img {
    transform: scale(1.05);
}

.video-preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    border-radius: 8px;
    pointer-events: none;
}

.default-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.video-hover-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.related-video-item:hover .video-hover-preview {
    opacity: 1;
}

.video-hover-preview svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.related-video-info {
    padding: 0 4px;
}

.related-video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 4px 0;
}

.related-video-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-views {
    font-size: 12px;
    color: #aaa;
}

/* Load More Button */
.load-more-related {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background-color: #ffffff0d;
    border: 1px solid #ffffff1a;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.load-more-related:hover {
    background-color: #ffffff1a;
}

.load-more-related svg {
    transform: rotate(90deg);
}

/* Infinite Scroll Loading */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #aaa;
}

.loading-spinner {
    border: 3px solid #272727;
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- PAGINATION FIX (Bigger + Visible + Modern) --- */
.nav-links a,
.nav-links span {
    display: inline-block;
    padding: 10px 18px !important;
    margin: 4px;
    font-size: 18px;
    font-weight: 600;
    background: #ffffff17;
    border: 2px solid #ffffff40;
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.25s ease;
}

/* Hover effect */
.nav-links a:hover {
    background: #ffffff33;
    border-color: #fff;
    transform: translateY(-2px);
}

/* Current page */
.nav-links .current {
    background: #ffffff;
    color: #000 !important;
    border-color: #fff;
}

/* Container center */
.nav-links {
    text-align: center;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* Make NEXT more visible */
.nav-links a.next,
.nav-links a[rel="next"] {
    background: #ff0051;
    border-color: #ff0051;
    color: #fff !important;
}

.nav-links a.next:hover,
.nav-links a[rel="next"]:hover {
    background: #ff2a6e;
}

/* Apply similar styles to all buttons */
.action-button,
.nav-button,
.tag-button,
.load-more-related,
.read-more-btn,
.form-submit .submit {
    transition: all 0.25s ease !important;
}

.action-button:hover,
.tag-button:hover,
.load-more-related:hover {
    transform: translateY(-2px);
}

.nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

/* Posts pagination wrapper */
.pagination {
    margin: 40px 0;
}

.posts-navigation,
.post-navigation {
    margin: 40px 0;
}

.posts-navigation .nav-links,
.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.posts-navigation .nav-previous,
.posts-navigation .nav-next,
.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    max-width: 48%;
}

.posts-navigation a,
.post-navigation a {
    display: block;
    padding: 12px 20px !important;
    background: #ffffff17;
    border: 2px solid #ffffff40;
    border-radius: 8px;
    color: #fff !important;
    text-decoration: none;
    transition: all 0.25s ease;
}

.posts-navigation a:hover,
.post-navigation a:hover {
    background: #ffffff33;
    border-color: #fff;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1280px) {
    .single-video-container {
        flex-direction: column;
    }
    
    .related-videos {
        width: 100%;
    }
    
    .related-videos-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-240px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .site-content {
        margin-left: 0;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .header-center {
        display: none;
    }
    
    .video-actions-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .video-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    
    .related-videos-list {
        grid-template-columns: 1fr;
    }
    
    .video-navigation-bottom {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-player {
        border-radius: 0;
        margin-left: -24px;
        margin-right: -24px;
        width: calc(100% + 48px);
    }
    
    .action-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .action-button span {
        display: none;
    }
    
    .like-count {
        display: block !important;
    }
}
