.chapter_popup {
    /* Initially hidden */
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.chapter_popup_container {
    position: absolute;
    left: 50%;
    top: 15%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 40vw;
    background: var(--background-color);
    border-radius: 1rem;
    box-shadow: 0 4px 16px var(--shadow-semitransparent-color);
    overflow-y: auto;
    text-align:right;
}


.chapter_list_scroll{
    padding: 0.5rem 2rem 0rem 2rem;
}

/* Close X icon*/
.close_popup {
    display: inline-block;
    margin: 16px 16px 0 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10000;
}

/*Animation transition X*/
.close_popup:hover {
    transform: rotate(90deg);
}

/* Scrollable chapter list inside card*/
#chapet_list {
    max-height: 70vh;
    overflow-y: auto;
    text-align:center;
}

/*General card-chapter style*/
.chapter_item {
    margin: 0 8px 0.5rem 8px; /* equal horizontal margins */
    padding: 0.5rem;
    border-radius: 8px;
}

/*Publication Date of chapter*/
.chapter_item small{
    color: var(--text-grey-color);
}

/*Unlocked Chpaters*/
.chapter_item.unlocked {
    background-color: var(--card-color);
    cursor: pointer;
}


/*Locked Chpaters*/
.chapter_item.locked {
    background-color: var(--card-locked-color);
}

/*Hover General card-chapter*/
.chapter_item:hover {
    box-shadow: 0 0.2rem 0.4rem var(--shadow-semitransparent-color);
    transform: scale(1.03);
    color: var(--text-color);
    cursor: pointer; 
}

/*This is your current chapter*/
/*Hover General card-chapter*/
.chapter_item:hover {
    box-shadow: 0 0.2rem 0.4rem var(--shadow-semitransparent-color);
    transform: scale(1.03);
    color: var(--text-color);
    cursor: pointer; 
}


/*This is your current chapter*/
.current_chapter{
    transform: scale(0.9);
}

/*Hover Current chapter no animation*/
.current_chapter:hover {
    box-shadow: none !important;
    transform: scale(0.9) !important; 
    cursor: default; 
}


.popup_chap_span{
    display: flex;
    flex-direction: row;
    gap: 4px;
    justify-self: center;
}
.popup_chap_span p {
    margin: 0;
}
.chapter_item p {
    margin: 0;
}
@media (max-width: 768px) {
    .chapter_popup_container {
        width: 360px;
        top: 25%;
        max-width: 90%;
        height: 50%;    
    }
}