/* Hu Lab AI Copilot Widget */
.lab-copilot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-sans, 'Inter', sans-serif);
}

.copilot-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    transition: all 0.3s ease;
}

.copilot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.45);
}

.copilot-toggle i {
    font-size: 1.1rem;
}

.copilot-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lab-copilot.open .copilot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lab-copilot.open .copilot-toggle {
    opacity: 0;
    pointer-events: none;
}

.copilot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
}

.copilot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.copilot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.copilot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.copilot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.copilot-message {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: copilotFadeIn 0.3s ease;
}

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

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

.copilot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.copilot-message.bot .copilot-avatar {
    background: #e0e7ff;
    color: #4f46e5;
}

.copilot-message.user .copilot-avatar {
    background: #4f46e5;
    color: #fff;
}

.copilot-bubble {
    max-width: 260px;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copilot-message.bot .copilot-bubble {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.copilot-message.user .copilot-bubble {
    background: #4f46e5;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.copilot-input-area {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.copilot-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.copilot-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.copilot-send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #4f46e5;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.copilot-send:hover:not(:disabled) {
    background: #4338ca;
    transform: scale(1.05);
}

.copilot-send:disabled {
    background: #a5b4fc;
    cursor: not-allowed;
}

.copilot-footer {
    text-align: center;
    font-size: 0.7rem;
    color: #94a3b8;
    padding: 6px;
    background: #fff;
}

@media (max-width: 480px) {
    .lab-copilot {
        bottom: 16px;
        right: 16px;
    }
    .copilot-window {
        width: calc(100vw - 32px);
        height: 460px;
    }
    .copilot-toggle {
        padding: 12px 18px;
    }
}
