:root {
    --body-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --msger-bg: #fff;
    --border: 1px solid #ddd;
    --left-msg-bg: #ececec;
    --right-msg-bg: #579ffb;
    --send-btn-bg: rgb(0, 196, 65);
    --send-btn-hover: rgb(0, 180, 50);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    /* 배경 스크롤 방지 */
}

/* --- 메인 채팅창 (스마트폰 뷰) --- */
.msger {
    display: flex;
    flex-flow: column wrap;
    justify-content: space-between;
    width: 100%;
    max-width: 420px;
    /* 스마트폰 너비 고정 */
    height: 90vh;
    /* 상하 여백 확보 */
    border-radius: 20px;
    background: var(--msger-bg);
    box-shadow: 0 15px 15px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

/* 헤더 */
.msger-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: var(--border);
    background: #eee;
    color: #666;
    font-weight: bold;
}

/* 채팅 영역 */
.msger-chat {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #fcfcfe;
    /* 스크롤바 커스텀 */
    scrollbar-width: thin;
}

.msger-chat::-webkit-scrollbar {
    width: 6px;
}

.msger-chat::-webkit-scrollbar-track {
    background: #ddd;
}

.msger-chat::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}

/* 말풍선 공통 */
.msg {
    display: flex;
    align-items: flex-end;
    margin-bottom: 15px;
}

.msg-img {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    background: #ddd;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.msg-bubble {
    max-width: 75%;
    padding: 12px;
    border-radius: 15px;
    background: var(--left-msg-bg);
    line-height: 1.4;
    word-wrap: break-word;
}

.msg-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.msg-info-name {
    font-weight: bold;
    font-size: 0.9em;
}

.msg-info-time {
    font-size: 0.75em;
    color: #888;
}

/* 오른쪽 말풍선 (사용자) */
.right-msg {
    flex-direction: row-reverse;
}

.right-msg .msg-bubble {
    background: var(--right-msg-bg);
    color: #fff;
    border-bottom-right-radius: 0;
}

.right-msg .msg-img {
    margin: 0 0 0 10px;
}

/* 왼쪽 말풍선 (AI) */
.left-msg .msg-bubble {
    border-bottom-left-radius: 0;
}

/* 입력창 영역 */
.msger-inputarea {
    display: flex;
    padding: 10px;
    border-top: var(--border);
    background: #eee;
}

.msger-input {
    flex: 1;
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.msger-send-btn {
    margin-left: 10px;
    background: var(--send-btn-bg);
    color: #fff;
    font-weight: bold;
    border: none;
    padding: 0 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.23s;
}

.msger-send-btn:hover {
    background: var(--send-btn-hover);
}

/* --- 모달 (팝업) 스타일 --- */
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 15px;
    width: 300px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.kakao-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 20px;
    background-color: #FEE500;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
}

/* style.css 아무 곳에나 추가 */
#setting-btn {
    cursor: pointer;
    transition: color 0.3s;
}

#setting-btn:hover {
    color: #333;
    /* 마우스 올렸을 때 약간 진하게 */
}