.episodes_container {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    padding: 1em;
    justify-content: flex-start;
}

.episode_card {
    display: flex;
    width: 100%;
    max-width: 400px;
    height: 120px;
    min-height: 80px;
    border-radius: 0.8em;
    border: 1px solid rgba(var(--secondary-color), 0.3);
    background-color: rgba(var(--primary-color), 0.5);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.episode_card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: rgb(var(--secondary-color));
}

.episode_card img {
    width: 40%;
    max-width: 160px;
    min-width: 120px;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background-color: rgba(var(--primary-color), 0.3);
}

.episode_info {
    flex: 1;
    padding: 0.8em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
}

.episode_card label {
    position: absolute;
    left: 0;
    top: 0;
    background-color: rgb(var(--secondary-color));
    color: white;
    padding: 0.2em 0.8em;
    border-radius: 0.5em 0 0.5em 0;
    font-size: 0.7em;
    font-weight: bold;
    z-index: 2;
}

.episode_info .episode {
    background-color: rgba(var(--primary-color), 0.8);
    border-radius: 0.4em;
    padding: 0.2em 0.6em;
    width: fit-content;
    font-size: 0.8em;
    margin-top: auto;
}

.episode_info .episode.in_history {
    background-color: rgb(95, 165, 95);
    color: white;
}

.episode_info .season {
    color: rgb(var(--secondary-color));
    font-size: 0.8em;
    font-weight: bold;
}

.episode_info .title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.9em;
    margin: 0.2em 0;
    line-height: 1.3;
}

.episode_info p {
    margin: 0.2em 0;
    font-size: 0.8em;
    color: rgba(var(--text-color), 0.8);
}

.ep_onhover {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(var(--primary-color), 0.7), rgba(var(--secondary-color), 0.7));
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
}

.ep_onhover svg {
    width: 2em;
    height: 2em;
    fill: white;
    transition: all 0.3s ease;
}

.episode_card:hover .ep_onhover {
    width: 100%;
    opacity: 1;
}

.episode_card:hover .ep_onhover svg {
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (min-width: 1200px) {
    .episodes_container {
        justify-content: center;
    }
    .episode_card {
        width: 30%;
        max-width: 400px;
        min-width: 250px;
    }
}

@media (max-width: 1200px) {
    .episode_card {
        max-width: 100%;
        width: 45%;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .episode_card {
        max-width: 100%;
        width: 45%;
        height: 90px;
        min-width: 250px;
    }
    .episode_card img {
        width: 35%;
        min-width: 100px;
    }
    .episode_info {
        padding: 0.6em;
    }
}

@media (max-width: 600px) {
    .episode_card {
        height: 90px;
        border-radius: 0.5em;
        min-width: 300px;
        width: 100%;
    }
    .episode_card img {
        width: 30%;
        min-width: 90px;
    }
    .episode_info .title {
        font-size: 0.8em;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    .episode_info p {
        font-size: 0.7em;
    }
}
@media (max-width: 360px) {
    .episode_card {
        height: 90px;
        border-radius: 0.5em;
        min-width: 160px;
        width: 100%;
    }
}
/* Touch device adjustments */
@media (hover: none) {
    .ep_onhover {
        width: 0%;
        opacity: 0.8;
        background: rgba(var(--secondary-color), 0.5);
        display: none;
    }
    .ep_onhover svg {
        width: 1.5em;
        height: 1.5em;
    }
    .episode_card:active .ep_onhover {
        width: 100%;
        opacity: 1;
    }
}