.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    color: white;
}

.help-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6);
}

.help-button.active {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

.help-button svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
}

.help-chat-window {
    position: fixed;
    background: #1a1a2e;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.help-chat-window.open {
    display: flex;
}

.help-chat-window.dragging {
    cursor: move;
    user-select: none;
}

.help-chat-window.dragging * {
    pointer-events: none;
}

.help-chat-window.resizing {
    user-select: none;
}

.help-chat-header {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    padding: 16px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}

.help-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.help-chat-title svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.help-context-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
}

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

.help-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.help-chat-close svg {
    width: 18px;
    height: 18px;
}

.help-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #0a0a0f;
}

.help-chat-body::-webkit-scrollbar {
    width: 10px;
}

.help-chat-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin: 4px 0;
}

.help-chat-body::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.help-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
    background-clip: padding-box;
}

.help-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

.help-message.user {
    align-self: flex-end;
}

.help-message.assistant {
    align-self: flex-start;
}

.help-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.help-message.user .help-message-content {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    border-bottom-right-radius: 4px;
}

.help-message.assistant .help-message-content {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.help-suggestion {
    display: inline-block;
    margin: 8px 8px 0 0;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    color: #c4b5fd;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-suggestion:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-2px);
}

.typing-indicator .help-message-content {
    padding: 16px 20px;
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: typingBounce 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 typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.help-chat-footer {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#help-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s ease;
}

#help-chat-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

#help-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#help-chat-input::-webkit-scrollbar {
    width: 6px;
}

#help-chat-input::-webkit-scrollbar-track {
    background: transparent;
}

#help-chat-input::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#help-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
    flex-shrink: 0;
}

#help-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

#help-chat-send:active {
    transform: scale(0.95);
}

#help-chat-send svg {
    width: 20px;
    height: 20px;
}

.help-chat-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    cursor: nwse-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s ease;
    z-index: 10;
}

.help-chat-window:hover .help-chat-resize-handle {
    opacity: 1;
    transform: scale(1.1);
}

.help-chat-resize-handle:hover {
    opacity: 1;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px 0 0 0;
}

.help-chat-resize-handle svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    .help-button {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .help-button svg {
        width: 24px;
        height: 24px;
    }

    .help-chat-window {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        border-radius: 16px;
    }

    .help-chat-header {
        padding: 12px 16px;
        border-radius: 16px 16px 0 0;
    }

    .help-chat-title {
        font-size: 14px;
        gap: 8px;
    }

    .help-chat-title svg {
        width: 20px;
        height: 20px;
    }

    .help-context-badge {
        display: none;
    }

    .help-chat-body {
        padding: 16px;
    }

    .help-message {
        max-width: 90%;
    }

    .help-chat-resize-handle {
        display: none;
    }
}

@media (max-width: 480px) {
    .help-chat-window {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0;
    }

    .help-chat-header {
        border-radius: 0;
    }

    .help-suggestion {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .help-button,
    .help-chat-close,
    #help-chat-send,
    .help-suggestion {
        transition: none;
    }

    .help-message {
        animation: none;
    }

    .typing-dots span {
        animation: none;
    }
}

@media (prefers-color-scheme: light) {
    .help-chat-window {
        background: #ffffff;
        border-color: rgba(0, 0, 0, 0.1);
    }

    .help-chat-body {
        background: #f8f9fa;
    }

    .help-message.assistant .help-message-content {
        background: rgba(0, 0, 0, 0.05);
        color: #2c3e50;
        border-color: rgba(0, 0, 0, 0.1);
    }

    #help-chat-input {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
        color: #2c3e50;
    }

    #help-chat-input::placeholder {
        color: rgba(0, 0, 0, 0.4);
    }

    .help-chat-footer {
        background: rgba(0, 0, 0, 0.02);
        border-top-color: rgba(0, 0, 0, 0.1);
    }
}
