/* AI 도우미(2026-10-18) — Shared/ChatBox.razor · ChatWidget.razor · Pages/Chat.razor.
   색은 lab.css 의 AIoT 브랜드 블루(#3D6BE8)와 맞춘다. 떠 있는 단추는 [설치 | 알림] 아이콘(#pwa-corner, 오른쪽 아래 12px) 위에. */

.skychat { display: flex; flex-direction: column; min-height: 0; height: 100%; color: #1f2937; }
.skychat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem .9rem .5rem; display: flex; flex-direction: column; gap: .85rem; scroll-behavior: smooth; }

/* 첫 화면 */
.skychat-hello { margin: auto 0; text-align: center; padding: 1rem .5rem; }
.skychat-hello-icon { width: 54px; height: 54px; margin: 0 auto .7rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; color: #fff;
    background: linear-gradient(135deg, #2A3FBF, #3D6BE8 55%, #6FA9F3); box-shadow: 0 8px 20px rgba(61, 107, 232, .28); }
.skychat-hello-t { font-weight: 800; font-size: 1.15rem; }
.skychat-hello-s { color: #6b7280; font-size: .9rem; margin-top: .3rem; line-height: 1.55; }
.skychat-chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 1rem; }
.skychat-chip { border: 1px solid #C9DDFB; background: #EEF4FE; color: #2A3FBF; border-radius: 999px; padding: .38rem .8rem; font-size: .84rem; cursor: pointer; transition: background .15s, border-color .15s; }
.skychat-chip:hover { background: #DCE8FD; border-color: #9EC4F7; }

/* 말풍선 */
.skychat-msg { display: flex; gap: .55rem; align-items: flex-start; }
.skychat-msg.is-user { justify-content: flex-end; }
.skychat-msg.is-user .skychat-bubble { background: #3D6BE8; color: #fff; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; max-width: 82%; }
.skychat-msg.is-bot .skychat-bubble { background: #fff; border: 1px solid #e5e9f0; border-radius: 16px 16px 16px 4px; max-width: calc(100% - 40px); box-shadow: 0 1px 2px rgba(16, 32, 58, .05); }
.skychat-bubble { padding: .6rem .85rem; line-height: 1.6; font-size: .93rem; overflow-wrap: anywhere; }
.skychat-avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: .9rem;
    background: linear-gradient(135deg, #2A3FBF, #3D6BE8 55%, #6FA9F3); }
.skychat-md > :first-child { margin-top: 0; } .skychat-md > :last-child { margin-bottom: 0; }
.skychat-md p { margin: 0 0 .5rem; } .skychat-md ul, .skychat-md ol { margin: .2rem 0 .5rem; padding-left: 1.2rem; }
.skychat-md li { margin: .15rem 0; } .skychat-md a { color: #3D6BE8; }
.skychat-md code { background: #f1f5f9; padding: .05rem .3rem; border-radius: 4px; font-size: .85em; }
.skychat-md table { border-collapse: collapse; font-size: .85rem; margin: .3rem 0; } .skychat-md th, .skychat-md td { border: 1px solid #e5e7eb; padding: .2rem .45rem; }
.skychat-err { color: #b42318; font-size: .86rem; margin-top: .3rem; }
.skychat-typing { display: inline-flex; gap: 4px; padding: .3rem 0; }
.skychat-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9fb3c8; animation: skychat-dot 1.2s infinite ease-in-out; }
.skychat-typing i:nth-child(2) { animation-delay: .15s; } .skychat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes skychat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* 근거 */
.skychat-src { display: flex; flex-direction: column; gap: .3rem; margin-top: .6rem; padding-top: .55rem; border-top: 1px dashed #e2e8f0; }
.skychat-src a { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: #334155; text-decoration: none; padding: .2rem .3rem; border-radius: 6px; }
.skychat-src a:hover { background: #EEF4FE; color: #3D6BE8; }
.skychat-src-n { flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: #DCE8FD; color: #2A3FBF; font-weight: 700; font-size: .72rem; display: grid; place-items: center; }
.skychat-src-t { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skychat-src-k { flex: 0 0 auto; color: #94a3b8; font-size: .72rem; }

/* 입력 */
.skychat-input { display: flex; gap: .45rem; align-items: flex-end; padding: .6rem .7rem; border-top: 1px solid #eef1f5; background: #fff; }
.skychat-input textarea { flex: 1; resize: none; border: 1px solid #d5dde7; border-radius: 14px; padding: .55rem .8rem; font: inherit; font-size: .93rem; line-height: 1.45; max-height: 150px; outline: none; }
.skychat-input textarea:focus { border-color: #3D6BE8; box-shadow: 0 0 0 3px rgba(61, 107, 232, .15); }
.skychat-send { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; border: 0; background: #3D6BE8; color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s, opacity .15s; }
.skychat-send:hover { background: #2A3FBF; } .skychat-send.is-empty { opacity: .45; } .skychat-send.is-stop { background: #475569; }
.skychat-off { color: #6b7280; font-size: .9rem; padding: .4rem; }
.skychat-foot { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: 0 .8rem .55rem; font-size: .74rem; color: #94a3b8; background: #fff; }
.skychat-link { border: 0; background: none; color: #64748b; font-size: .78rem; padding: 0; cursor: pointer; white-space: nowrap; }
.skychat-link:hover { color: #3D6BE8; }

/* 떠 있는 단추와 창 */
.skychat-fab { position: fixed; right: 14px; bottom: 62px; z-index: 1045; height: 48px; min-width: 48px; padding: 0 1rem 0 .85rem; border: 0; border-radius: 999px;
    display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; font-size: .95rem; color: #fff; cursor: pointer;
    background: linear-gradient(120deg, #2A3FBF, #3D6BE8 55%, #6FA9F3); box-shadow: 0 8px 22px rgba(61, 107, 232, .35); transition: transform .15s, box-shadow .15s; }
.skychat-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(61, 107, 232, .45); }
.skychat-fab.is-open { padding: 0; width: 48px; justify-content: center; }
.skychat-fab i { font-size: 1.1rem; }
.skychat-panel { position: fixed; right: 14px; bottom: 120px; z-index: 1046; width: 380px; height: min(600px, calc(100vh - 150px)); background: #f7f9fc;
    border: 1px solid #e3e8ef; border-radius: 18px; box-shadow: 0 18px 48px rgba(16, 32, 58, .22); display: flex; flex-direction: column; overflow: hidden;
    animation: skychat-in .18s ease-out; }
@keyframes skychat-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.skychat-panel-head { display: flex; align-items: center; gap: .3rem; padding: .65rem .7rem .65rem 1rem; color: #fff; background: linear-gradient(120deg, #2A3FBF, #3D6BE8 55%, #6FA9F3); }
.skychat-panel-title { flex: 1; font-weight: 800; }
.skychat-icon-btn { width: 32px; height: 32px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.skychat-icon-btn:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.skychat-panel .skychat { flex: 1 1 auto; }

@media (max-width: 520px) {
    .skychat-panel { right: 8px; left: 8px; width: auto; bottom: 116px; height: calc(100vh - 140px); }
    .skychat-fab { right: 10px; }
}

/* /chat 페이지 — 메뉴 아래 넓은 영역을 다 쓴다(본문 컨테이너 폭, 화면 높이에 맞춤). 글 줄은 읽기 좋게 900px 로 가운데 */
.skychat-page { max-width: none; padding-top: 1.1rem; padding-bottom: 1.2rem; }
.skychat-page-head { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; margin-bottom: .7rem; }
.skychat-page-h { font-size: 1.45rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .45rem; }
.skychat-page-h i { background: linear-gradient(135deg, #2A3FBF, #3D6BE8 55%, #6FA9F3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skychat-page-sub { color: #6b7280; margin: 0; font-size: .92rem; }
.skychat-page .skychat { height: calc(100vh - 190px); min-height: 520px; background: #f7f9fc; border: 1px solid #e3e8ef; border-radius: 18px; overflow: hidden; }
.skychat-page .skychat-log { padding: 1.4rem max(1rem, calc((100% - 900px) / 2)) .6rem; }
.skychat-page .skychat-input, .skychat-page .skychat-foot { padding-left: max(.8rem, calc((100% - 900px) / 2)); padding-right: max(.8rem, calc((100% - 900px) / 2)); }
.skychat-page .skychat-bubble { font-size: .97rem; }

/* 상단 메뉴 'AI 챗봇' — ICTRobot 처럼 글자 주변이 빛난다(색은 AIoT 로고의 하늘색). 글자 색·굵기는 다른 메뉴와 같게 */
.navbar .navbar-nav .nav-link.nav-ai { white-space: nowrap; text-shadow: 0 0 6px rgba(80, 180, 255, .95), 0 0 14px rgba(80, 180, 255, .7), 0 0 26px rgba(120, 110, 255, .45); animation: nav-ai-glow 2.4s ease-in-out infinite; }
.navbar .navbar-nav .nav-link.nav-ai:hover, .navbar .navbar-nav .nav-link.nav-ai.active { animation: none; text-shadow: 0 0 8px rgba(80, 180, 255, 1), 0 0 18px rgba(80, 180, 255, .95), 0 0 34px rgba(120, 110, 255, .7); }
@keyframes nav-ai-glow {
    0%, 100% { text-shadow: 0 0 6px rgba(80, 180, 255, .8), 0 0 14px rgba(80, 180, 255, .55), 0 0 22px rgba(120, 110, 255, .3); }
    50%      { text-shadow: 0 0 10px rgba(80, 180, 255, 1), 0 0 22px rgba(80, 180, 255, .9), 0 0 38px rgba(120, 110, 255, .65); }
}
@media (prefers-reduced-motion: reduce) { .navbar .navbar-nav .nav-link.nav-ai { animation: none; } }

/* 'AI 챗봇' 이 더해져 992~1199px 에서 오른쪽 'Register | Login' 이 두 줄로 접혔다(2026-10-18) — 그 폭에서만 메뉴 간격을 줄인다.
   (ICTRobot hhchoi.css 의 같은 처리) 글자는 어느 폭에서도 접히지 않게 */
.navbar .navbar-nav .nav-link { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar .navbar-nav .nav-item { margin-right: 2px !important; }
    .navbar .navbar-nav .nav-link { padding-left: 6px !important; padding-right: 6px !important; }
}
