/* ====================================
   AI 챗봇 스타일
   - 녹색 원형 버튼 (카카오톡 스타일)
   - 하이브리드: 데스크톱 350x500px, 모바일 전체화면
   ==================================== */

/* 챗봇 버튼 (닫힘 상태) */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #667eea; /* 보라색 (사이트 메인 컬러) */
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.chatbot-button i {
    font-size: 28px;
    color: white;
}

/* 챗봇 창 컨테이너 */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.chatbot-container.active {
    display: flex;
}

/* 헤더 */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 사이트 메인 그라디언트 */
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background 0.2s;
}

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

/* 채팅 영역 */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

/* 메시지 */
.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

/* 봇 메시지 */
.message.bot {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar i {
    font-size: 18px;
    color: white;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
}

/* 사용자 메시지 */
.message.user {
    display: flex;
    justify-content: flex-end;
}

.message.user .message-bubble {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

/* 빠른 질문 버튼 */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background: white;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: #667eea;
    color: white;
}

/* 상품 링크 버튼 */
.product-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s;
}

.product-link:hover {
    background: #764ba2;
    color: white;
    text-decoration: none;
}

/* 입력 영역 */
.chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.chatbot-input input:focus {
    border-color: #667eea;
}

.chatbot-send {
    background: #667eea;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send i {
    font-size: 18px;
}

/* 로딩 애니메이션 */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* ====================================
   모바일 반응형 (작은 채팅창 유지)
   ==================================== */
@media (max-width: 768px) {
    .chatbot-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .chatbot-button i {
        font-size: 24px;
    }
    
    .chatbot-container {
        bottom: 85px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        height: 80vh; /* 화면의 80% 높이 */
        max-height: 600px;
        border-radius: 15px;
    }
    
    .chatbot-header {
        padding: 15px;
    }
    
    .quick-reply-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ====================================
   다크모드 대응 (선택사항)
   ==================================== */
@media (prefers-color-scheme: dark) {
    .chatbot-messages {
        background: #1a1a1a;
    }
    
    .message.bot .message-bubble {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .chatbot-input {
        background: #2a2a2a;
        border-top-color: #3a3a3a;
    }
    
    .chatbot-input input {
        background: #1a1a1a;
        color: #e0e0e0;
        border-color: #3a3a3a;
    }
}
