/**
 * 테라 챗봇 스타일
 */

/* === 챗봇 위젯 버튼 === */
.terra-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0064ff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 100, 255, 0.3);
    z-index: 9999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.terra-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 100, 255, 0.4);
}

.terra-chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* === 알림 배지 === */
.terra-chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #dc3545;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
    animation: terra-badge-pulse 1.5s infinite;
}

@keyframes terra-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === 챗봇 창 === */
.terra-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.terra-chatbot-window.open {
    display: flex;
}

/* === 헤더 === */
.terra-chatbot-header {
    padding: 16px 20px;
    background: #0064ff;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terra-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.terra-chatbot-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* === 메시지 영역 === */
.terra-chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
}

.terra-chatbot-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.terra-chatbot-message.sent {
    align-items: flex-end;
}

.terra-chatbot-message.received {
    align-items: flex-start;
}

.terra-chatbot-message .sender {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

.terra-chatbot-message .bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.terra-chatbot-message.sent .bubble {
    background: #0064ff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.terra-chatbot-message.received .bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.terra-chatbot-message.system .bubble {
    background: #e9ecef;
    color: #6c757d;
    font-size: 12px;
    text-align: center;
    max-width: 100%;
}

/* === 입력 영역 === */
.terra-chatbot-input {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
}

.terra-chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.terra-chatbot-input input:focus {
    border-color: #0064ff;
}

.terra-chatbot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0064ff;
    border: none;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
}

.terra-chatbot-input button:hover {
    background: #0050cc;
}

/* === 연결 상태 === */
.terra-chatbot-status {
    padding: 8px 16px;
    font-size: 12px;
    text-align: center;
}

.terra-chatbot-status.connected {
    background: #d4edda;
    color: #155724;
}

.terra-chatbot-status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

/* === 반응형 === */
@media (max-width: 480px) {
    .terra-chatbot-window {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 90px;
        height: 60vh;
    }

    .terra-chatbot-toggle {
        bottom: 16px;
        right: 16px;
    }
}
