@charset "utf-8";

/* 메신저 스타일 댓글 시스템 */
.messenger-container {
    width: 100%;
    height: 100%;
    overflow: scroll;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.messenger-header {
    position: absolute;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    z-index: 100;
}

.message-expand-btn {
    float: left;
    margin-right: 10px;
}

.message-expand-btn button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #555;
    font-size: 14px;
}

.message-expand-btn button:hover {
    color: #000;
}

.message-expanded {
    width: 60%;
    height: 90%;
    position: fixed;
    top: 50px;
    left: 50px;
    right: 50px;
    bottom: 50px;
    z-index: 9999;
    background: var(--color-bg);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    overflow: auto;
}

.message-expanded .messenger-header {
    position: absolute;
    top: 0;
    z-index: 1;
}

.message-expanded .fa-expand:before {
    content: "\f066";
    /* fa-compress 아이콘으로 변경 */
}

.message-expanded .message-flex {
    width: 55%;
}

.message-expanded .message-body {
    max-width: 100%;
    padding: 20px 25px;
    text-align: justify;
}

.message-expanded .message-body .message-content {
    line-height: 1.7;
    font-family: 'Pretendard-Regular';
    font-size: 1.1em;
}

.messenger-chat {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 100%;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    position: relative;
    word-break: break-word;
}

.message-left {
    display: flex;
    align-self: flex-start;
}

.message-right {
    display: flex;
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-flex {
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    flex-direction: row;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
}

.message-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-profile img {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fa-user {
    font-size: 14px;
    border: 1px solid var(--color-b);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-username {
    font-weight: bold;
    font-size: 14px;
}

.message-info {
    font-size: 0.75em;
    color: #666;
    line-height: 1;
}

.message-left .message-info {
    text-align: left;
}

.message-right .message-info {
    text-align: right;
}

.messenger-input {
    padding: 3px;
    background: var(--color-f);
}

form#fviewcomment {
    display: flex;
    align-items: center;
    gap: 2px;
}

.messenger-input textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    resize: none;
    height: 80px;
    outline: none;
    font-family: 'NanumSquare';
}

.messenger-input button {
    background: var(--color-b);
    color: var(--color-text);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messenger-input button:hover {
    background: var(--p-color);
}

.messenger-date-divider {
    text-align: center;
    margin: 10px 0;
    color: #666;
    font-size: 0.8em;
}

.messenger-date-divider span {
    padding: 0 10px;
    position: relative;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.message-username {
    font-weight: bold;
    margin-bottom: 3px;
}

.message-content {
    line-height: 1.4;
    font-size: 1em;
    font-family: 'NanumSquare';
    color: var(--color-text)
}

/* 댓글 수정/삭제 버튼 스타일 */
.message-actions {
    font-size: 0.75em;
    display: flex;
    gap: 2px;
    line-height: 1;
}

.message-actions a {
    color: #666;
    text-decoration: none;
}

.message-actions a:hover {
    text-decoration: underline;
}

/* 댓글 본문 */
.message-body {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 8px;
    padding: 10px;
    word-break: break-word;
    max-width: 150px;
    flex: 1;
}

.message-left .message-body {
    border-radius: 8px 8px 8px 0px;
    background: var(--color-7);
}

.message-right .message-body {
    border-radius: 8px 8px 0px 8px;
    background: var(--color-4);
}

.message-con {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 댓글 푸터: 액션 버튼(수정, 삭제, 답변 등) */
.message-footer {
    display: flex;
    flex-direction: column;
    margin: 0px 4px;
    padding: 15px 0px;
    gap: 3px;
    min-width: 50px;
}

.message-right .message-footer {
    align-items: flex-end;
}

.message-footer a {
    text-decoration: none;
    cursor: pointer;
}

.message-footer a:hover {
    text-decoration: underline;
}

/* 인라인 편집 관련 스타일 추가 */
.comment-edit-form {
    width: 100%;
    margin: 5px 0;
}

.comment-edit-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    resize: none;
    height: 80px;
    font-family: 'NanumSquare';
    font-size: 12px;
}

.comment-edit-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 5px;
}

.comment-edit-buttons button {
    background: var(--color-b);
    color: var(--color-text);
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.comment-edit-buttons button.cancel {
    background: #ccc;
}

.comment-edit-buttons button:hover {
    background: var(--p-color);
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .groupcomment.comment-expanded {
        width: 90%;
        height: 90%;
        position: fixed;
        top: 50px;
        left: 50%;
        translate: -50%;
        bottom: 50px;
        z-index: 9999;
        background: var(--color-bg);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
        border-radius: 20px;
        overflow: auto;
    }

    .groupcomment.comment-expanded {
        display: flex;
        justify-content: center;
        flex-direction: row;
        align-items: flex-start;
        height: 90%;
        max-height: 90%;
        box-sizing: border-box;
        padding: 0;
    }

    .comment-expanded .groupcomment-con {
        width: 100%;
        height: 100%;
    }

    .comment-expanded .message-body {
        width: 100%;
        max-width: 100%;
        padding: 10px 15px;
        text-align: justify;
    }

    .comment-expanded .message-flex {
        width: 100%;
    }

    .comment-expanded .comment-edit-form textarea {
        height: 150px;
    }
}