/* 챗봇 컨테이너 */
#chatbot-container {
    position: relative;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 채팅 토글 버튼 */
.chatbot-toggle-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #6c757d;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle-btn:active {
    transform: scale(0.95);
}

.chatbot-icon {
    width: 28px;
    height: 28px;
    display: block;
    filter: brightness(0) invert(1);
}

/* 채팅창 */
.chatbot-window {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    z-index: 10000;
}

.chatbot-window.chatbot-hidden {
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    pointer-events: none;
}

/* 채팅창 헤더 */
.chatbot-header {
    background: #4a90e2;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.chatbot-header-icon {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
}

.chatbot-header-text {
    font-size: 16px;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s ease;
    padding: 0;
    pointer-events: auto;
    z-index: 10001;
}

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

.chatbot-close-btn img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

/* 채팅 메시지 영역 */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

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

/* 메시지 버블 */
.chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: chatbot-message-fade-in 0.3s ease;
}

/* FAQ 항목 스타일 */
.chatbot-faq-item {
    margin-bottom: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    border-left: 3px solid #6c757d;
    transition: all 0.2s ease;
    user-select: none;
}

.chatbot-faq-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chatbot-faq-item:active {
    transform: translateX(2px);
}

@keyframes chatbot-message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 봇 메시지 (좌측 정렬) */
.chatbot-message.chatbot-message-bot {
    align-self: flex-start;
}

.chatbot-message-bot .chatbot-message-bubble {
    background: white;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #6c757d;
}

/* 사용자 메시지 (우측 정렬) */
.chatbot-message.chatbot-message-user {
    align-self: flex-end;
}

.chatbot-message-user .chatbot-message-bubble {
    background: #4a90e2;
    color: white;
    border-radius: 18px 18px 4px 18px;
    border: 1px solid #357abd;
}

/* 메시지 버블 */
.chatbot-message-bubble {
    padding: 12px 16px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

/* 메시지 시간 (추후 사용) */
.chatbot-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.chatbot-message-user .chatbot-message-time {
    text-align: right;
}

.chatbot-message-bot .chatbot-message-time {
    text-align: left;
}

/* 빠른 메뉴 버튼 영역 */
.chatbot-quick-buttons {
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    background: white;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    flex-shrink: 0;
}

.chatbot-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    gap: 4px;
}

.chatbot-quick-btn:hover {
    background: #495057;
    border-color: #495057;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(73, 80, 87, 0.2);
}

.chatbot-quick-btn:hover .chatbot-quick-icon {
    filter: brightness(0) invert(1);
}

.chatbot-quick-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.chatbot-quick-text {
    font-weight: 500;
    line-height: 1.2;
}

/* 입력 영역 */
.chatbot-input-area {
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    background: white;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chatbot-input-area.chatbot-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: #6c757d;
    outline: none;
}

.chatbot-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

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

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.chatbot-send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .chatbot-toggle-btn {
        width: 56px;
        height: 56px;
    }

    .chatbot-window {
        position: fixed;
        top: 80px;
        right: 15px;
        left: 15px;
        width: auto;
        height: calc(100vh - 100px);
        max-height: 600px;
    }
}
