/* ===========================================
   FAQ Chatbot Widget Styles
   개미창고 챗봇 스타일 FAQ 위젯
   =========================================== */

/* 플로팅 버튼 */
.faq-chatbot-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.faq-chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.faq-chatbot-btn:active {
    transform: scale(0.95);
}

.faq-chatbot-btn svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

/* 툴팁 */
.faq-chatbot-btn .tooltip {
    position: absolute;
    right: 70px;
    background: #0C1B2E;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.faq-chatbot-btn .tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #0C1B2E;
}

.faq-chatbot-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* 챗봇 창 컨테이너 */
.faq-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 420px;
    height: 620px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 챗봇 헤더 */
.faq-chatbot-header {
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.faq-chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-chatbot-header-title svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

.faq-chatbot-header-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.faq-chatbot-header-title span {
    font-size: 12px;
    opacity: 0.8;
}

.faq-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.faq-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.faq-chatbot-close svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
}

/* 카테고리 탭 */
.faq-chatbot-tabs {
    display: flex;
    padding: 12px 16px;
    gap: 8px;
    background: #F4F6FA;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.faq-chatbot-tabs::-webkit-scrollbar {
    display: none;
}

.faq-chatbot-tab {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: #ffffff;
    border: 1px solid #D6DAE3;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.faq-chatbot-tab:hover {
    border-color: #6366F1;
    color: #6366F1;
}

.faq-chatbot-tab.active {
    background: #6366F1;
    color: #ffffff;
    border-color: #6366F1;
}

/* FAQ 목록 */
.faq-chatbot-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.faq-chatbot-content::-webkit-scrollbar {
    width: 4px;
}

.faq-chatbot-content::-webkit-scrollbar-track {
    background: #F4F6FA;
}

.faq-chatbot-content::-webkit-scrollbar-thumb {
    background: #D6DAE3;
    border-radius: 4px;
}

/* FAQ 아이템 */
.faq-chatbot-item {
    background: #F4F6FA;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-chatbot-item:last-child {
    margin-bottom: 0;
}

.faq-chatbot-question {
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: background 0.2s ease;
}

.faq-chatbot-question:hover {
    background: #EEF2FF;
}

.faq-chatbot-question-icon {
    width: 20px;
    height: 20px;
    background: #6366F1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.faq-chatbot-question-icon span {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.faq-chatbot-question-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #0C1B2E;
    line-height: 1.5;
}

.faq-chatbot-question-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.faq-chatbot-question-arrow svg {
    width: 12px;
    height: 12px;
    fill: #ADB2BB;
}

.faq-chatbot-item.active .faq-chatbot-question-arrow {
    transform: rotate(180deg);
}

.faq-chatbot-item.active .faq-chatbot-question-arrow svg {
    fill: #6366F1;
}

/* FAQ 답변 */
.faq-chatbot-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-chatbot-item.active .faq-chatbot-answer {
    max-height: 500px;
}

.faq-chatbot-answer-content {
    padding: 0 16px 16px 46px;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}

.faq-chatbot-answer-content a {
    color: #6366F1;
    text-decoration: none;
}

.faq-chatbot-answer-content a:hover {
    text-decoration: underline;
}

/* 하단 액션 영역 */
.faq-chatbot-footer {
    padding: 16px;
    border-top: 1px solid #E8EAED;
    background: #ffffff;
    flex-shrink: 0;
}

.faq-chatbot-footer-info {
    font-size: 12px;
    color: #ADB2BB;
    text-align: center;
    margin-bottom: 12px;
}

.faq-chatbot-footer-info strong {
    color: #6366F1;
}

.faq-chatbot-inquiry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #6366F1;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.faq-chatbot-inquiry-btn:hover {
    background: #818CF8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.faq-chatbot-inquiry-btn svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

/* 빈 상태 */
.faq-chatbot-empty {
    text-align: center;
    padding: 40px 20px;
    color: #ADB2BB;
}

.faq-chatbot-empty svg {
    width: 48px;
    height: 48px;
    fill: #D6DAE3;
    margin-bottom: 12px;
}

.faq-chatbot-empty p {
    font-size: 14px;
}

/* 반응형 - 모바일 */
@media screen and (max-width: 768px) {
    .faq-chatbot-btn {
        bottom: 20px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .faq-chatbot-btn svg {
        width: 24px;
        height: 24px;
    }

    .faq-chatbot-btn .tooltip {
        display: none;
    }

    .faq-chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .faq-chatbot-window.active {
        transform: translateY(0) scale(1);
    }

    .faq-chatbot-header {
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .faq-chatbot-tabs {
        padding: 12px;
    }

    .faq-chatbot-content {
        padding: 12px;
    }

    .faq-chatbot-footer {
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* 반응형 - 태블릿 */
@media screen and (max-width: 480px) {
    .faq-chatbot-question-text {
        font-size: 13px;
    }

    .faq-chatbot-answer-content {
        font-size: 12px;
        padding-left: 40px;
    }
}

/* 애니메이션 키프레임 */
@keyframes chatbotPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(99, 102, 241, 0.45);
    }
}

.faq-chatbot-btn.pulse {
    animation: chatbotPulse 2s infinite;
}
