@charset "UTF-8";

/* ================================
   네비게이션 챗봇 버튼
================================ */
.chatbot-nav-btn {
    background: var(--color-pink-dark);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 15px;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.chatbot-nav-btn:hover {
    background: var(--color-pink);
    transform: scale(1.05);
}

.chatbot-nav-btn i {
    font-size: 14px;
}

/* ================================
   플로팅 FAB 버튼
================================ */
.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-pink-dark);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(201, 151, 155, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 9998;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    animation: fabPulse 3s infinite;
}

.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(201, 151, 155, 0.7);
    background: var(--color-pink);
}

.chatbot-fab.hidden {
    transform: scale(0);
    pointer-events: none;
}

.chatbot-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #d32f2f;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: badgePop 0.3s ease;
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(201, 151, 155, 0.5); }
    50% { box-shadow: 0 4px 24px rgba(201, 151, 155, 0.8); }
}

@keyframes badgePop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ================================
   챗봇 위젯 컨테이너
================================ */
.chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 560px;
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-widget.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ================================
   챗봇 헤더
================================ */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-pink-dark), #b5868a);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-title i {
    font-size: 20px;
}

.chatbot-header-status {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.chatbot-status-dot {
    width: 7px;
    height: 7px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ================================
   메시지 영역
================================ */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--color-bg);
}

/* 스크롤바 */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

/* ================================
   메시지 래퍼 (버블 + 타임스탬프)
================================ */
.chatbot-msg-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

.chatbot-msg-wrapper.bot {
    align-self: flex-start;
}

.chatbot-msg-wrapper.user {
    align-self: flex-end;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================
   메시지 버블
================================ */
.chatbot-message {
    padding: 11px 15px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.65;
    word-break: keep-all;
}

.chatbot-message.bot {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
}

.chatbot-message.user {
    background: var(--color-pink-dark);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ================================
   타임스탬프
================================ */
.chatbot-timestamp {
    font-size: 10px;
    color: #aaa;
    margin-top: 3px;
    padding: 0 4px;
}

.chatbot-msg-wrapper.user .chatbot-timestamp {
    text-align: right;
}

.chatbot-msg-wrapper.bot .chatbot-timestamp {
    text-align: left;
}

/* ================================
   타이핑 인디케이터
================================ */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px !important;
    min-width: 60px;
}

.chatbot-typing .dot {
    width: 8px;
    height: 8px;
    background: #bbb;
    border-radius: 50%;
    animation: typingDot 1.2s infinite;
}

.chatbot-typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ================================
   빠른 답변 버튼
================================ */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    animation: messageIn 0.3s ease;
}

.chatbot-quick-btn {
    background: var(--color-white);
    color: var(--color-pink-dark);
    border: 1.5px solid var(--color-pink);
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chatbot-quick-btn:hover {
    background: var(--color-pink-dark);
    color: #fff;
    border-color: var(--color-pink-dark);
}

/* ================================
   입력 영역
================================ */
.chatbot-input {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
    border-top: 1px solid var(--color-border);
    background: var(--color-white);
    flex-shrink: 0;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: var(--color-pink);
}

.chatbot-input input::placeholder {
    color: #aaa;
}

.chatbot-send-btn {
    background: var(--color-pink-dark);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    background: var(--color-pink);
    transform: scale(1.05);
}

/* ================================
   반응형 - 태블릿 (768px 이하)
================================ */
@media (max-width: 768px) {
    .nav-chatbot {
        border-bottom: none !important;
    }

    .chatbot-nav-btn {
        margin: 10px 20px;
        font-size: 14px;
        padding: 10px 20px;
        width: calc(100% - 40px);
        justify-content: center;
    }

    .chatbot-fab {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
        font-size: 22px;
    }

    .chatbot-widget {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        transform: translateY(100%);
    }

    .chatbot-widget.active {
        transform: translateY(0);
    }
}

/* ================================
   반응형 - 모바일 (480px 이하)
================================ */
@media (max-width: 480px) {
    .chatbot-nav-btn {
        font-size: 13px;
        padding: 8px 16px;
        margin: 8px 15px;
        width: calc(100% - 30px);
    }

    .chatbot-fab {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .chatbot-header {
        padding: 14px 16px;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .chatbot-input {
        padding: 10px 12px;
    }

    .chatbot-input input {
        padding: 8px 14px;
        font-size: 13px;
    }

    .chatbot-message {
        font-size: 13px;
    }

    .chatbot-quick-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}
