/* Comments Section Styles */
.comments {
    max-width: 780px;
    width: 100%;
    margin: 50px auto;
}

.comments * {
    box-sizing: border-box;
}

.comments__title {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 24px;
    line-height: 24px;
    margin-bottom: 41px;
}

.comment-wrap {
    position: relative;
    width: 100%;
}

/* Styling for nested comments with connecting line */
.answer-inc .comment:not(.comment--answer):before {
    content: "";
    position: absolute;
    height: calc(100% + 40px);
    border-left: 1px dashed rgba(61, 61, 61, 0.29);
    width: 100%;
    border-radius: 26px;
    left: 25px;
    z-index: -1;
    transform: scale(1);
    opacity: 1;
    transform-origin: top;
    transition: 0.7s;
}

.answer-inc .comment:not(.comment--answer):after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 53px;
    width: 53px;
    background: transparent;
    z-index: 1;
}

/* Comment styling */
.comment {
    font-family: 'Roboto', sans-serif;
    display: flex;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.comment__author-pic, .comment-create__avatar {
    width: 50px;
    min-width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 11px;
    z-index: 2;
    }

.comment__author-pic img, .comment-create__avatar img {
    width: 100%;
    object-fit: cover;
    object-position: center;
}

.comment__body {
    padding: 15px;
    max-width: 100%;
    background: #F7F7F7;
    border-radius: 20px;
    transition: 0.3s;
}

.comment__author-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 19px;
    margin-bottom: 7px;
    display: flex;
}

.comment__text, .comment__inner-text {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 0;
}

.comment__footer {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment__ui {
    display: flex;
    padding-left: 0px;
}

.comment__ui-item {
    font-size: 12px;
    line-height: 16px;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.5);
}

.comment__ui-item:first-child {
    margin-right: 0.9em;
    padding-left: 15px;
}

.comment__ui-item:nth-child(2):after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 2px;
    background: #0A78C2;
    border-radius: 50%;
    margin: 0 5px;
    transform: translateY(-3px);
}

.comment__ui-item:nth-child(2), .comment__ui-item:nth-child(3) {
    color: #0A78C2;
}

.like-button, .reply-button {
    position: relative;
    cursor: pointer;
}

/* Remove middot after Răspunde in user comments */
.comment__ui-item.reply-button:after {
    display: none !important;
}

/* Comment images */
.comment__img-wrap {
    position: relative;
    max-width: 250px;
    width: 100%;
}

.comment__img {
    max-width: 100%;
    height: 100%;
    max-height: 250px;
    object-fit: cover;
    object-position: center;
    margin-bottom: 0;
    cursor: pointer;
    margin-top: 0;
    transition: 0.3s;
}

.comment__img:hover {
    opacity: .7;
}

.crop-img {
    position: absolute;
    right: 10px;
    bottom: 20px;
    border: none;
    background: none;
    pointer-events: none;
    width: 24px;
}

/* Emoji reactions */
.emoji-box {
    display: flex;
    align-items: center;
    height: 20px;
    background: #F2F2F2;
    border-radius: 10px;
    margin-right: 0;
    position: relative;
}

.emoji-box.hide {
    background: none !important;
}

.emoji-popup {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 5%;
    transform: translateX(-50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 5px;
    z-index: 10;
}

.emoji-popup.active {
    display: flex;
    animation: emoji-appear 0.3s forwards;
}

.emoji-popup__item {
    width: 30px;
    height: 30px;
    margin: 0 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.emoji-popup__item:hover {
    transform: scale(1.2);
}

.emoji-box__emoji-wrap {
    display: flex;
    transition: 0.3s;
}

.emoji-box__ico {
    width: 20px;
    height: 20px;
    margin-left: -8px;
    position: relative;
}

.emoji-box__ico img {
    width: 100%;
}

.emoji-box__ico:first-child {
    z-index: 3;
}

.emoji-box__ico:nth-child(2) {
    z-index: 2;
}

.emoji-box__ico:last-child {
    z-index: 1;
}

.emoji-box__like-count {
    text-align: center;
    font-weight: 400;
    font-size: 12px;
    min-width: 30px;
    line-height: 16px;
    text-align: center;
}

/* Reply comments */
.comment--answer {
    margin-left: 62px;
}

.comment--answer .comment__body {
    /*max-width: 459px;*/
    /*min-width: 290px;*/
}

.comment--answer .emoji-box__ico {
    width: 19px;
    height: 19px;
    margin-left: -5px;
}

/* Nested reply comments */
.comment--nested-answer {
    margin-left: 62px;
}

.comment--nested-answer .comment__body {
    max-width: 439px;
    min-width: 288px;
    background: #f0f0f0;
}

@media screen and (max-width: 440px) {
    .comment--nested-answer {
        margin-left: 40px;
    }
}

/* Modal for images */
.modal-wrap {
    display: none;
    position: fixed;
    z-index: 4;
    padding-top: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
}

.modal-wrap.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    max-height: calc(100% - 200px);
    width: fit-content;
    animation-name: zoom;
    animation-duration: 0.6s;
    position: relative;
}

.modal__close {
    position: absolute;
    filter: invert(1);
    background: none;
    width: 40px;
    height: 40px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    top: 0;
    right: 0px;
    cursor: pointer;
    /*background: rgba(255, 255, 255, 0.47);*/
}

.modal__close img {
    width: 100%;
    pointer-events: none;
}

.modal__cropped-image {
    max-width: 100%;
    max-height: 92vh;
    object-fit: cover;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* Comment creation form */
.comment-create {
    display: flex;
    margin-bottom: 60px;
}

.comment-create__body {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    position: relative;
}

.comment-create__name-field {
    width: 300px;
    height: 54px;
    background: #F7F7F7;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    border: none;
    padding: 14px;
    margin-bottom: 10px;
    outline: none;
}

.comment-create__name-field::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.comment-create__textarea-wrap {
    position: relative;
}

.comment-create__text-field {
    width: 100%;
    background: #F7F7F7;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    height: 54px;
    border: none;
    padding: 14px;
    outline: none;
    resize: none;
}

.comment-create__text-field::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.comment-create__create-btn {
    background: none;
    border: none;
    display: none;
    position: absolute;
    right: 10px;
    bottom: 10px;
}

.comment-create__subtitle {
    padding: 10px 10px 10px 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    color: rgba(0, 0, 0, 0.4);
}

/* Emoji animations */
@keyframes emoji-appear {
    0% {
        display: none;
        transform: scale(0);
    }
    1% {
        display: flex;
        transform: scale(0);
    }
    65% {
        transform: scale(1);
    }
    85% {
        transform: scale(1.35);
    }
    100% {
        transform: scale(1);
    }
}

.emoji-box .emoji-box__ico {
    display: none;
}

.emoji-box .emoji-box__ico.active {
    display: block;
}

.emoji-box .emoji-box__ico.show {
    display: block;
}

.emoji-box.active .emoji-box__ico {
    transform: scale(0);
    display: none;
    transition: 0s;
}

.emoji-box.active .emoji-box__ico.active {
    display: block;
    transform: scale(1);
    animation: emoji-appear 0.5s linear forwards;
}

/* Responsive styles */
@media screen and (max-width: 1140px) {
    .comment-create__create-btn {
        display: block;
    }
    .comment-create__subtitle {
        display: none;
    }
}

@media screen and (max-width: 980px) {
    .comments {
        max-width: 680px;
        margin: 0 auto 100px;
    }
}

@media screen and (max-width: 767px) {
    .comments .emoji-box {
        transform: translateY(0);
        margin-right: 2px;
    }
}

@media screen and (max-width: 700px) {
    .comment-create__name-field {
        width: 100%;
    }

    .modal {
        width: 100%;
    }
}

@media screen and (max-width: 520px) {
    .comment-create {
        padding-left: 0;
    }
}

@media screen and (max-width: 440px) {
    .comment--answer {
        margin-left: 20px;
    }
}

@media screen and (max-width: 410px) {
    .comment__author-pic, .comment-create__avatar {
        margin-right: 4px;
    }

    .comment__ui {
        padding-left: 4px;
    }

    .comment__ui-item {
        font-size: 12px;
    }
}

@media screen and (max-width: 375px) {
    .comment--answer .comment__body {
        min-width: 229px;
    }

    .comment__ui-item:not(:last-child):after {
        display: none;
    }

    .comment__ui-item:last-child {
        display: none;
    }
}

@media screen and (max-width: 380px) {
    .comments {
        overflow: hidden;
    }
}
.comment__stars {
    color: #FFD700;
    font-size: 14px;
    /*margin-bottom: 10px;*/
    padding-left: 10px;
}

.comment__img-wrap {
    position: relative;
    margin-top: 10px;
    margin-bottom: 0px;
}

.comment__img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
    display: block;
}

.comment__img:hover {
    opacity: 0.8;
}

.crop-img {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 24px;
    height: 24px;
    pointer-events: none;
}
