* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* HEADER */

.header {
    background: white;
    color: #333;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 1rem 2rem;

    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header nav {
    display: flex;
    gap: 16px;
    margin-top: 0; /* remove stacking behavior */
    align-items: center;
}


.header nav a {
    color: black;
    text-decoration: none;
    margin-right: 1rem;
}

/* LOGO */

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;  /* removes underline */
    color: inherit;         /* keeps text color */
}

.logo-image {
    width: 50px;
    height: 50px;

    min-width: 50px;

    object-fit: cover;

    border-radius: 12px;

    display: block;
}

.logo-text {
    margin: 0;
}

/* SEARCH BAR */

.search-bar {
    flex: 1;

    display: flex;
    justify-content: center;
    margin: 0 2rem;
}

.search-bar input {
    width: 100%;
    max-width: 500px;

    padding: 10px 16px;

    border: 1px solid #ccc;
    border-radius: 999px; /* makes it pill-shaped */

    outline: none;

    font-size: 14px;

    transition: 0.2s ease;
    background: url("https://cdn-icons-png.flaticon.com/512/622/622669.png") no-repeat 10px center;
    background-size: 16px;
    padding-left: 36px;
}

.search-bar input:focus {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

/* MAIN LAYOUT */

.layout {
    display: flex;
    align-items: flex-start; /* IMPORTANT */
    width: 100%;
}

/* SIDEBAR */



.sidebar {
    width: 220px;
    min-height: calc(100vh - 70px);

    padding: 1rem;

    position: sticky;
    top: 70px;

    align-self: flex-start;

    background: #fff;
    border-right: 1px solid #eee;

    box-shadow: 1px 0 6px rgba(0,0,0,0.05);
}

.sidebar a {
    text-decoration: none;
    color: #333;

    display: block;
    padding: 8px 10px;
    border-radius: 6px;

    transition: all 0.2s ease;
}

/* hover */
.sidebar a:hover {
    background: #f0f6ff;
    color: #007bff;
}

/* active (selected page) */
.sidebar a.active {
    background: #e6f0ff;
    color: #007bff;
    font-weight: 600;
    border-left: 3px solid #007bff;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    text-decoration: none;
    color: #333;
}

/* CONTENT */


.content {
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

/* VIDEO GRID */

.video-grid {
    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));

    gap: 24px;

    margin-top: 2rem;
}

/* VIDEO CARD */

.video-card {
    background: white;

    border-radius: 12px;

    overflow: hidden;

    box-shadow: 0 2px 8px rgba(0,0,0,0.08);

    transition: transform 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
}

/* VIDEO */

.video-card iframe {
    width: 100%;
    aspect-ratio: 16 / 9;

    border: none;

    display: block;
}

/* TEXT */

.video-card h3 {
    margin: 1rem 1rem 0.5rem;
}

.video-card p {
    margin: 0 1rem 1rem;
    color: #666;
}

/* FOOTER */

.footer {

    background: #333;
    color: white;

    text-align: center;

    padding: 1rem;

    width: 100%;

}



.menu-toggle {
    display: none;

}


@media (max-width: 768px) {

    /* HEADER */
    .header {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 1rem;
    }

    .search-bar {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        margin: 0;
    }

    .search-bar input {
        max-width: 100%;
    }

    .logo-section {
        flex-shrink: 0;
    }


    /* HAMBURGER */

    .menu-toggle {
        display: block;

        font-size: 24px;

        background: none;
        border: none;

        cursor: pointer;
    }

    /* SIDEBAR */

    .sidebar {
        position: fixed;

        top: 70px;
        left: -240px;

        width: 220px;
        height: calc(100vh - 70px);

        background: white;

        z-index: 2000;

        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    /* CONTENT */

    .content {
        width: 100%;
        margin-left: 0;
        padding: 1rem;
    }

    /* VIDEO GRID */

    .video-grid {
        grid-template-columns: 1fr;
    }

    /* OPTIONAL */

    .header nav {
        display: none;
    }
}

