/* WeLinker AI Tools — 채팅 UI */

.wat-wrap {
    max-width: 820px;
    margin: 0 auto;
    font-family: 'Nunito', 'Pretendard', -apple-system, sans-serif;
    color: #222;
}

/* ── 상태 바 ── */
.wat-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    border-color: #e5e7eb;
    font-size: 13px;
}

.wat-statusbar-left { display: flex; align-items: center; gap: 10px; }
.wat-logo { font-weight: 700; color: #111827; font-size: 14px; }

.wat-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.wat-chip-guest  { background: #e5e7eb; color: #495057; }
.wat-chip-trial  { background: #d1ecf1; color: #0c5460; }
.wat-chip-coupon { background: #fff3cd; color: #856404; }
.wat-chip-paid   { background: #d4edda; color: #155724; }

.wat-link-sm { font-size: 12px; color: #FD7014; text-decoration: none; font-weight: 600; }
.wat-link-sm:hover { text-decoration: underline; }

/* ── 채팅 영역 ── */
.wat-chat-wrap {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: #fff;
    overflow: hidden;
}

.wat-messages {
    min-height: 300px;
    max-height: 520px;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* ── 메시지 버블 ── */
.wat-msg { display: flex; max-width: 100%; }

.wat-msg-user {
    justify-content: flex-end;
}
.wat-msg-user .wat-msg-bubble {
    background: #111827;
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    max-width: 75%;
}

.wat-msg-ai {
    justify-content: flex-start;
}
.wat-msg-ai .wat-msg-bubble {
    background: #f4f5f7;
    color: #222;
    border-radius: 18px 18px 18px 4px;
    max-width: 90%;
}

.wat-msg-bubble {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.75;
    word-break: break-word;
}

.wat-heading {
    display: block;
    font-weight: 700;
    color: #111827;
    font-size: 15px;
    margin: 8px 0 4px;
}

.wat-image-hint {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    border: 1px dashed #ffc107;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    margin: 6px 0;
}

/* 타이핑 애니메이션 */
.wat-typing-dots { padding: 14px 18px; }
.wat-typing-dots span {
    display: inline-block;
    width: 7px; height: 7px;
    margin: 0 2px;
    background: #adb5bd;
    border-radius: 50%;
    animation: watBounce 1.2s infinite;
}
.wat-typing-dots span:nth-child(2) { animation-delay: .2s; }
.wat-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes watBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-6px); }
}

/* ── 대화 스타터 버튼 ── */
.wat-starters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

.wat-starter-btn {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: all .15s;
    line-height: 1.4;
}
.wat-starter-btn:hover:not(:disabled) {
    border-color: #111827;
    background: #f0f3f8;
    color: #111827;
}
.wat-starter-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 입력 영역 ── */
.wat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.wat-input {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 160px;
    transition: border-color .2s;
    font-family: inherit;
}
.wat-input:focus { border-color: #111827; }
.wat-input:disabled { background: #f8f9fa; }

.wat-send-btn {
    width: 42px; height: 42px;
    background: #FD7014;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.wat-send-btn:hover:not(:disabled) { background: #e05f0a; }
.wat-send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ── 복사 / 초기화 바 ── */
.wat-copy-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
}

.wat-copy-btn, .wat-reset-btn {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
}
.wat-copy-btn  { background: #111827; color: #fff; }
.wat-copy-btn:hover  { background: #152340; }
.wat-reset-btn { background: #e5e7eb; color: #495057; }
.wat-reset-btn:hover { background: #e5e7eb; }

/* ── 인라인 버튼 (에러/안내 메시지 안) ── */
.wat-inline-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 18px;
    background: #FD7014;
    color: #fff !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s;
}
.wat-inline-btn:hover { background: #e05f0a; }

/* ── 쿠폰 바 ── */
.wat-coupon-bar {
    margin-top: 12px;
    border: 1px dashed #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #666;
}
.wat-coupon-bar summary { cursor: pointer; font-weight: 500; }
.wat-coupon-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.wat-coupon-inner input {
    flex: 1;
    padding: 7px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 7px;
    font-size: 13px;
    letter-spacing: 1px;
}
.wat-coupon-inner button {
    padding: 7px 16px;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
}

/* ── 만료 화면 ── */
.wat-expired {
    text-align: center;
    padding: 48px 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}
.wat-expired-icon { font-size: 52px; margin-bottom: 12px; }
.wat-expired h3 { font-size: 22px; color: #111827; margin: 0 0 8px; }
.wat-expired p  { color: #555; margin: 0 0 16px; }
.wat-benefit-list {
    list-style: none; padding: 0; margin: 0 0 24px;
    display: inline-block; text-align: left;
}
.wat-benefit-list li { padding: 4px 0; font-size: 15px; }
.wat-btn-subscribe {
    display: inline-block;
    padding: 14px 32px;
    background: #FD7014;
    color: #fff;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.wat-btn-subscribe:hover { background: #e05f0a; }
.wat-sub-hint { margin-top: 16px; font-size: 13px; color: #888; }

/* ── 이미지 업로드 ── */
.wat-image-btn {
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: all .15s;
    background: #fff;
    margin-bottom: 2px;
}
.wat-image-btn:hover { border-color: #111827; background: #f0f3f8; }
.wat-image-btn.has-image { border-color: #FD7014; background: #fff5ee; }

/* 이미지 미리보기 바 */
.wat-image-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #fff8f3;
    border-top: 1px solid #ffe0c8;
}
.wat-preview-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid #FD7014;
    flex-shrink: 0;
}
.wat-preview-info {
    flex: 1;
    font-size: 12px;
    color: #888;
}
.wat-preview-info strong {
    display: block;
    color: #333;
    font-size: 13px;
    margin-bottom: 2px;
}
.wat-remove-image {
    width: 26px; height: 26px;
    border: none;
    border-radius: 50%;
    background: #e5e7eb;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.wat-remove-image:hover { background: #dc3545; color: #fff; }

/* 채팅 메시지 안의 첨부 이미지 썸네일 */
.wat-attached-img {
    display: block;
    max-width: 200px;
    max-height: 160px;
    border-radius: 8px;
    margin-bottom: 6px;
    object-fit: cover;
}

/* ── 반응형 ── */
@media (max-width: 560px) {
    .wat-starters { grid-template-columns: 1fr; }
    .wat-msg-user .wat-msg-bubble,
    .wat-msg-ai .wat-msg-bubble { max-width: 95%; }
}
