.chat-bubble-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    transition: bottom 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chat-bubble-container.chat-bump {
    bottom: 120px;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--logo-gradient);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), var(--sphere-glow-inner);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0;
    overflow: hidden;
}

.chat-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), var(--nav-hover-glow);
}

.chat-bubble:active {
    transform: scale(0.95);
}

.robot-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.chat-bubble:hover .robot-icon {
    transform: scale(1.1);
}

.robot-head {
    transform-origin: center;
    transition: transform 0.3s ease;
}

.chat-bubble:hover .robot-head {
    animation: robotNod 0.5s ease-in-out infinite alternate;
}

@keyframes robotNod {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-1px);
    }
}

.eye {
    transform-origin: center;
    animation: robotBlink 3s infinite;
}

@keyframes robotBlink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

@media (max-width: 768px) {
    .chat-bubble-container {
        bottom: 20px;
        right: 20px;
    }

    .chat-bubble-container.chat-bump {
        bottom: 110px;
    }

    .chat-bubble {
        width: 50px;
        height: 50px;
    }

    .robot-icon {
        width: 32px;
        height: 32px;
    }
}

.chat-speech-bubble {
    position: absolute;
    bottom: 72px;
    right: 0;
    background: #ffffff;
    color: #1a3a52;
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 16px 16px 4px 16px;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.7) translateY(8px);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.4);
}

.chat-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 18px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

.chat-speech-bubble.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.chat-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 300px;
    height: 400px;
    background: rgba(12, 28, 50, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(77, 232, 194, 0.18);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.85) translateY(12px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.chat-window-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(30, 75, 156, 0.7), rgba(55, 181, 148, 0.5));
    border-bottom: 1px solid rgba(77, 232, 194, 0.15);
    flex-shrink: 0;
}

.chat-window-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--logo-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.chat-window-title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: #e8f4f8;
    margin: 0;
    flex: 1;
}

.chat-window-status {
    font-family: 'Roboto', sans-serif;
    font-size: 0.7rem;
    color: #4de8c2;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.chat-window-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4de8c2;
    box-shadow: 0 0 6px #4de8c2;
    animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chat-window-close {
    background: none;
    border: none;
    color: rgba(232, 244, 248, 0.5);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.chat-window-close:hover {
    color: #e8f4f8;
}

.chat-window-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 232, 194, 0.2) transparent;
}

.chat-window-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-window-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-window-messages::-webkit-scrollbar-thumb {
    background: rgba(77, 232, 194, 0.25);
    border-radius: 4px;
}

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    animation: msgFadeIn 0.25s ease;
}

@keyframes msgFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.bot {
    background: rgba(30, 75, 156, 0.35);
    color: #d0eaf5;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chat-msg.user {
    background: rgba(77, 232, 194, 0.18);
    color: #e8f4f8;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-window-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(77, 232, 194, 0.1);
    flex-shrink: 0;
}

.chat-window-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(77, 232, 194, 0.15);
    border-radius: 20px;
    padding: 8px 14px;
    color: #e8f4f8;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-window-input::placeholder {
    color: rgba(232, 244, 248, 0.35);
}

.chat-window-input:focus {
    border-color: rgba(77, 232, 194, 0.4);
}

.chat-window-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--logo-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-window-send:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(77, 232, 194, 0.3);
}

.chat-window-send svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}