/* 사이트 오른쪽 아래의 도우미 창 (JS/ChatBot.js). 모든 이름이 aha-chat 으로
   시작한다 - 사이트의 다른 CSS 와 섞이지 않게. */

.aha-chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483000;
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #222;
}

.aha-chat-open {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 28px;
    padding: 12px 18px;
    background: #7a1bb0;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.aha-chat-open:hover { background: #63158f; }

/* 단추 글자 위의 작은 줄: 언제든 답한다는 것. 사람 상담원이 아니므로 "AI"를 붙인다. */
.aha-chat-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.aha-chat-tag {
    margin-bottom: 2px;
    font-size: 10.5px;
    font-weight: bold;
    letter-spacing: .3px;
    color: #ffd6e2;
}
.aha-chat-tag::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: #3ddc84;
    vertical-align: 1px;
    box-shadow: 0 0 0 2px rgba(61, 220, 132, .25);
}

/* 단추 안의 로봇. 로봇이 그려지기 전과 못 그려졌을 때는 💬 가 보인다. */
.aha-chat-open { padding: 6px 18px 6px 6px; animation: aha-nudge 6s ease-in-out 3s infinite; }
.aha-chat-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    font-size: 20px;
}
.aha-robot-small {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transition: opacity .3s;
}
.aha-robot-small.aha-robot-ready { opacity: 1; }

/* 창을 열면 맨 위에서 손을 흔드는 로봇 (500x394 그림) */
.aha-robot-hello { width: 150px; height: 118px; margin: -4px auto 2px; }

/* 몇 초에 한 번 살짝 들썩여 '여기 있어요' 하고 알린다 */
@keyframes aha-nudge {
    0%, 86%, 100% { transform: translateY(0); }
    90% { transform: translateY(-6px); }
    94% { transform: translateY(0); }
    97% { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
    .aha-chat-open { animation: none; }
}

.aha-chat-panel {
    display: none;
    flex-direction: column;
    width: 370px;
    height: 560px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
.aha-chat-is-open .aha-chat-panel { display: flex; }
.aha-chat-is-open .aha-chat-open { display: none; }

.aha-chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #7a1bb0;
    color: #fff;
}
.aha-chat-title { font-weight: bold; font-size: 15px; }
.aha-chat-badge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .25);
}
.aha-chat-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.aha-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f4f6f9;
}

.aha-chat-msg {
    max-width: 88%;
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 12px;
    overflow-wrap: anywhere;
}
.aha-chat-assistant { background: #fff; border: 1px solid #e3e6ea; }
.aha-chat-user { margin-left: auto; background: #7a1bb0; color: #fff; }
.aha-chat-msg a { color: #7a1bb0; text-decoration: underline; }
.aha-chat-user a { color: #fff; }
.aha-chat-wait { color: #777; font-style: italic; }
/* 답을 쓰는 동안 끝에 깜빡이는 막대 */
.aha-chat-typing::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px;
    vertical-align: text-bottom; background: #7a1bb0; animation: aha-caret 1s steps(1) infinite; }
@keyframes aha-caret { 50% { opacity: 0; } }
.aha-chat-error { border-color: #f1c4c4; background: #fff6f6; }

.aha-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e3e6ea;
    background: #fff;
}
.aha-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid #e3a6b4;
    outline: none;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    max-height: 90px;
}
.aha-chat-input:focus { border-color: #ba002c; box-shadow: 0 0 0 2px rgba(186, 0, 44, .15); }
.aha-chat-send {
    border: 0;
    border-radius: 10px;
    padding: 0 14px;
    background: #7a1bb0;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}
.aha-chat-send:disabled { background: #b99ad0; cursor: default; }

.aha-chat-note {
    padding: 0 12px 10px;
    background: #fff;
    color: #888;
    font-size: 11px;
}

@media (max-width: 600px) {
    .aha-chat { right: 12px; bottom: 12px; }
    .aha-chat-label { display: none; }
    .aha-chat-open { padding: 6px; border-radius: 50%; }
    .aha-chat-is-open { left: 0; right: 0; top: 0; bottom: 0; }
    .aha-chat-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .aha-chat-input { font-size: 16px; } /* iOS 가 글자 칸을 확대하지 않게 */
}

/* 새 대화 단추 */
.aha-chat-reset {
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
}
.aha-chat-reset + .aha-chat-close { margin-left: 4px; }

/* 처음 열었을 때의 물음 단추 */
.aha-chat-starters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.aha-chat-starter {
    border: 1px solid #ba002c;
    border-radius: 16px;
    background: #fff;
    color: #7a1bb0;
    padding: 6px 11px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.aha-chat-starter:hover { background: #f5eefb; }

/* 답 아래의 업소·게시글 카드 */
.aha-cards { display: flex; flex-direction: column; gap: 8px; margin: -4px 0 8px; max-width: 92%; }
.aha-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
}
.aha-card-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; flex: none; background: #f4f6f9; }
.aha-card-body { min-width: 0; flex: 1; }
.aha-card-title { display: block; font-weight: bold; color: #111 !important; text-decoration: none !important; overflow-wrap: anywhere; }
.aha-card-sub { color: #666; font-size: 12px; margin-top: 2px; }
.aha-card-addr { color: #444; font-size: 12px; margin-top: 2px; }
.aha-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aha-card-btn {
    border: 1px solid #ba002c;
    border-radius: 8px;
    padding: 3px 9px;
    font-size: 12px;
    color: #7a1bb0 !important;
    text-decoration: none !important;
    background: #faf6fd;
}
.aha-card-btn:hover { background: #f5eefb; }

/* 좋아요 / 별로예요 */
.aha-chat-votes { display: flex; gap: 4px; margin: -4px 0 12px; }
.aha-chat-vote {
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    background: #fff;
    padding: 1px 8px;
    cursor: pointer;
    font-size: 13px;
}
.aha-chat-vote:hover { background: #f1f3f6; }
.aha-chat-thanks { color: #888; font-size: 12px; }

/* 사이트의 KOR/ENG 단추(EKoreaMasterPage.Master, 오른쪽 아래)가 도우미 단추를
   가린다. 도우미가 보이는 쪽에서만 그 단추를 왼쪽 아래로 옮긴다. */
.lang-switch-btn { right: auto !important; left: 15px !important; }

/* YouTV 영상 카드: 로고 대신 16:9 미리보기 */
.aha-card-thumb { width: 88px; height: 50px; object-fit: cover; }
