/* 🤖 [도파급스탁] 가이드봇 챗봇 전용 프리미엄 클린 UI 스타일시트 */

/* 1. 우측 하단 플로팅 런처 버튼 (말풍선 모양) */
.dopa-chat-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 68px;
    height: 56px;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dopa-chat-launcher:hover {
    transform: scale(1.08) translateY(-2px);
    filter: drop-shadow(0 12px 26px rgba(255, 46, 147, 0.45));
}

.dopa-chat-launcher:active {
    transform: scale(0.95);
}

.dopa-chat-launcher-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.dopa-chat-launcher-icon {
    position: relative;
    z-index: 2;
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
    margin-right: 4px; /* 우측 꼬리 고려 시각적 중앙 보정 */
    margin-bottom: 3px;
    transition: transform 0.2s ease;
}

/* 2. 챗봇 대화창 모달 (딥 네이비 글래스 프리미엄 테마) */
.dopa-chat-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 360px;
    height: 580px;
    max-height: calc(100vh - 120px);
    background: rgba(13, 20, 33, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 46, 147, 0.35);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 46, 147, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    overscroll-behavior: contain; /* 🛡️ [메인 스크롤 격리 가드] */
}

.dopa-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 3. 챗봇 헤더 (풀로고 + AI 가이드봇) */
.dopa-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 14, 24, 0.98);
}

.dopa-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dopa-chat-full-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    display: block;
}

.dopa-chat-header-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.dopa-chat-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: #8a99ad;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    outline: none;
}

.dopa-chat-close-btn:hover {
    background: rgba(255, 46, 147, 0.2);
    color: #ffffff;
    border-color: rgba(255, 46, 147, 0.4);
}

/* 4. 메시지 본문 영역 (딥 다크) */
.dopa-chat-body {
    flex: 1;
    padding: 18px 16px;
    overflow-y: auto;
    background: rgba(7, 11, 20, 0.98);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overscroll-behavior: contain; /* 🛡️ [메인 스크롤 격리 가드] */
    -webkit-overflow-scrolling: touch;
}

.dopa-chat-body::-webkit-scrollbar {
    width: 5px;
}

.dopa-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* 챗봇 메시지 행 */
.dopa-msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* 🌟 미니 3D 젤리 챗봇 아바타 */
.dopa-msg-avatar {
    width: 34px;
    height: 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dopa-avatar-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(255, 46, 147, 0.3));
}

.dopa-avatar-icon {
    position: relative;
    z-index: 2;
    width: 17px;
    height: 17px;
    object-fit: contain;
    margin-right: 2px;
    margin-bottom: 2px;
}

.dopa-msg-content-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 82%;
}

.dopa-msg-bubble {
    background: rgba(18, 26, 43, 0.95);
    color: #e2e8f0;
    padding: 13px 15px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    font-size: 13.5px;
    line-height: 1.6;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    word-break: break-word;
}

.dopa-msg-bubble strong {
    color: #ffffff;
}

.dopa-msg-time {
    font-size: 11px;
    color: #64748b;
    margin-left: 4px;
}

/* 5. 하단 메시지 입력창 */
.dopa-chat-footer {
    padding: 12px 16px;
    background: rgba(9, 14, 24, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dopa-input-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 4px 6px 4px 16px;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dopa-input-box:focus-within {
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 14px rgba(255, 46, 147, 0.35);
    border-color: #ff2e93;
}

.dopa-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13.5px;
    color: #ffffff;
    outline: none;
    padding: 8px 0;
}

.dopa-chat-input::placeholder {
    color: #64748b;
}

.dopa-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #FF2E93 0%, #D6006B 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    outline: none;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(255, 46, 147, 0.35);
}

.dopa-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(255, 46, 147, 0.55);
}

.dopa-send-btn:active {
    transform: scale(0.95);
}

/* 6. 최하단 안내 및 브랜드 푸터 (By LvDopa) */
.dopa-chat-disclaimer {
    padding: 8px 16px 10px;
    background: rgba(9, 14, 24, 0.98);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.dopa-disclaimer-text {
    font-size: 11px;
    color: #64748b;
}

.dopa-brand-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #a0aec0;
    margin-top: 1px;
}

.dopa-brand-tag img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* 7. 모바일 및 작은 창 (600px 이하) 100% 풀스크린 반응형 처리 */
@media (max-width: 600px) {
    .dopa-chat-launcher {
        bottom: 20px;
        right: 18px;
        width: 60px;
        height: 50px;
    }
    .dopa-chat-launcher-icon {
        width: 26px;
        height: 26px;
    }
    .dopa-chat-window {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease !important;
    }
    .dopa-chat-window.open {
        transform: translateY(0) !important;
    }
    .dopa-chat-header {
        padding: 16px 18px;
        border-radius: 0;
    }
    .dopa-chat-footer {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
}

/* 8. 챗봇 상단 2줄 미니 설명 툴팁 카드 */
.dopa-chat-tooltip {
    position: fixed;
    bottom: 92px;
    right: 28px;
    background: rgba(13, 20, 33, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 46, 147, 0.38);
    border-radius: 14px;
    padding: 9px 12px 9px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 15px rgba(255, 46, 147, 0.16);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9997;
    cursor: default;
    user-select: none;
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.dopa-chat-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dopa-chat-tooltip:hover {
    border-color: #ff2e93;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 46, 147, 0.25);
}

/* 하단 미니 꼬리 팁 */
.dopa-chat-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 28px;
    width: 10px;
    height: 10px;
    background: rgba(13, 20, 33, 0.94);
    border-right: 1px solid rgba(255, 46, 147, 0.38);
    border-bottom: 1px solid rgba(255, 46, 147, 0.38);
    transform: rotate(45deg);
}

.dopa-tooltip-text-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.dopa-tooltip-line1 {
    font-size: 11.5px;
    font-weight: 500;
    color: #a0aec0;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.dopa-tooltip-line2 {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dopa-tooltip-line2 span.highlight {
    color: #ff2e93;
    text-shadow: 0 0 8px rgba(255, 46, 147, 0.4);
}

.dopa-tooltip-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8a99ad;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.dopa-tooltip-close-btn:hover {
    background: rgba(255, 46, 147, 0.25);
    color: #ffffff;
    border-color: rgba(255, 46, 147, 0.5);
    transform: scale(1.1);
}

@media (max-width: 480px) {
    .dopa-chat-tooltip {
        right: 18px;
        bottom: 82px;
        padding: 8px 10px 8px 12px;
    }
    .dopa-chat-tooltip::after {
        right: 22px;
    }
}
