/* ============================================
   AI Chatbot Widget Styles
   ============================================ */

/* Prevent body scroll when chatbot is open */
body.chatbot-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Chatbot Button */
.chatbot-button {
    position: fixed;
    bottom: 130px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: transparent; /* 改为透明，只显示Lottie动画 */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* 移除阴影 */
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.chatbot-button.hide {
    opacity: 0;
    transform: scale(0) rotate(180deg);
    pointer-events: none;
}

/* Lottie Ripple Animation Container */
.chatbot-button-lottie {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%) scale(2);
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

/* Removed rotating gradient border */

/* Glow pulse animation for the ring */
@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow:
            0 0 20px rgba(102, 126, 234, 0.6),
            0 0 40px rgba(102, 126, 234, 0.4),
            inset 0 0 20px rgba(102, 126, 234, 0.2);
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
        box-shadow:
            0 0 30px rgba(102, 126, 234, 0.8),
            0 0 60px rgba(102, 126, 234, 0.6),
            inset 0 0 30px rgba(102, 126, 234, 0.3);
    }
}

/* Orbiting glowing ball */
.orbit-ball {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #ffffff 0%, #4da6ff 50%, #0066cc 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin-top: -6px;
    margin-left: -6px;
    animation: orbit 3s linear infinite;
    box-shadow:
        0 0 15px rgba(77, 166, 255, 0.8),
        0 0 30px rgba(77, 166, 255, 0.6),
        0 0 45px rgba(77, 166, 255, 0.4);
    z-index: 10;
    pointer-events: none;
}

/* Orbit animation - Elliptical path for 3D effect */
@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(50px) translateY(0px) rotate(0deg) scale(1);
        opacity: 1;
        z-index: 10;
    }
    25% {
        transform: rotate(90deg) translateX(50px) translateY(-15px) rotate(-90deg) scale(0.85);
        opacity: 0.7;
        z-index: 5;
    }
    50% {
        transform: rotate(180deg) translateX(50px) translateY(0px) rotate(-180deg) scale(0.7);
        opacity: 0.5;
        z-index: 1;
    }
    75% {
        transform: rotate(270deg) translateX(50px) translateY(15px) rotate(-270deg) scale(0.85);
        opacity: 0.7;
        z-index: 5;
    }
    100% {
        transform: rotate(360deg) translateX(50px) translateY(0px) rotate(-360deg) scale(1);
        opacity: 1;
        z-index: 10;
    }
}

.chatbot-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.chatbot-button:active {
    transform: translateY(-2px) scale(0.98);
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Robot Icon Container */
.robot-icon {
    width: 60px;
    height: 60px;
    position: relative;
    animation: float 3s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(102, 177, 234, 0.3) 0%, rgba(118, 75, 162, 0.5) 100%);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

/* Robot Head - Based on Lottie Animation */
.robot-head {
    width: 40px;
    height: 40px;
    background: linear-gradient(180deg, #0b4f6c 0%, #6096ad 50%, #b5d6f4 100%);
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    animation: headShake 4s ease-in-out infinite;
    box-shadow: 0 3px 10px rgba(11, 79, 108, 0.4);
}

@keyframes headShake {
    0%, 90%, 100% {
        transform: rotate(0deg);
    }
    92% {
        transform: rotate(-8deg);
    }
    94% {
        transform: rotate(8deg);
    }
    96% {
        transform: rotate(-6deg);
    }
    98% {
        transform: rotate(4deg);
    }
}

/* Robot Antenna - Cyan glow like Lottie */
.robot-antenna {
    position: absolute;
    top: -10px;
    right: 10px;
    width: 3px;
    height: 10px;
    background: #7afbfc;
    border-radius: 2px;
}

.robot-antenna::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, #7afbfc 0%, #49a8fc 100%);
    border-radius: 50%;
    animation: antennaBlink 2s ease-in-out infinite;
}

@keyframes antennaBlink {
    0%, 90%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px #7afbfc, 0 0 15px rgba(122, 251, 252, 0.5);
    }
    95% {
        opacity: 0.5;
        box-shadow: 0 0 5px #7afbfc;
    }
}

/* Robot Eyes - Cyan oval eyes like Lottie */
.robot-eyes {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 0;
}

.robot-eye {
    width: 9px;
    height: 14px;
    background: #7afbfc;
    border-radius: 50%;
    position: relative;
    animation: eyeBlink 4s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(122, 251, 252, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.robot-eye::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 2px;
    width: 3px;
    height: 5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

@keyframes eyeBlink {
    0%, 48%, 52%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

/* Robot Mouth - White smile like Lottie */
.robot-mouth {
    width: 18px;
    height: 9px;
    border: 2.5px solid #ffffff;
    border-top: none;
    border-radius: 0 0 14px 14px;
    margin: 4px auto 0;
    animation: mouthTalk 3s ease-in-out infinite;
    background: transparent;
}

@keyframes mouthTalk {
    0%, 80%, 100% {
        transform: scaleY(1);
    }
    85%, 95% {
        transform: scaleY(1.3);
    }
    90% {
        transform: scaleY(0.8);
    }
}

/* Robot Body - Blue gradient like Lottie */
.robot-body {
    width: 32px;
    height: 16px;
    background: linear-gradient(180deg, #0b4f6c 0%, #6096ad 50%, #b5d6f4 100%);
    border-radius: 0 0 10px 10px;
    margin: 2px auto 0;
    position: relative;
    box-shadow: 0 2px 6px rgba(11, 79, 108, 0.3);
}

/* Robot Ears - Small circles on sides */
.robot-head::before,
.robot-head::after {
    content: '';
    position: absolute;
    top: 12px;
    width: 10px;
    height: 10px;
    background: #14507c;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.robot-head::before {
    left: -6px;
}

.robot-head::after {
    right: -6px;
}

/* Arc Reactor - Cyan energy core like Lottie */
.arc-reactor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, #7afbfc 0%, #49a8fc 100%);
    border-radius: 50%;
    box-shadow:
        0 0 8px #7afbfc,
        0 0 15px rgba(122, 251, 252, 0.6),
        inset 0 0 3px rgba(255, 255, 255, 0.9);
    animation: arc-reactor-pulse 2s ease-in-out infinite;
}

@keyframes arc-reactor-pulse {
    0%, 100% {
        box-shadow:
            0 0 8px #7afbfc,
            0 0 15px rgba(122, 251, 252, 0.6),
            inset 0 0 3px rgba(255, 255, 255, 0.9);
        opacity: 1;
    }
    50% {
        box-shadow:
            0 0 12px #7afbfc,
            0 0 25px rgba(122, 251, 252, 0.9),
            inset 0 0 4px rgba(255, 255, 255, 1);
        opacity: 0.95;
    }
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #FF6B35, #ff8c5a);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

/* Chatbot Button Label */
.chatbot-button-label {
    position: fixed;
    bottom: 210px;
    right: 65px; /* Align with center of button: 30px (button right) + 35px (half of 70px button width) */
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
    z-index: 999;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    letter-spacing: 0.5px;
    /* Center align with chatbot button */
    transform: translateX(50%);
}

.chatbot-button-label.hide {
    opacity: 0;
    transform: translateX(50%) translateY(10px);
}

/* First Visit Tooltip */
.chatbot-tooltip {
    position: fixed;
    bottom: 210px;
    right: 30px;
    background: white;
    color: #333;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 999;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 280px;
    line-height: 1.5;
}

.chatbot-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 40px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.chatbot-tooltip .close-tooltip {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
    transition: color 0.2s ease;
}

.chatbot-tooltip .close-tooltip:hover {
    color: #333;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 18px rgba(255, 107, 53, 0.7);
    }
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 130px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 170px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.show {
    display: flex;
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(102, 126, 234, 0.2);
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: visible;
}

.chatbot-avatar.show {
    opacity: 1;
    transform: scale(1);
    animation: avatarPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Sleeping state - close eyes */
.chatbot-avatar.sleeping .chatbot-avatar-lottie svg g ellipse {
    transform: scaleY(0) !important;
    transform-origin: center !important;
    transition: transform 0.3s ease !important;
}

.chatbot-avatar.sleeping .chatbot-avatar-lottie svg path[fill*="0.4784"],
.chatbot-avatar.sleeping .chatbot-avatar-lottie svg path[fill*="0.478"] {
    transform: scaleY(0) !important;
    transform-origin: center !important;
    transition: transform 0.3s ease !important;
}

@keyframes avatarPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    70% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Chatbot Avatar Lottie Animation */
.chatbot-avatar-lottie {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 0;
    transform: scale(2);
}

.chatbot-avatar-lottie svg {
    width: 100% !important;
    height: 100% !important;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-title p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.status-indicator.status-online {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-indicator.status-offline {
    background-color: #50545d;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.4);
}

.status-indicator.status-error {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.status-indicator.status-checking {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 12px;
}

/* Avatar Lottie animation states can be controlled via JS if needed */

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

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 30px; /* Extra padding at bottom for better visibility */
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth; /* Smooth scrolling */
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

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

/* Message Bubbles */
.chatbot-message {
    display: flex;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.chatbot-message.show {
    opacity: 1;
    transform: translateY(0);
}

.chatbot-message-bot {
    justify-content: flex-start;
}

.chatbot-message-user {
    justify-content: flex-end;
}

.chatbot-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message-bot .chatbot-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chatbot-message-user .chatbot-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Menu Options */
.chatbot-menu-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    max-width: 85%;
    background: transparent !important;
    box-shadow: none !important;
}

.chatbot-menu-button {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chatbot-menu-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatbot-menu-button:active {
    transform: translateX(2px);
}

/* Typing Indicator */
.chatbot-typing-indicator {
    animation: fadeIn 0.3s ease;
    margin-bottom: 8px;
}

.chatbot-typing-indicator .chatbot-message {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    min-height: 40px;
}

.typing-dots span {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
    display: inline-block;
}

.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 typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-15px);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 16px; /* iOS requires 16px to prevent auto-zoom */
    font-family: inherit;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    max-height: 120px;
    overflow-y: auto;
}

.chatbot-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-input::-webkit-scrollbar {
    width: 4px;
}

.chatbot-input::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-button {
        width: 60px;
        height: 60px;
        bottom: 110px;
        right: 20px;
    }

    .robot-icon {
        width: 50px;
        height: 50px;
        padding: 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .robot-head {
        width: 34px;
        height: 30px;
        margin: 0;
    }

    .robot-eyes {
        padding: 8px 6px 0;
    }

    .robot-eye {
        width: 8px;
        height: 8px;
    }

    .robot-eye::after {
        width: 3px;
        height: 3px;
        top: 2px;
        left: 2px;
    }

    .robot-mouth {
        width: 16px;
        height: 8px;
        margin-top: 4px;
    }

    .robot-antenna {
        height: 5px;
        top: -7px;
        width: 2px;
    }

    .robot-antenna::after {
        width: 5px;
        height: 5px;
        top: -3px;
    }

    .robot-body {
        width: 26px;
        height: 13px;
        margin-top: 2px;
    }

    .robot-body::before,
    .robot-body::after {
        width: 3px;
        height: 7px;
        top: 3px;
    }

    .robot-body::before {
        left: -4px;
    }

    .robot-body::after {
        right: -4px;
    }

    .arc-reactor {
        width: 5px;
        height: 5px;
    }

    /* Smaller orbit ball on mobile */
    .orbit-ball {
        width: 10px;
        height: 10px;
        margin-top: -5px;
        margin-left: -5px;
    }

    /* Smaller orbit radius on mobile - Elliptical path */
    @keyframes orbit {
        0% {
            transform: rotate(0deg) translateX(42px) translateY(0px) rotate(0deg) scale(1);
            opacity: 1;
            z-index: 10;
        }
        25% {
            transform: rotate(90deg) translateX(42px) translateY(-12px) rotate(-90deg) scale(0.85);
            opacity: 0.7;
            z-index: 5;
        }
        50% {
            transform: rotate(180deg) translateX(42px) translateY(0px) rotate(-180deg) scale(0.7);
            opacity: 0.5;
            z-index: 1;
        }
        75% {
            transform: rotate(270deg) translateX(42px) translateY(12px) rotate(-270deg) scale(0.85);
            opacity: 0.7;
            z-index: 5;
        }
        100% {
            transform: rotate(360deg) translateX(42px) translateY(0px) rotate(-360deg) scale(1);
            opacity: 1;
            z-index: 10;
        }
    }

    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100dvh; /* Use dynamic viewport height for mobile browsers */
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
    }

    .chatbot-window.show {
        display: flex !important;
        flex-direction: column;
    }

    /* Fallback for browsers that don't support dvh */
    @supports not (height: 100dvh) {
        .chatbot-window {
            height: 100vh;
            max-height: 100vh;
        }
    }

    .chatbot-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .chatbot-button-label {
        bottom: 180px;
        right: 50px; /* Align with center of button: 20px (button right) + 30px (half of 60px button width) */
        transform: translateX(50%); /* Center align with button */
        font-size: 11px;
        padding: 6px 12px;
    }

    .chatbot-tooltip {
        bottom: 180px;
        right: 20px;
        font-size: 13px;
        padding: 10px 14px;
        max-width: calc(100vw - 80px);
    }

    .chatbot-tooltip::after {
        right: 30px;
    }

    .chatbot-header {
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        border-radius: 0;
        flex-shrink: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .chatbot-messages {
        padding: 16px;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .chatbot-input-area {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        border-radius: 0;
        flex-shrink: 0;
        background: white;
        position: relative;
        z-index: 10;
        border-top: 2px solid #e9ecef;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    }

    .chatbot-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }

    .chatbot-send {
        flex-shrink: 0;
    }

    .chatbot-message-bubble {
        max-width: 85%;
        font-size: 13px;
    }
}

