/* RESET & GLOBALS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: Arial, sans-serif;
}

/* LAYOUT WRAPPER */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
header {
    background: #333;
    color: white;
    height: 60px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.directory {
    margin-left: 60px;
    background: #ccc;
    width: fit-content;
    padding: 2px 20px 2px 5px;
    border: 3px solid;
}

/* MAIN CONTENT */
main {
    flex: 1;
    padding: 0px 60px;
    display: flex;
    flex-wrap: nowrap;
    height: calc(100% - 120px);
}

/* FOOTER */
footer {
    background: #333;
    color: white;
    height: 60px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back_icon {
    position: absolute;
    left: 30px;
    top: 30px;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1000;
}

a {
    white-space: nowrap;
    overflow-x: hidden;
}

.video_half_wrapper {
    flex: 1;
    overflow-y: scroll;
}

.video_container {
    padding: 30px 60px 30px 0px;
}

.video_wrapper {
    flex-grow: 1;
    max-width: 800px;
    margin-bottom: 16px;
}

.video_iframe {
    aspect-ratio: 16/9;
    border-radius: 4px;
    color: white;
    border: none;
    background: #888;
    display: block;
    width: 100%;
    /* height: 55vh; */
    max-height: 452px;
}

.video_description {
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: bold;
    width: 100%;
}

.video_description h2{
    margin-bottom: 15px;
}
.video_description pre {
    white-space: pre-wrap;       /* allows wrapping */
    word-break: break-word; 
}



/* List Styles */

.video_list {
    list-style: none;
    padding: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 40%;
}

ul {
    overflow-y: scroll;
    list-style: none;
    text-align: center;
    background: #001d47;
}

.video_card {
    display: flex;
    height: 140px;
    width: 100%;
    background-color: #212b8a;
    border-radius: 8px;
    overflow: scroll hidden;
    cursor: pointer;
    transition: background-color 0.3s;
}

.video_card:hover {
    background-color: #0055a5;
}

.video_card:hover .play_overlay {
    opacity: 0.8;
}

.video_card_thumbnail {
    position: relative;
    flex: 0 0 240px;
    height: 100%;
}

.video_card_thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video_length {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.play_overlay {
    position: absolute;
    bottom: 50%;
    right: 50%;
    transform: translate(50%, 50%);
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.play_overlay img {
    width: 50%;
    height: 50%;
    transform: translateX(8%);
}

.video_card_info {
    padding: 16px;
    flex-direction: column;
    text-align: left;
    flex: 1;
}

.video_card_title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.video_card_description {
    margin-top: 8px;
    font-size: 14px;
    color: #ccc;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    text-overflow: ellipsis;
    overflow: hidden;
}

.video_card_description a {
    color: #ccc;
}

@media (max-width: 820px) {
    main {
        flex-wrap: wrap;
        overflow-y: scroll;
        padding: 0 15px;
    }

    ul {
        overflow-y: initial;
    }

    .video_container {
        padding-right: 0;
    }

    .video_iframe {
        max-width: 360px;
        min-height: 200px;
    }

    .video_list {
        width: 100%;
        height: initial;
    }

    .video_half_wrapper {
        overflow-y: initial;
    }
}