/* 챗봇 플로팅 버튼 */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #5AABA5 0%, #4A9A94 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(90, 171, 165, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(90, 171, 165, 0.6);
}

.chatbot-button:active {
    transform: scale(0.95);
}

.chatbot-icon {
    width: 45px;
    height: 45px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* 챗봇 창 */
.chatbot-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 400px;
    height: 600px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

.chatbot-window.minimized {
    height: 60px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 챗봇 헤더 */
.chatbot-header {
    background: linear-gradient(135deg, #5AABA5 0%, #4A9A94 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    padding: 5px;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

.online-status {
    font-size: 12px;
    opacity: 0.9;
}

.online-status::before {
    content: '●';
    color: #2ecc71;
    margin-right: 5px;
}

.chatbot-header-right {
    display: flex;
    gap: 10px;
}

.header-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 메시지 영역 */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-window.minimized .chatbot-messages {
    display: none;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #5AABA5;
    border-radius: 3px;
}

/* 메시지 */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.5;
}

.bot-message .message-bubble {
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    align-items: flex-end;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #5AABA5 0%, #4A9A94 100%);
    color: white;
}

.user-message .message-avatar {
    display: none;
}

.message-time {
    font-size: 11px;
    color: #999;
    padding: 0 5px;
}

/* 타이핑 인디케이터 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #5AABA5;
    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); }
    30% { transform: translateY(-10px); }
}

/* 빠른 답변 */
.chatbot-quick-replies {
    padding: 15px 20px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-window.minimized .chatbot-quick-replies {
    display: none;
}

.quick-reply-btn {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #5AABA5;
    color: #5AABA5;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background-color: #5AABA5;
    color: white;
}

/* 입력 영역 */
.chatbot-input-area {
    padding: 15px 20px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-window.minimized .chatbot-input-area {
    display: none;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-input:focus {
    border-color: #5AABA5;
}

.chatbot-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #5AABA5 0%, #4A9A94 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(90, 171, 165, 0.4);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 반응형 */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 100px;
        height: 500px;
    }

    .chatbot-button {
        width: 60px;
        height: 60px;
        right: 20px;
        bottom: 20px;
    }

    .chatbot-icon {
        width: 35px;
        height: 35px;
    }
}
