:root {
    --white: #ffffff;
    --black: #0f0f0f;
    --dark-gray: #717171;
    --light-gray: #aaaaaa;
    --red: #ff0000;
    --duration-bg: rgba(0, 0, 0, 0.8);
    --card-width: 400px;
}

body {
    background-color: var(--black);
    color: var(--white);
    font-family: Roboto, Arial, sans-serif;
}

#page-container {
    display: grid;
    min-height: 100vh;
    margin: 0;
    padding: 0;

    grid-template-columns: 60px 1fr;
    grid-template-rows: 56px 1fr;
    
    grid-template-areas:
    "header header"
    "sidebar content";
}

/* --- HEADER --- */
#header {
    grid-area: header;
}

#fixed-header { 
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin-right: 0;
    justify-content: space-between;
    align-items: center;
    
    color: var(--white);
    background-color: var(--black);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 16px;
    margin: 0;

    box-sizing: border-box;
    height: 56px;

    z-index: 100;
}

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

.icon {
    font-size: 1.25em;
    cursor: pointer;
}

.icon img {
    width: 1.5em;
}

#hamenu {
    margin: 0 16px;
    padding: 8px;
    border-radius: 50%;
}

#hamenu img{
    width: 1em;
    margin: auto;
}

#hamenu:hover {
    background: #303030;
}

#logo {
    display: flex;
    align-items: center;
}

#logo img {
    width: 2em;
    filter: hue-rotate(180deg);
    margin: 0;
}

#logo span{
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--white);
    margin: 0;
    padding: 0;
}

.header-center {
    display: flex;
}

.header-center input {
    background-color: #121212;
    border: 1px solid #303030;
    color: var(--white);
    padding: 8px 12px;
    border-radius: 40px 0 0 40px;
    width: 50vw;
    max-width: 500px;
    min-width: 150px;
    outline: none;
}

button {
    padding: 8px;
    margin: 0;
    border-radius: 50%;
    background: transparent;
    border: transparent;
}

.header-center button {
    background-color: #303030;
    color: var(--white);
    padding: 8px;
    margin: 0 5px;
    border: 1px solid #303030;
    border-radius: 50%;
    cursor: pointer;
}

.header-center .search {
    margin: 0;
    padding: 8px 16px;
    border-radius: 0 40px 40px 0;
}

.header-center button.search {
    margin: 0;
    padding: 8px 16px;
    border-radius: 0 40px 40px 0;
}

button:hover{
    background: #474747;
    box-shadow: inset 0 0 0 1px #575757;
}

/* --- SIDEBAR --- */
#sidebar {
    grid-area: sidebar;
}

#fixed-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;

    color: var(--white);
    background-color: var(--black);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    
    box-sizing: border-box;
    height: 100%;

    z-index: 99;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;

    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;

    padding: 24px 20px;
    border-radius: 12px;
}

.nav-item:hover {
    background-color: #272727;
}

.nav-item.active {
    background-color: #3f3f3f;
    font-weight: bold;
}

#sidebar hr {
    border: none;
    border-right: 1px solid #303030;
    margin: 8px 0;
}

/* --- CONTENT AREA --- */
#content-area {
    grid-area: content;
    margin: 0;
    padding: 0;
    padding-left: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
    gap: 16px;
    padding: 16px;
}

/* -- VIDEO CARD -- */
.card {
    width: 100%;
    padding: 8px;
    border-radius: 12px;
    transition: background-color 0.2s ease;

    margin: 0;
    color: var(--white);

    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
}

.card:hover {
    background-color:  rgba(138, 138, 138, 0.374);
}

.card.SciShow:hover {
    background-color:  rgba(46, 141, 31, 0.374);
}
.card.TED-Ed:hover {
    background-color:  rgba(59, 31, 141, 0.374);
}
.card.Minecraft:hover {
    background-color:  rgba(31, 141, 121, 0.374);
}
.card.Vsauce:hover {
    background-color:  rgba(141, 82, 31, 0.374);
}
.card.RationalAnimations:hover {
    background-color:  rgba(101, 141, 31, 0.374);
}
.card.Veritasium:hover {
    background-color:  rgba(31, 53, 141, 0.374);
}
.card.Kurzgesagt:hover {
    background-color:  rgba(31, 125, 141, 0.374);
}
.card.Madyeti47:hover {
    background-color:  rgba(141, 31, 75, 0.374);
}
.card.IBM:hover {
    background-color:  rgba(31, 61, 141, 0.374);
}
.card.MinuteEarth:hover {
    background-color:  rgba(119, 119, 10, 0.374);
}
.card.FilmTheory:hover {
    background-color:  rgba(141, 29, 29, 0.374);
}

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

.thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin-bottom: 12px;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    touch-action: none;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.2s ease-in-out;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;

    background-color: var(--duration-bg);
    padding: 2px 4px;
    border-radius: 4px;
    
    color: var(--white);
    line-height: 1.2;
    font-size: 0.75rem;
    font-weight: 500;

    z-index: 2;
}

.details {
    display: flex;
    gap: 12px;
    padding-right: 24px;
}

.pfp {
    margin-right: 8px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.pfp img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    user-select: none;
    pointer-events: none;
}

.title-cname-stats {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    
    color: var(--white);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    max-height: 2.8em;

    margin-bottom: 4px;
    overflow: hidden;
}

.cname,
.stats {
    font-size: 0.85rem;
    color: var(--light-gray);
    line-height: 1.3;
}

.cname:hover {
    color: var(--white);
}

.stats {
    margin-top: 2px;
}

.menu-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: right;
    align-items: flex-start;
    padding-top: 2px;
    padding-left: auto;
    cursor: pointer;
    color: var(--white);
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.menu-icon::before {
    content: "\22EE";
    line-height: 1;
    font-weight: bold;
}

@media (max-width: 935px) {
    :root {
        --card-width: 300px;
    }
    .header-center input {
        width: 30vw;
        max-width: 250px;
    }
}

@media (max-width: 650px) {
    .header-center input {
        display: none; 
    }

    .header-center button {
        background-color: transparent;
        color: var(--white);
        padding: 8px;
        margin: 0;
        border: transparent;
        border-radius: 50%;
        cursor: pointer;
    }

    .header-center button.search {
        margin: 0;
        padding: 8px;
        border-radius: 50%;
    }

    button:hover{
        background: #474747;
        box-shadow: inset 0 0 0 1px #575757;
    }

    #fixed-header {
        justify-content: space-between;
    }
}
