/* css/video_page.css */

/* Main wrapper for the entire video page content */
.video-page-container {
    max-width: 1200px; /* Overall max width for the page content */
    margin: 20px auto;
    padding: 0 15px; /* Add horizontal padding for smaller screens */
}

/* Section containing the primary video player/details and the sidebar (related videos) */
.main-video-grid-layout {
    display: grid;
    /* Ratio: Main content 3 parts, Sidebar 1 part (~25% width) */
    grid-template-columns: 3fr 1fr; 
    gap: 20px; /* Space between the two columns */
    margin-bottom: 40px;
}

.primary-content {
    background-color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 20px;
}

.secondary-content { /* This is the sidebar for "Related Videos" */
    padding: 0;
    color: #f0f0f0;
}

.secondary-content .sidebar-title {
    font-size: 1.4em;
    color: #ff4500;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    text-align: left;
}

.sidebar-video-list {
    display: flex;
    flex-direction: column; /* Stack videos vertically */
    gap: 10px; /* Reduced gap */
}

/* Sidebar Card: Vertical (Thumbnail on Top, Title Below) */
.sidebar-card {
    background-color: #2a2a2a;
    display: flex;
    flex-direction: column; 
    align-items: flex-start; 
    padding: 5px; /* TIGHTER CARD PADDING */
    border-radius: 6px;
    box-shadow: none;
    transition: background-color 0.2s ease;
}
.sidebar-card:hover {
    background-color: #333;
    transform: none;
    box-shadow: none;
}

/* Thumbnail wrapper to enforce 16:9 ratio and scaling */
.sidebar-card .video-thumbnail {
    width: 100%;
    height: 0; 
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 0;
    margin-bottom: 5px; /* Space between thumbnail and title */
    border-radius: 4px;
}
.sidebar-card .video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.sidebar-card .play-overlay {
    font-size: 1.2em; /* Smaller play button */
    width: 25px;
    height: 25px;
}

/* Title styling adjusted for vertical card */
.sidebar-card .video-title {
    font-size: 0.9em; /* Smaller title font */
    margin: 0;
    padding: 0 5px 5px 5px; /* Horizontal padding */
    flex-grow: 1;
    max-height: 2.5em; /* Limit to 2 lines */
    line-height: 1.25; /* Tighter line height */
    color: #f0f0f0;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
}


/* --- Original video player and details --- */

.video-player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #000;
    border-radius: 6px;
}
.video-player-wrapper iframe,
.video-player-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background-color: #000;
}

.video-details {
    padding: 20px 0;
    color: #f0f0f0;
}

.video-details h1 {
    font-size: 2.2em;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.2;
}

.video-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #bbb;
    border-top: 1px solid #333;
    padding-top: 15px;
}
.video-meta-top .platform {
    font-weight: bold;
    color: #ff4500;
}

.interaction-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.interaction-buttons .button {
    background-color: #333;
    color: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.interaction-buttons .button:hover {
    background-color: #555;
}
.interaction-buttons .button.download-btn {
    background-color: #ff4500;
}
.interaction-buttons .button.download-btn:hover {
    background-color: #e63900;
}

.video-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    margin-bottom: 20px;
}
.video-description h2 {
    font-size: 1.5em;
    color: #fff;
    margin-bottom: 10px;
}
.video-description p {
    font-size: 1em;
    color: #ccc;
    line-height: 1.8;
}

.video-description .description-content {
    transition: max-height 0.3s ease-out;
}
.video-description .read-more-btn {
    background-color: #333;
    color: #f0f0f0;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    transition: background-color 0.3s ease;
    display: none;
}
.video-description .read-more-btn:hover {
    background-color: #555;
}

.video-tags, .video-cast {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
    font-size: 0.95em;
    color: #bbb;
}
.video-tags span, .video-cast span {
    font-weight: bold;
    color: #ff4500;
    margin-right: 5px;
}
.video-tags a {
    color: #f0f0f0;
    text-decoration: none;
    background-color: #333;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
    transition: background-color 0.3s ease;
}
.video-tags a:hover {
    background-color: #555;
}

/* Comments Section */
.comments-section {
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid #333;
}
.comments-section h2 {
    font-size: 1.8em;
    color: #fff;
    margin-bottom: 25px;
}
.comment-form-login-prompt {
    background-color: #2a2a2a;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    color: #ccc;
}
.comment-form-login-prompt a {
    color: #ff4500;
    text-decoration: none;
    font-weight: bold;
}
.comment-form-login-prompt a:hover {
    text-decoration: underline;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-item {
    background-color: #2a2a2a;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #bbb;
}
.comment-header .comment-author {
    font-weight: bold;
    color: #fff;
    margin-right: 10px;
}
.comment-header .comment-time {
    font-size: 0.8em;
    color: #888;
}
.comment-text {
    font-size: 1em;
    color: #ccc;
    line-height: 1.6;
}
.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    font-size: 0.85em;
}
.comment-actions button {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}
.comment-actions button:hover {
    color: #ff4500;
}
.replies {
    list-style: none;
    padding-left: 30px;
    margin-top: 10px;
}
.comment-item.reply {
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: #333;
    border-left: 3px solid #ff4500;
}
.comments-load-more-container {
    text-align: center;
    margin-top: 20px;
}
.comments-load-more-container .load-more-comments-btn {
    background-color: #ff4500;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    display: none;
}
.comments-load-more-comments-btn:hover {
    background-color: #e63900;
}


/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    /* Use fixed 250px sidebar width on slightly smaller screens */
    .main-video-grid-layout {
        grid-template-columns: 1fr 250px;
    }
}

@media (max-width: 768px) {
    .video-page-container {
        padding: 0 10px;
        margin: 10px auto;
    }
    .main-video-grid-layout {
        grid-template-columns: 1fr; /* Stack main content and sidebar vertically */
        gap: 30px;
    }
    .primary-content {
        border-radius: 0;
        box-shadow: none;
        padding: 10px;
    }
    .secondary-content {
        border-top: 1px solid #333;
        padding-top: 20px;
    }
    .secondary-content .sidebar-title {
        text-align: center;
    }
    .sidebar-video-list {
        flex-direction: row; /* Horizontal flow on tablet/mobile */
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    /* Revert sidebar card styling for small screen flow */
    .sidebar-card {
        flex-direction: column; 
        width: 150px; /* Fixed width for small cards */
        align-items: flex-start;
        padding: 5px;
    }
    .sidebar-card .video-thumbnail {
        width: 100%;
        height: 0;
        padding-bottom: 56.25%;
        margin-right: 0;
        margin-bottom: 5px;
    }
    .sidebar-card .video-title {
        text-align: left;
        font-size: 0.85em;
        padding: 0 5px 5px 5px;
    }
}

@media (max-width: 480px) {
    .video-details h1 {
        font-size: 1.5em;
    }
    .comments-section h2 {
        font-size: 1.5em;
    }
    /* On very small mobile, let cards flow slightly more dense */
    .sidebar-video-list {
        flex-direction: row;
        align-items: flex-start;
    }
    .sidebar-card {
        width: 45%; /* Two cards roughly side-by-side */
        max-width: none;
        flex-direction: column;
        align-items: flex-start;
    }
}