.chat-robot *,
.chat-robot-container *,
.chat-robot-face *,
.chat-robot-eyes *,
.chat-robot-eye *,
.chat-robot-mouth * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.chat-avatar .chat-robot,
.chat-avatar .chat-robot * {
    font-size: 0;
    line-height: 0;
    letter-spacing: 0;
    text-shadow: none;
    text-transform: none;
    word-spacing: 0;
    text-decoration: none;
    pointer-events: none;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: rgba(28, 32, 44, 0.95);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    max-height: 50vh;
    height: 50vh;
}

.chat-message {
    display: flex;
    margin-bottom: 16px;
    position: relative;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: visible;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    margin: 0 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.user .chat-bubble {
    background-color: #4c5af2;
    color: white;
}

.ai .chat-bubble {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.chat-message.system {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.chat-system-bubble {
    background-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 12px;
    max-width: 80%;
    text-align: center;
}

.chat-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.chat-content {
    line-height: 1.4;
    white-space: pre-wrap;
}

.chat-input {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    min-height: 74px;
}

.chat-input textarea {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px 15px;
    border-radius: 18px;
    color: white;
    resize: none;
    outline: none;
    font-family: inherit;
}

.chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #4c5af2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-end;
}

.send-button:hover {
    background-color: #3a46c5;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header .title {
    color: white;
    margin: 0;
    font-size: 16px;
}

.chat-header .subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 5px;
}

.clear-chat-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
    transition: background-color 0.2s;
}

.clear-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.typing-indicator {
    display: flex;
    padding: 3px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #bbb;
    border-radius: 50%;
    margin: 0 2px;
    display: inline-block;
    opacity: 0.4;
}

.typing-indicator span:nth-child(1) {
    animation: bounce 1.2s 0.1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation: bounce 1.2s 0.3s ease-in-out infinite;
}

.typing-indicator span:nth-child(3) {
    animation: bounce 1.2s 0.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
} 

.chat-robot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3e9eff;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: visible;
    position: relative;
}

.chat-robot-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #42a5f5, #1976d2);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.chat-robot-face {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.chat-robot-eyes {
    width: 60%;
    display: flex;
    justify-content: space-around;
    margin-top: 0px;
    position: relative;
    z-index: 6;
}

.chat-robot-eye {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    z-index: 6;
    animation: chatBlink 6s infinite;
}

.chat-robot-eye.left-eye {
    transform-origin: center;
}

.chat-robot-eye.right-eye {
    transform-origin: center;
}

.chat-robot-mouth {
    width: 8px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    margin-top: 3px;
    position: relative;
    z-index: 6;
}

@keyframes chatBlink {
    0% { transform: scaleY(1); }
    45% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
    55% { transform: scaleY(1); }
    100% { transform: scaleY(1); }
}

@keyframes chatMouthMove {
    0% { width: 8px; height: 2px; }
    30% { width: 10px; height: 3px; }
    60% { width: 7px; height: 2px; }
    100% { width: 8px; height: 2px; }
}

.typing-indicator .chat-robot-mouth {
    animation: chatMouthMove 1s infinite;
}

.chat-message-ai {
    animation: messageAppear 0.5s ease-in-out;
}

@keyframes messageAppear {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.chat-content {
    position: relative;
    transition: all 0.3s ease;
}

.chat-message-ai:hover .chat-content {
    transform: scale(1.01);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #3e9eff;
    margin-right: 4px;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.chat-message-ai .chat-avatar {
    width: 36px;
    height: 36px;
    position: relative;
    overflow: visible !important;
    background: #3e9eff;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-avatar .chat-robot,
.chat-avatar .chat-robot-container,
.chat-avatar .chat-robot-face,
.chat-avatar .chat-robot-eyes,
.chat-avatar .chat-robot-eye,
.chat-avatar .chat-robot-mouth {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.chat-avatar .chat-robot {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(135deg, #42a5f5, #1976d2);
}

.chat-avatar .chat-robot .chat-robot-face {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

.chat-avatar .chat-robot .chat-robot-face .chat-robot-eyes {
    width: 60%;
    display: flex;
    justify-content: space-around;
    position: relative;
    margin-bottom: 4px;
}

.chat-avatar .chat-robot .chat-robot-face .chat-robot-eyes .chat-robot-eye {
    width: 4px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 50%;
    position: relative;
}

.chat-avatar .chat-robot .chat-robot-face .chat-robot-mouth {
    width: 8px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
}

@keyframes chatEyeBlink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.chat-avatar .chat-robot .chat-robot-face .chat-robot-eyes .chat-robot-eye {
    animation: chatEyeBlink 6s infinite;
} 

.typing-indicator-container .chat-avatar {
    animation: enhancedPulse 2s infinite;
}

@keyframes enhancedPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(66, 165, 245, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(66, 165, 245, 0), 0 0 20px rgba(66, 165, 245, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(66, 165, 245, 0); }
}

.chat-avatar svg {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
    will-change: transform;
}

.chat-avatar svg circle,
.chat-avatar svg path {
    will-change: transform, d, ry, rx;
    animation-timing-function: ease-in-out;
} 