:root {
    --primary-color: #ff0000;
    --bg-color: #f9f9f9;
    --sidebar-bg: #fff;
    --text-color: #0f0f0f;
    --secondary-text: #606060;
    --border-color: #ccc;
    --header-height: 56px;
    --sidebar-width: 240px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    /* Prevent horizontal scroll from hidden sidebar */
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Auth Pages */
.signInContainer {
    background-color: #efefef;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.column {
    background-color: #fff;
    min-width: 450px;
    padding: 20px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    text-align: center;
}

.column .header {
    padding: 20px;
}

.column .header h3 {
    font-size: 24px;
    font-weight: 400;
    margin: 0;
    padding-bottom: 20px;
}

.column .header span {
    font-size: 14px;
}

.column form {
    display: flex;
    flex-direction: column;
}

.column form input[type="text"],
.column form input[type="email"],
.column form input[type="password"] {
    font-size: 14px;
    margin: 10px 0;
    border: none;
    border-bottom: 1px solid #dedede;
    padding: 10px;
    outline: none;
}

.column form input[type="submit"] {
    background-color: #4285f4;
    color: #fff;
    height: 36px;
    width: 100%;
    border: none;
    border-radius: 3px;
    font-weight: 500;
    margin-top: 10px;
    margin-bottom: 20px;
    cursor: pointer;
}

.signInMessage {
    font-size: 14px;
    font-weight: 400;
    color: #212121;
}

.errorMessage {
    color: #f00;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    display: block;
}

/* Header */
#mastheadContainer {
    width: 100%;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e5e5e5;
}

.logoContainer {
    display: flex;
    align-items: center;
}

.logoContainer img {
    height: 24px;
    margin-left: 10px;
}

.searchBarContainer {
    flex: 1;
    display: flex;
    justify-content: center;
}

.searchBarContainer form {
    display: flex;
    width: 60%;
    max-width: 600px;
}

.searchBarContainer .searchBar {
    width: 100%;
    height: 32px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
    border-right: none;
    font-size: 14px;
}

.searchBarContainer .searchButton {
    height: 32px;
    width: 65px;
    background-color: #f8f8f8;
    border: 1px solid #d3d3d3;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.searchBarContainer .searchButton img {
    height: 20px;
    width: 20px;
    opacity: 0.6;
}

.rightIcons {
    display: flex;
    align-items: center;
    min-width: 225px;
    justify-content: flex-end;
}

.rightIcons a {
    padding: 0 10px;
}

.rightIcons .upload {
    height: 24px;
}

.rightIcons .profile {
    height: 32px;
    width: 32px;
    border-radius: 50%;
}

/* Sidebar */
#sideNavContainer {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    height: calc(100vh - var(--header-height));
    /* Full height minus header */
    padding-top: 10px;
    position: fixed;
    top: var(--header-height);
    left: 0;
    overflow-y: auto;
    z-index: 900;
}

/* Main Section */
#mainSectionContainer {
    padding-top: var(--header-height);
    padding-left: 0;
    /*  Default to 0 */
    display: flex;
    transition: padding-left 0.2s;
}

/* When this class is added via JS, content moves over */
#mainSectionContainer.leftPadding {
    padding-left: var(--sidebar-width);
}

#mainContentContainer {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Video Grid Item */
.videoSection {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.videoSection a {
    display: block;
    /* Ensure the anchor behaves like a block container */
    margin-right: 16px;
    margin-bottom: 24px;
    /* Optional: Remove default anchor styling if needed, though reset is generic */
}

.videoGridItem {
    /* margins moved to .videoSection a */
    width: 250px;
    /* Fixed width mostly */
    cursor: pointer;
}

.thumbnail {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details {
    display: flex;
    margin-top: 8px;
}

.author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-color);
    line-height: 1.4rem;
    max-height: 2.8rem;
    overflow: hidden;
}

.username,
.stats {
    font-size: 12px;
    color: var(--secondary-text);
}

.duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

/* Watch Page */
.watchLeftColumn {
    flex: 1;
}

.watchLeftColumn .videoPlayer {
    width: 100%;
    /* YouTube style black background container */
    background-color: #000;
    max-height: 80vh;
    /* Limit height to viewport */
    display: flex;
    justify-content: center;
}

.watchLeftColumn .videoPlayer video {
    width: 100%;
    height: auto;
    max-height: 80vh;
}

.videoInfo {
    width: 100%;
    padding: 20px 0 8px 0;
    border-bottom: 1px solid #dedede;
}

.videoInfo h1 {
    display: block;
    overflow: hidden;
    font-size: 18px;
    font-weight: 400;
    line-height: 24px;
    margin: 0 0 10px 0;
}

.videoInfo .bottomSection {
    display: flex;
}

.videoInfo .viewCount {
    color: #606060;
    font-size: 16px;
    flex: 1;
}

.videoInfo .controls {
    flex: 1;
    text-align: right;
}

.videoInfo .controls button {
    padding: 0;
    background-color: transparent;
    border: none;
    color: #606060;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 10px;
}

.videoInfo .controls button img {
    height: 20px;
    width: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

.descriptionContainer {
    margin-top: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #dedede;
    padding-bottom: 30px;
}

.descriptionContainer h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.description {
    font-size: 14px;
    white-space: pre-wrap;
}

.commentSection {
    margin-top: 20px;
    padding-bottom: 20px;
}