/* 챗봇 팝업 스타일 */
.chat_pop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.chat_pop .black {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}
/*
.chat_pop .pop_wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px; 
    height: 650px; 
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.chat_pop .pop {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat_pop .top {
    height: 50px;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    color: white;
    position: relative;
}

.chat_pop .top::before {
    content: '월연소 챗봇';
    font-size: 18px;
    font-weight: bold;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.chat_pop .close1 {
    width: 20px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.chat_pop .close1::before,
.chat_pop .close1::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    top: 50%;
    left: 0;
}

.chat_pop .close1::before {
    transform: rotate(45deg);
}

.chat_pop .close1::after {
    transform: rotate(-45deg);
}
*/ 

.chat_pop .chat_txt {
    /*
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px);
    position: relative;
    background: #f5f5f5;
    */
    width: 100%;
}

/*.chat_pop .chat_txt ul {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    margin: 0;
    list-style: none;
    -webkit-overflow-scrolling: touch; 
    scroll-behavior: smooth; 
    background: #fff;
}
*/

/* 사용자 메시지 스타일 */
.chat_left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
    width: 100%;
}

.chat_box {
    display: flex;
    margin-bottom: 5px;
    max-width: 85%;
}

.chat_pro {
    width: 40px;
    height: 40px;
    min-width: 40px; /* 고정 너비 설정 */
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.chat_pro img {
    width: 24px;
    height: 24px;
}

.chat_name {
    flex: 1;
}

.chat_name p {
    font-size: 15px;
    margin: 0 0 5px 0;
}

.chat_q {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 10px 15px;
    max-width: 100%;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 봇 메시지 스타일 */
.chat_right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 15px;
    width: 100%;
}

.chat_a {
    background: #4CAF50;
    color: white;
    border-radius: 10px;
    padding: 10px 15px;
    max-width: 80%;
    margin-bottom: 5px;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 입력 영역 스타일 */
.chat_area {
    display: flex;
    border-top: 1px solid #eee;
    padding: 15px;
    background: #f9f9f9;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
}

.chat_area textarea {
    flex: 1;
    min-height: 50px;
    max-height: 100px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 12px;
    resize: none;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border 0.3s, box-shadow 0.3s;
}

.chat_area textarea:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/*
.chat_area button {
    width: 70px;
    height: 100%;
    background: #15bf57;
    color: white;
    border: none;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat_area button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chat_area button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chat_area button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
*/

/* 입력 중 애니메이션 */
#chat_typing {
    align-self: flex-start;
    margin-bottom: 10px;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .chat_pop .pop_wrap {
        width: 95%;
        height: 90%;
        max-height: 700px;
    }

    .chat_q, .chat_a {
        max-width: 85%;
    }

    .chat_box {
        max-width: 95%;
    }

    .chat_area {
        padding: 10px 0;
    }

    .chat_area textarea {
        min-height: 60px;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .chat_pop .pop_wrap {
        background: #222;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }

    .chat_txt {
        background: #222;
        color: #eee;
    }

    .chat_q {
        background: #333;
        color: #eee;
    }

    .chat_name p {
        color: #aaa;
    }

    .chat_area textarea {
        background: #333;
        color: #eee;
        border-color: #444;
    }

    .typing-indicator {
        background-color: #333;
    }

    .service-status {
        background-color: #333;
        color: #eee;
    }

    .service-status.error {
        background-color: #5a2327;
        color: #ffb0b0;
    }
}
