/* ═══════════════════════════════════════════
   AI 튜터 플로팅 위젯 스타일
   ═══════════════════════════════════════════ */

/* ── 루트 컨테이너 ── */
.msft-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── 플로팅 버튼 (FAB) ── */
.msft-fab {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    color: #fff;
    margin-left: auto;
}
.msft-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.65);
}
.msft-fab:active { transform: scale(0.95); }

/* 커스텀 PNG 이미지 아이콘 */
.msft-fab-custom-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

/* 커스텀 텍스트 레이블 */
.msft-fab-label {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-align: center;
    line-height: 1.2;
    padding: 4px 2px;
    color: #fff;
    word-break: keep-all;
    max-width: 52px;
    display: block;
}

/* 알림 배지 */
.msft-fab-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: msft-pulse 1.5s infinite;
}
@keyframes msft-pulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ── 채팅 패널 ── */
.msft-panel {
    position: absolute;
    bottom: 74px;
    right: 0;
    width: 360px;
    max-height: 560px;
    background: #0f172a;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    animation: msft-slide-up 0.25s ease;
}
@keyframes msft-slide-up {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 헤더 ── */
.msft-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    flex-shrink: 0;
}
.msft-header-info { display: flex; align-items: center; gap: 10px; }
.msft-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.msft-header-name { font-size: 14px; font-weight: 700; color: #fff; }
.msft-header-status { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #a5b4fc; margin-top: 2px; }
.msft-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 6px #34d399;
    animation: msft-blink 2s infinite;
}
@keyframes msft-blink { 0%,100%{opacity:1} 50%{opacity:0.4} }
.msft-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.msft-close:hover { background: rgba(255,255,255,0.2); }

/* ── 메시지 영역 ── */
.msft-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.msft-messages::-webkit-scrollbar { width: 4px; }
.msft-messages::-webkit-scrollbar-track { background: transparent; }
.msft-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* 메시지 버블 */
.msft-msg { display: flex; max-width: 85%; }
.msft-msg--bot { align-self: flex-start; }
.msft-msg--user { align-self: flex-end; flex-direction: row-reverse; }

.msft-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
    text-align: left;
}
.msft-msg--bot .msft-bubble {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    border-radius: 4px 16px 16px 16px;
}
.msft-msg--bot .msft-bubble strong { color: #a78bfa; }
.msft-msg--bot .msft-bubble p { margin: 0 0 6px; }
.msft-msg--bot .msft-bubble p:last-child { margin: 0; }

.msft-msg--user .msft-bubble {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 16px 4px 16px 16px;
}

/* 타이핑 인디케이터 */
.msft-typing .msft-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}
.msft-typing-dot {
    width: 7px;
    height: 7px;
    background: #a78bfa;
    border-radius: 50%;
    animation: msft-typing-anim 1.2s infinite ease-in-out;
}
.msft-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.msft-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes msft-typing-anim {
    0%,80%,100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* ── 빠른 질문 칩 ── */
.msft-chips {
    display: flex;
    gap: 6px;
    padding: 6px 12px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.msft-chip {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.msft-chip:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    border-color: #6366f1;
}

/* ── 입력 영역 ── */
.msft-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
}
.msft-textarea {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.5;
}
.msft-textarea::placeholder { color: #475569; }
.msft-textarea:focus { border-color: rgba(99, 102, 241, 0.5); }
.msft-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s, transform 0.15s;
}
.msft-send-btn:hover { opacity: 0.9; transform: scale(1.05); }
.msft-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── 모바일 반응형 ── */
@media (max-width: 480px) {
    .msft-root { bottom: 16px; right: 16px; }
    .msft-panel { width: calc(100vw - 32px); right: 0; max-height: 70vh; }
}
/* ── 상담 신청 폼 ── */
.msft-inquiry-form {
    margin-top: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}
.msft-inquiry-title {
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.msft-inquiry-row {
    margin-bottom: 8px;
}
.msft-inquiry-label {
    display: block;
    color: #94a3b8;
    margin-bottom: 4px;
    font-size: 11px;
}
.msft-inquiry-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 10px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.msft-inquiry-input:focus {
    border-color: #6366f1;
}
.msft-inquiry-submit {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s;
}
.msft-inquiry-submit:hover { opacity: 0.9; }
.msft-inquiry-submit:disabled { opacity: 0.5; cursor: not-allowed; }
